/* ============================================================
   Toons.ro - Retro Games Platform
   Comprehensive Stylesheet
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root,
[data-bs-theme="dark"] {
    --bg: #0d1117;
    --bg-card: #161b22;
    --bg-sidebar: #0d1117;
    --bg-elevated: #1c2129;
    --bg-hover: #21262d;
    --bg-input: #0d1117;
    --text: #e6edf3;
    --text-muted: #8b949e;
    --text-dim: #6e7681;
    --accent: #58a6ff;
    --accent-hover: #79b8ff;
    --accent-green: #3fb950;
    --accent-green-hover: #56d364;
    --accent-orange: #d2991d;
    --accent-orange-hover: #e3b341;
    --accent-red: #f85149;
    --accent-purple: #a371f7;
    --border: #30363d;
    --border-light: #21262d;
    --radius: 8px;
    --radius-sm: 6px;
    --radius-lg: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.4);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
    --transition: 0.2s ease;
    --transition-slow: 0.3s ease;
    --navbar-bg: rgba(13, 17, 23, 0.85);
    --navbar-border: rgba(48, 54, 61, 0.6);
    --hero-gradient: linear-gradient(135deg, #0d1117 0%, #161b22 40%, #1a1f35 70%, #0d1117 100%);
    --game-overlay: rgba(0,0,0,0.6);
}

[data-bs-theme="light"] {
    --bg: #ffffff;
    --bg-card: #f6f8fa;
    --bg-sidebar: #f6f8fa;
    --bg-elevated: #ffffff;
    --bg-hover: #f0f2f5;
    --bg-input: #ffffff;
    --text: #24292f;
    --text-muted: #656d76;
    --text-dim: #8b949e;
    --accent: #0969da;
    --accent-hover: #0550ae;
    --accent-green: #1a7f37;
    --accent-green-hover: #26a641;
    --accent-orange: #9a6700;
    --accent-orange-hover: #bf8000;
    --accent-red: #cf222e;
    --accent-purple: #8250df;
    --border: #d0d7de;
    --border-light: #d8dee4;
    --radius: 8px;
    --radius-sm: 6px;
    --radius-lg: 12px;
    --shadow: 0 1px 3px rgba(31,35,40,0.12), 0 1px 2px rgba(31,35,40,0.06);
    --shadow-lg: 0 8px 24px rgba(31,35,40,0.15);
    --shadow-sm: 0 1px 2px rgba(31,35,40,0.08);
    --transition: 0.2s ease;
    --transition-slow: 0.3s ease;
    --navbar-bg: rgba(255, 255, 255, 0.85);
    --navbar-border: rgba(208, 215, 222, 0.6);
    --hero-gradient: linear-gradient(135deg, #f6f8fa 0%, #ffffff 40%, #eaeef3 70%, #f6f8fa 100%);
    --game-overlay: rgba(0,0,0,0.4);
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-y: scroll;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color var(--transition-slow), color var(--transition-slow);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--accent-hover);
}

img {
    max-width: 100%;
    height: auto;
}

::selection {
    background: var(--accent);
    color: #fff;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ---------- Navbar ---------- */
.navbar {
    background: var(--navbar-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--navbar-border);
    padding: 0.5rem 0;
    transition: background var(--transition-slow), border-color var(--transition-slow);
    z-index: 1040;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.35rem;
    color: var(--accent) !important;
    letter-spacing: -0.5px;
    transition: color var(--transition);
}

.navbar-brand:hover {
    color: var(--accent-hover) !important;
}

.navbar-brand .bi-controller {
    color: var(--accent-green);
}

.brand-text {
    background: linear-gradient(135deg, var(--accent), var(--accent-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-link {
    color: var(--text-muted) !important;
    font-weight: 500;
    font-size: 0.925rem;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    margin: 0 0.1rem;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text) !important;
    background: var(--bg-hover);
}

.nav-link.active {
    color: var(--accent) !important;
}

.navbar-toggler {
    color: var(--text);
    padding: 0.35rem 0.5rem;
}

.navbar-toggler:focus {
    box-shadow: none;
}

/* ---------- Theme Toggle ---------- */
#themeToggle {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border);
    transition: all var(--transition);
    padding: 0;
}

#themeToggle:hover {
    color: var(--text);
    background: var(--bg-hover);
    border-color: var(--text-muted);
}

[data-bs-theme="dark"] .theme-dark-icon,
[data-bs-theme="light"] .theme-light-icon {
    display: none;
}

[data-bs-theme="dark"] .theme-light-icon,
[data-bs-theme="light"] .theme-dark-icon {
    display: inline-block;
}

/* ---------- User Dropdown ---------- */
.btn-user {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 50px;
    padding: 0.25rem 0.75rem 0.25rem 0.25rem;
    transition: all var(--transition);
}

.btn-user:hover {
    background: var(--bg-hover);
    border-color: var(--text-muted);
}

.avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.username-nav {
    font-weight: 500;
    font-size: 0.875rem;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-menu {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 0.4rem 0;
}

.dropdown-item {
    color: var(--text);
    font-size: 0.9rem;
    padding: 0.5rem 1.25rem;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.dropdown-divider {
    border-color: var(--border);
    margin: 0.3rem 0;
}

/* ---------- Main Content ---------- */
.main-content {
    flex: 1;
    padding-top: 76px;
    min-height: calc(100vh - 76px);
}

/* ---------- Buttons ---------- */
.btn {
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    font-family: inherit;
}

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.btn-outline-primary {
    color: var(--accent);
    border-color: var(--accent);
}

.btn-outline-primary:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.btn-success {
    background: var(--accent-green);
    border-color: var(--accent-green);
}

.btn-success:hover {
    background: var(--accent-green-hover);
    border-color: var(--accent-green-hover);
}

.btn-icon {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.btn-icon:hover {
    color: var(--text);
    background: var(--bg-hover);
    border-color: var(--text-muted);
}

.btn-sm {
    padding: 0.35rem 0.85rem;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 0.65rem 1.75rem;
    font-size: 1rem;
    border-radius: var(--radius);
}

/* ---------- Forms ---------- */
.form-control,
.form-select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.925rem;
    transition: all var(--transition);
    padding: 0.55rem 0.85rem;
}

.form-control:focus,
.form-select:focus {
    background: var(--bg-input);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
    color: var(--text);
}

.form-control::placeholder {
    color: var(--text-dim);
}

.form-label {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text);
    margin-bottom: 0.35rem;
}

.input-group-text {
    background: var(--bg-hover);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* ---------- Cards ---------- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all var(--transition-slow);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    padding: 0.85rem 1.25rem;
    color: var(--text);
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    background: var(--bg-elevated);
    border-top: 1px solid var(--border);
    padding: 0.85rem 1.25rem;
}

/* ---------- Game Card ---------- */
.game-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}

.game-card .card-img-wrapper {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--bg-hover);
}

.game-card .card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.game-card:hover .card-img-wrapper img {
    transform: scale(1.08);
}

.game-card .card-overlay {
    position: absolute;
    inset: 0;
    background: var(--game-overlay);
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity var(--transition);
}

.game-card:hover .card-overlay {
    opacity: 1;
}

.game-card .card-overlay .btn-play {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent-green);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all var(--transition);
    transform: scale(0.8);
}

.game-card:hover .card-overlay .btn-play {
    transform: scale(1);
}

.game-card .card-overlay .btn-play:hover {
    background: var(--accent-green-hover);
    transform: scale(1.1);
}

.game-card .card-info {
    padding: 0.85rem 1rem;
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}

.game-card .game-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.game-card .game-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: auto;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.game-card .game-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.game-card .badge-category {
    position: absolute;
    top: 0.65rem;
    left: 0.65rem;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 500;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    z-index: 2;
}

/* ---------- Game Player ---------- */
.game-player-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.game-player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
}

.game-player-header .game-player-title {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.game-player-header .game-player-title i {
    color: var(--accent-green);
}

.game-player-actions {
    display: flex;
    gap: 0.5rem;
}

.game-player-wrapper {
    position: relative;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.game-player-wrapper canvas {
    max-width: 100%;
    height: auto !important;
}

/* ---------- Hero Section ---------- */
.hero-section {
    background: var(--hero-gradient);
    padding: 3rem 0 2.5rem;
    border-bottom: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 60%;
    height: 200%;
    background: radial-gradient(ellipse, var(--accent) 0%, transparent 70%);
    opacity: 0.04;
    pointer-events: none;
}

.hero-section .hero-title {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 0.25rem;
    letter-spacing: -0.5px;
}

.hero-section .hero-subtitle {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.hero-search {
    max-width: 560px;
}

.hero-search .form-control {
    height: 50px;
    border-radius: 50px;
    padding-left: 1.25rem;
    font-size: 1rem;
    border: 1px solid var(--border);
    background: var(--bg-card);
    box-shadow: var(--shadow);
}

.hero-search .btn {
    border-radius: 50px;
    padding: 0 1.5rem;
    font-weight: 600;
}

/* ---------- Sidebar ---------- */
.sidebar {
    background: var(--bg-sidebar);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.sidebar-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-title i {
    color: var(--accent);
}

.sidebar-categories .list-group-item {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    margin-bottom: 0.15rem;
}

.sidebar-categories .list-group-item:hover,
.sidebar-categories .list-group-item.active {
    background: var(--bg-hover);
    color: var(--accent);
}

.sidebar-categories .list-group-item .badge {
    margin-left: auto;
}

/* ---------- Podium (Top Players) ---------- */
.podium {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.5rem 0;
}

.podium-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 1.25rem 1rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    min-width: 130px;
    transition: all var(--transition);
    position: relative;
}

.podium-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.podium-1 {
    order: 2;
    height: 220px;
    background: linear-gradient(180deg, rgba(211, 153, 29, 0.15) 0%, var(--bg-card) 60%);
    border-color: var(--accent-orange);
}

.podium-2 {
    order: 1;
    height: 180px;
    background: linear-gradient(180deg, rgba(139, 148, 158, 0.1) 0%, var(--bg-card) 60%);
}

.podium-3 {
    order: 3;
    height: 150px;
    background: linear-gradient(180deg, rgba(205, 127, 50, 0.12) 0%, var(--bg-card) 60%);
}

.podium-rank {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.podium-1 .podium-rank { color: var(--accent-orange); }
.podium-2 .podium-rank { color: var(--text-muted); }
.podium-3 .podium-rank { color: #cd7f32; }

.podium-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border);
    margin-bottom: 0.5rem;
}

.podium-1 .podium-avatar {
    width: 80px;
    height: 80px;
    border-color: var(--accent-orange);
}

.podium-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
    text-align: center;
    word-break: break-word;
}

.podium-points {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

.podium-medal {
    font-size: 1.8rem;
}

/* ---------- Game gallery ---------- */
.game-gallery .gallery-item {
    display: block;
    border-radius: 0.6rem;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-card);
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.game-gallery .gallery-item:hover {
    transform: translateY(-2px);
    border-color: var(--brand, #58a6ff);
}

.game-gallery .gallery-item img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    display: block;
}

/* ---------- Comments ---------- */
.comments-section {
    margin-top: 2rem;
}

.comments-title {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--text);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comment {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-light);
}

.comment:last-child {
    border-bottom: none;
}

.comment-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.comment-body {
    flex: 1;
}

.comment-author {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
    margin-bottom: 0.15rem;
}

.comment-date {
    font-size: 0.78rem;
    color: var(--text-dim);
}

.comment-content {
    font-size: 0.9rem;
    color: var(--text);
    margin-top: 0.35rem;
    line-height: 1.5;
}

.comment-form textarea {
    border-radius: var(--radius);
    min-height: 80px;
}

/* ---------- Pagination ---------- */
.pagination {
    gap: 0.25rem;
}

.page-link {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: var(--radius-sm) !important;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.45rem 0.85rem;
    transition: all var(--transition);
    margin: 0 0.1rem;
}

.page-link:hover {
    background: var(--bg-hover);
    color: var(--text);
    border-color: var(--text-muted);
}

.page-item.active .page-link {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.page-item.disabled .page-link {
    background: transparent;
    color: var(--text-dim);
    border-color: var(--border);
}

/* ---------- Alerts ---------- */
.alert {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    padding: 0.85rem 1.15rem;
}

.alert-success {
    background: rgba(63, 185, 80, 0.1);
    border-color: rgba(63, 185, 80, 0.3);
    color: var(--accent-green);
}

.alert-danger {
    background: rgba(248, 81, 73, 0.1);
    border-color: rgba(248, 81, 73, 0.3);
    color: var(--accent-red);
}

.alert-warning {
    background: rgba(210, 153, 29, 0.1);
    border-color: rgba(210, 153, 29, 0.3);
    color: var(--accent-orange);
}

.alert-info {
    background: rgba(88, 166, 255, 0.1);
    border-color: rgba(88, 166, 255, 0.3);
    color: var(--accent);
}

/* ---------- Badges ---------- */
.badge {
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.3em 0.65em;
    border-radius: 20px;
}

.badge-accent {
    background: var(--accent);
    color: #fff;
}

.badge-green {
    background: var(--accent-green);
    color: #fff;
}

.badge-orange {
    background: var(--accent-orange);
    color: #fff;
}

/* ---------- Tables ---------- */
.table {
    color: var(--text);
    border-color: var(--border);
}

.table th {
    font-weight: 600;
    font-size: 0.825rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom-width: 1px;
}

.table td {
    font-size: 0.9rem;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background: var(--bg-hover);
}

/* ---------- Profile ---------- */
.profile-header {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent);
    margin-bottom: 1rem;
}

.profile-username {
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.profile-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
}

.profile-stat {
    text-align: center;
}

.profile-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}

.profile-stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* ---------- Auth Pages ---------- */
.auth-container {
    max-width: 440px;
    margin: 2rem auto;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.auth-card .auth-title {
    font-weight: 700;
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 0.25rem;
    color: var(--text);
}

.auth-card .auth-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-card .auth-link {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ---------- Breadcrumbs ---------- */
.breadcrumb {
    margin-bottom: 1rem;
}

.breadcrumb-item {
    font-size: 0.85rem;
}

.breadcrumb-item a {
    color: var(--text-muted);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--accent);
}

.breadcrumb-item.active {
    color: var(--text);
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--text-dim);
}

/* ---------- Modals ---------- */
.modal-content {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.modal-header {
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem;
}

.modal-footer {
    border-top: 1px solid var(--border);
    padding: 1rem 1.25rem;
}

.modal-title {
    font-weight: 600;
    color: var(--text);
}

.btn-close {
    filter: invert(0.7);
}

/* ---------- Search Autocomplete ---------- */
.search-autocomplete-wrapper {
    position: relative;
}

.search-autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 1050;
    max-height: 320px;
    overflow-y: auto;
    display: none;
}

.search-autocomplete-dropdown.show {
    display: block;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    cursor: pointer;
    transition: background var(--transition);
}

.search-result-item:hover,
.search-result-item.active {
    background: var(--bg-hover);
}

.search-result-item img {
    width: 40px;
    height: 30px;
    border-radius: 4px;
    object-fit: cover;
}

.search-result-title {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text);
}

.search-result-category {
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* ---------- Footer ---------- */
.site-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
    margin-top: 3rem;
    transition: background var(--transition-slow), border-color var(--transition-slow);
}

.site-footer .footer-brand {
    font-weight: 600;
    color: var(--accent);
    margin-right: 0.5rem;
}

.site-footer .footer-copy {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.site-footer .footer-tech {
    font-size: 0.82rem;
    color: var(--text-dim);
}

.site-footer .footer-tech a {
    color: var(--text-muted);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.site-footer .footer-tech a:hover {
    color: var(--accent);
}

/* ---------- Responsive Grid ---------- */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
}

@media (min-width: 1400px) {
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }
}

@media (max-width: 767px) {
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 0.75rem;
    }

    .game-card .game-title {
        font-size: 0.85rem;
    }

    .game-card .game-meta {
        font-size: 0.7rem;
        gap: 0.5rem;
    }

    .game-card .card-info {
        padding: 0.6rem 0.75rem;
    }

    .hero-section .hero-title {
        font-size: 1.6rem;
    }

    .hero-section .hero-subtitle {
        font-size: 0.9rem;
    }

    .podium-item {
        min-width: 100px;
        padding: 0.85rem 0.6rem 0.6rem;
    }

    .podium-avatar {
        width: 48px;
        height: 48px;
    }

    .podium-1 .podium-avatar {
        width: 60px;
        height: 60px;
    }

    .profile-stats {
        gap: 1rem;
    }

    .profile-stat-value {
        font-size: 1.25rem;
    }

    .navbar-brand {
        font-size: 1.15rem;
    }
}

@media (max-width: 575px) {
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }

    .main-content {
        padding-top: 66px;
    }
}

/* ---------- Section Headers ---------- */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.section-title {
    font-weight: 700;
    font-size: 1.35rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.section-title i {
    color: var(--accent);
}

.section-link {
    font-weight: 500;
    font-size: 0.875rem;
}

/* ---------- Utility ---------- */
.text-accent { color: var(--accent) !important; }
.text-green { color: var(--accent-green) !important; }
.text-orange { color: var(--accent-orange) !important; }
.text-red { color: var(--accent-red) !important; }
.text-purple { color: var(--accent-purple) !important; }
.text-muted-custom { color: var(--text-muted) !important; }
.bg-card { background: var(--bg-card) !important; }
.border-custom { border-color: var(--border) !important; }
.radius { border-radius: var(--radius) !important; }
.radius-lg { border-radius: var(--radius-lg) !important; }

/* ---------- Loading / Skeleton ---------- */
.skeleton {
    background: linear-gradient(90deg, var(--bg-hover) 25%, var(--bg-card) 50%, var(--bg-hover) 75%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ---------- OAuth buttons ---------- */
.btn-oauth {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-hover);
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.btn-oauth:hover {
    border-color: var(--accent);
    background: var(--bg-elevated);
    color: var(--text);
    transform: translateY(-1px);
}

.btn-oauth .bi-google { color: #ea4335; }
.btn-oauth .bi-facebook { color: #1877f2; }

/* ---------- Toast (unified notifications) ---------- */.toast-container {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.55rem;
    pointer-events: none;
}

.toast-custom {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    box-sizing: border-box;
    width: max-content;
    max-width: min(360px, calc(100vw - 3rem));
    padding: 0.8rem 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-elevated);
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.4;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(12px);
    animation: toastIn 0.3s ease forwards;
    will-change: opacity, transform;
}

.toast-custom.is-hiding {
    animation: toastOut 0.45s ease forwards;
}

.toast-custom .toast-icon {
    flex-shrink: 0;
    font-size: 1.05rem;
    line-height: 1;
}

.toast-message {
    min-width: 0;
    overflow-wrap: anywhere;
}

.toast-success { border-color: rgba(63, 185, 80, 0.45); }
.toast-success .toast-icon { color: #3fb950; }
.toast-error { border-color: rgba(255, 84, 112, 0.45); }
.toast-error .toast-icon { color: #ff5470; }
.toast-warning { border-color: rgba(255, 179, 64, 0.5); }
.toast-warning .toast-icon { color: #ffb340; }
.toast-info { border-color: rgba(108, 182, 255, 0.45); }
.toast-info .toast-icon { color: #6cb6ff; }

@keyframes toastIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(10px); }
}

@media (max-width: 575.98px) {
    .toast-container {
        left: 1rem;
        right: auto;
        bottom: 1rem;
        width: calc(100vw - 2rem);
        align-items: stretch;
    }
    .toast-custom {
        width: 100%;
        max-width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .toast-custom,
    .toast-custom.is-hiding {
        animation-duration: 0.01ms;
    }
}

/* ---------- Empty State ---------- */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
    opacity: 0.4;
}

.empty-state p {
    font-size: 0.95rem;
    max-width: 400px;
    margin: 0 auto;
}

/* ---------- Transitions for theme ---------- */
body,
.navbar,
.site-footer,
.card,
.game-card,
.form-control,
.form-select,
.btn,
.dropdown-menu,
.alert,
.badge,
.modal-content,
.podium-item,
.page-link,
.comment,
.sidebar {
    transition: background-color var(--transition-slow),
                border-color var(--transition-slow),
                color var(--transition-slow),
                box-shadow var(--transition-slow);
}

/* ---------- Star Rating ---------- */
.star-rating {
    color: var(--accent-orange);
    display: inline-flex;
    align-items: center;
    gap: 1px;
    font-size: 0.85rem;
}
.star-rating i {
    font-size: 0.85rem;
}

.rating-vote-bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}
.rating-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}
.star-vote {
    display: inline-flex;
    gap: 2px;
    cursor: pointer;
}
.star-vote i {
    font-size: 1.3rem;
    color: var(--accent-orange);
    transition: transform 0.15s ease, color 0.15s ease;
}
.star-vote i:hover {
    transform: scale(1.2);
}
.star-vote i.bi-star {
    color: var(--text-dim);
}

.rating-bar-sep {
    width: 1px;
    height: 24px;
    background: var(--border);
    flex-shrink: 0;
}
.btn-like {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 0;
    cursor: pointer;
    transition: color var(--transition);
    white-space: nowrap;
}
.btn-like:hover {
    color: var(--accent-red);
}
.btn-like i {
    font-size: 1rem;
}

.fav-card-wrapper {
    position: relative;
}
.fav-remove-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5;
    background: rgba(0,0,0,0.5);
    border: none;
    color: #fff;
    font-size: 0.8rem;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
}
.fav-card-wrapper:hover .fav-remove-btn {
    opacity: 1;
}
.fav-remove-btn:hover {
    background: var(--accent-red);
}
