/* === RESET & BASE === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: #141414;
    color: #fff;
    min-height: 100vh;
    overflow-x: hidden;
}
a { color: #fff; text-decoration: none; }
img { max-width: 100%; display: block; }

/* === NAVBAR === */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 4%; height: 64px;
    background: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, transparent 100%);
    transition: background 0.3s;
}
.navbar.scrolled { background: #141414; }
.nav-left { display: flex; align-items: center; gap: 30px; }
.nav-logo { color: #e50914; font-size: 1.6rem; font-weight: 700; letter-spacing: -1px; }
.nav-logo span { color: #fff; font-weight: 700; }
.nav-links { display: flex; gap: 20px; }
.nav-links a { color: #b3b3b3; font-size: 0.9rem; transition: color 0.2s; }
.nav-links a:hover, .nav-links a.active { color: #fff; }
.nav-right { display: flex; align-items: center; gap: 15px; }

/* Search */
.search-box { position: relative; }
.search-box i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: #8c8c8c; font-size: 0.85rem; }
.search-box input {
    background: rgba(255,255,255,0.1); border: 1px solid #444; color: #fff;
    padding: 7px 12px 7px 32px; border-radius: 4px; font-size: 0.85rem; width: 200px;
    transition: width 0.3s, background 0.3s;
}
.search-box input:focus { background: rgba(0,0,0,0.8); border-color: #fff; width: 280px; outline: none; }

/* User dropdown */
.user-dropdown { position: relative; }
.user-btn {
    background: none; border: none; color: #fff; cursor: pointer;
    display: flex; align-items: center; gap: 6px; font-size: 0.85rem; font-family: inherit;
}
.user-menu {
    display: none; position: absolute; right: 0; top: 50px;
    background: #1a1a1a; border: 1px solid #333; border-radius: 4px;
    min-width: 180px; overflow: hidden; box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}
.user-menu.show { display: block; }
.user-menu a { display: block; padding: 10px 16px; font-size: 0.85rem; color: #ccc; transition: background 0.2s; }
.user-menu a:hover { background: #333; color: #fff; }
.user-menu hr { border: none; border-top: 1px solid #333; margin: 4px 0; }
.mobile-menu-btn { display: none; background: none; border: none; color: #fff; font-size: 1.2rem; cursor: pointer; }

/* === HERO === */
.hero {
    position: relative; height: 70vh; min-height: 450px;
    display: flex; align-items: flex-end; padding: 0 4% 8%;
    background-size: cover; background-position: center;
}
.hero::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(0deg, #141414 0%, transparent 50%, rgba(0,0,0,0.4) 100%);
}
.hero-content { position: relative; max-width: 600px; }
.hero-content h1 { font-size: 2.8rem; font-weight: 700; margin-bottom: 12px; text-shadow: 0 2px 8px rgba(0,0,0,0.5); }
.hero-content p { color: #ddd; font-size: 1rem; line-height: 1.5; margin-bottom: 20px; }
.hero-actions { display: flex; gap: 10px; }

/* === BUTTONS === */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 24px; border-radius: 4px; font-size: 0.95rem; font-weight: 600;
    border: none; cursor: pointer; transition: background 0.2s, transform 0.1s; font-family: inherit;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: #e50914; color: #fff; }
.btn-primary:hover { background: #f40612; }
.btn-secondary { background: rgba(255,255,255,0.2); color: #fff; }
.btn-secondary:hover { background: rgba(255,255,255,0.3); }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-danger { background: #dc3545; color: #fff; }
.btn-danger:hover { background: #c82333; }
.btn-success { background: #28a745; color: #fff; }
.btn-success:hover { background: #218838; }

/* === ROWS (Carrousels) === */
.content-rows { padding: 0 4% 60px; margin-top: -80px; position: relative; z-index: 2; }
.content-row { margin-bottom: 40px; }
.row-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.row-title { font-size: 1.3rem; font-weight: 600; }
.row-title a { color: #fff; }
.row-title a:hover { color: #e50914; }
.see-all { color: #b3b3b3; font-size: 0.85rem; }
.see-all:hover { color: #fff; }

.carousel-wrapper { position: relative; }
.carousel {
    display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory;
    scrollbar-width: none; padding: 10px 0;
}
.carousel::-webkit-scrollbar { display: none; }
.carousel-btn {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 10;
    background: rgba(0,0,0,0.6); border: none; color: #fff; width: 40px; height: 80px;
    cursor: pointer; font-size: 1.2rem; transition: background 0.2s;
}
.carousel-btn:hover { background: rgba(0,0,0,0.9); }
.carousel-btn.left { left: 0; border-radius: 0 4px 4px 0; }
.carousel-btn.right { right: 0; border-radius: 4px 0 0 4px; }

/* === CARDS === */
.card {
    flex: 0 0 200px; scroll-snap-align: start;
    border-radius: 6px; overflow: hidden; position: relative;
    background: #222; cursor: pointer; transition: transform 0.3s, box-shadow 0.3s;
}
.card:hover { transform: scale(1.08); z-index: 5; box-shadow: 0 8px 24px rgba(0,0,0,0.5); }
.card-img {
    width: 100%; aspect-ratio: 2/3; object-fit: cover; background: #333;
    display: flex; align-items: center; justify-content: center;
}
.card-img i { font-size: 3rem; color: #555; }
.card-info { padding: 10px; }
.card-title { font-size: 0.8rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { font-size: 0.7rem; color: #888; margin-top: 4px; }
.card-badge {
    position: absolute; top: 8px; left: 8px;
    background: #e50914; color: #fff; font-size: 0.6rem; font-weight: 700;
    padding: 2px 6px; border-radius: 3px;
}
.card-fav {
    position: absolute; top: 8px; right: 8px;
    background: rgba(0,0,0,0.6); border: none; color: #fff; width: 30px; height: 30px;
    border-radius: 50%; cursor: pointer; font-size: 0.75rem; display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.2s;
}
.card:hover .card-fav { opacity: 1; }
.card-fav.active { color: #e50914; }

/* === GRID === */
.grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px; padding: 20px 0;
}
.grid .card { flex: none; }

/* === SYSTEM HEADER === */
.system-hero {
    padding: 100px 4% 40px; background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}
.system-hero h1 { font-size: 2rem; margin-bottom: 8px; }
.system-hero p { color: #aaa; font-size: 0.95rem; }
.system-stats { display: flex; gap: 20px; margin-top: 12px; }
.system-stats span { color: #888; font-size: 0.85rem; }

/* === PLAY PAGE === */
.play-page { padding-top: 64px; }
.game-container {
    width: 100%; max-width: 960px; margin: 20px auto;
    aspect-ratio: 4/3; background: #000; border-radius: 8px; overflow: hidden;
}
.game-info { max-width: 960px; margin: 0 auto; padding: 20px 4%; }
.game-info h1 { font-size: 1.8rem; margin-bottom: 8px; }
.game-info .meta { color: #888; font-size: 0.9rem; margin-bottom: 16px; }
.game-info .meta span { margin-right: 16px; }
.game-info .description { color: #ccc; line-height: 1.6; margin-bottom: 20px; }
.game-actions { display: flex; gap: 10px; margin-bottom: 20px; }

/* === FORMS === */
.form-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.8)),
                url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><rect fill="%23141414"/></svg>');
}
.form-box {
    background: rgba(0,0,0,0.75); padding: 48px; border-radius: 8px;
    width: 100%; max-width: 400px;
}
.form-box h1 { font-size: 2rem; margin-bottom: 24px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; color: #8c8c8c; font-size: 0.85rem; margin-bottom: 4px; }
.form-control {
    width: 100%; padding: 12px; background: #333; border: 1px solid #444;
    border-radius: 4px; color: #fff; font-size: 0.95rem; font-family: inherit;
}
.form-control:focus { outline: none; border-color: #e50914; }
.form-control::placeholder { color: #6c6c6c; }
select.form-control { appearance: auto; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-error { color: #e50914; font-size: 0.85rem; margin-bottom: 12px; }
.form-link { text-align: center; margin-top: 16px; color: #8c8c8c; font-size: 0.85rem; }
.form-link a { color: #fff; }
.form-link a:hover { text-decoration: underline; }

/* === ADMIN === */
.admin-page { padding: 80px 4% 40px; }
.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.admin-header h1 { font-size: 1.6rem; }
.table-wrapper { overflow-x: auto; }
.admin-table {
    width: 100%; border-collapse: collapse; background: #1a1a1a; border-radius: 8px; overflow: hidden;
}
.admin-table th, .admin-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid #2a2a2a; }
.admin-table th { background: #222; color: #aaa; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; }
.admin-table td { font-size: 0.9rem; }
.admin-table tr:hover { background: #222; }
.admin-table .actions { display: flex; gap: 6px; }

/* === EMPTY STATE === */
.empty-state {
    text-align: center; padding: 80px 20px; color: #555;
}
.empty-state i { font-size: 4rem; margin-bottom: 16px; }
.empty-state p { font-size: 1.1rem; margin-bottom: 20px; }

/* === PAGINATION === */
.pagination { display: flex; justify-content: center; gap: 6px; margin: 30px 0; }
.pagination a, .pagination span {
    padding: 8px 14px; border-radius: 4px; font-size: 0.85rem;
    background: #222; color: #ccc; transition: background 0.2s;
}
.pagination a:hover { background: #333; }
.pagination .active { background: #e50914; color: #fff; }

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .navbar { padding: 0 3%; height: 56px; }
    .nav-links { display: none; flex-direction: column; position: absolute; top: 56px; left: 0; right: 0; background: #141414; padding: 10px 0; }
    .nav-links.mobile-open { display: flex; }
    .nav-links a { padding: 10px 20px; }
    .nav-logo { font-size: 1.3rem; }
    .search-box { display: none; }
    .mobile-menu-btn { display: block; }
    .hero { height: 50vh; min-height: 300px; padding-bottom: 15%; }
    .hero-content h1 { font-size: 1.6rem; }
    .card { flex: 0 0 140px; }
    .grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
    .form-box { padding: 24px; margin: 16px; }
    .admin-page { padding: 70px 2% 20px; }
}
