:root {
    --ink: #211b43;
    --muted: #726d86;
    --purple: #302078;
    --purple-2: #513f9f;
    --pink: #ff5c9a;
    --orange: #ffb52e;
    --line: #ece9f5;
    --surface: #ffffff;
    --page: #f7f6fc;
    --shadow: 0 12px 35px rgba(48, 32, 120, .08);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--page);
    color: var(--ink);
    font-family: "Heebo", "Rubik", Arial, sans-serif;
    line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
.container { width: min(1240px, calc(100% - 36px)); margin-inline: auto; }
.site-header {
    background: var(--purple);
    color: #fff;
    position: relative;
    overflow: hidden;
}
.site-header::after {
    content: "";
    position: absolute;
    width: 300px; height: 300px;
    border: 48px solid rgba(255,255,255,.055);
    border-radius: 50%;
    inset: -190px auto auto 13%;
    pointer-events: none;
}
.header-inner {
    width: min(1240px, calc(100% - 36px));
    min-height: 76px;
    margin: auto;
    display: flex;
    align-items: center;
    gap: 24px;
    position: relative;
    z-index: 1;
}
.brand { color: #fff; font-size: 30px; line-height: 1; font-weight: 1000; letter-spacing: -1.8px; }
.brand span { color: var(--orange); }
.header-tagline { color: #ddd7ff; font-size: 14px; font-weight: 600; }
.header-action, .primary-button {
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: 999px; background: var(--orange); color: #39245f;
    font-weight: 800; padding: 10px 18px; cursor: pointer;
}
.header-action { margin-inline-start: auto; }
.hero {
    min-height: 190px;
    margin: 24px 0 32px;
    border-radius: 24px;
    padding: 30px 38px;
    color: #fff;
    background: linear-gradient(115deg, #39267e 0%, #6347be 55%, #a64fb3 100%);
    display: flex; align-items: center; justify-content: space-between;
    overflow: hidden; position: relative;
    box-shadow: var(--shadow);
}
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.08); }
.hero::before { width: 260px; height: 260px; left: 10%; top: -160px; }
.hero::after { width: 130px; height: 130px; left: 35%; bottom: -90px; }
.hero-copy { position: relative; z-index: 1; }
.eyebrow, .section-kicker { display: block; color: #ffbd48; font-size: 11px; font-weight: 900; letter-spacing: .8px; }
.hero h1 { margin: 5px 0; font-size: clamp(26px, 4vw, 38px); line-height: 1.2; }
.hero p { margin: 8px 0 0; color: #e7e1ff; }
.hero-decoration { display: flex; align-items: center; gap: 18px; font-size: 45px; transform: rotate(-8deg); position: relative; z-index: 1; }
.hero-decoration span:first-child { color: #ffd15c; font-size: 65px; }
.hero-decoration span:last-child { color: #ff92bd; font-size: 58px; }
.games-section { padding-bottom: 55px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-heading h2 { margin: 2px 0 0; font-size: 23px; }
.section-heading .section-kicker { color: #8b7bc3; }
.section-note { color: var(--muted); font-size: 12px; }
.games-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    grid-auto-rows: auto;
    gap: 14px;
    align-items: stretch;
}
.game-card { display: flex; min-width: 0; flex-direction: column; gap: 6px; }
.game-image-wrap {
    position: relative; width: 100%; aspect-ratio: 1 / 1; overflow: hidden;
    border-radius: 13px; background: #ebe7f8; box-shadow: 0 4px 13px rgba(32,22,75,.08);
}
.game-image-wrap img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .22s ease; }
.game-card:hover .game-image-wrap img { transform: scale(1.055); }
.play-overlay {
    position: absolute; inset: 0; display: grid; place-items: center;
    color: white; font-size: 22px; opacity: 0; background: rgba(40,25,100,.28); transition: opacity .2s ease;
}
.game-card:hover .play-overlay { opacity: 1; }
.game-title { display: block; text-align: center; font-weight: 750; font-size: 12px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-card {
    grid-column: span 2;
    grid-row: span 2;
    min-width: 0; min-height: 0;
    position: relative; overflow: hidden;
    border-radius: 15px; background: #ffe8b7;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 20px rgba(95,68,15,.09);
}
.ad-card > img, .ad-image-link, .ad-image-link img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ad-image-link { position: absolute; inset: 0; }
.ad-label {
    position: absolute; z-index: 2; top: 9px; right: 9px;
    border-radius: 5px; padding: 3px 7px; background: rgba(255,255,255,.9);
    color: #76511b; font-size: 10px; font-weight: 800;
}
.ad-placeholder { padding: 20px; text-align: center; color: #784214; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ad-placeholder strong { font-size: clamp(14px, 1.5vw, 20px); }
.ad-placeholder small { font-size: 12px; }
.ad-star { font-size: clamp(30px, 4vw, 54px); line-height: 1; color: #f39a22; }
.notice, .empty-state, .player-unavailable { border: 1px solid var(--line); background: #fff; border-radius: 18px; padding: 35px; text-align: center; }
.empty-emoji { font-size: 42px; }
.empty-state h3 { margin: 8px 0 4px; }
.empty-state p { margin: 0; color: var(--muted); }
.site-footer { background: #21164f; color: #cbc4ed; text-align: center; padding: 22px; font-size: 12px; }
.site-footer span { color: #fff; font-weight: 900; letter-spacing: 1px; }

/* Individual game page */
.game-page { padding-top: 20px; padding-bottom: 55px; }
.breadcrumbs { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--muted); margin-bottom: 18px; }
.breadcrumbs a { color: var(--purple-2); font-weight: 700; }
.game-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.game-heading h1 { margin: 3px 0; font-size: clamp(24px, 4vw, 34px); }
.game-heading p { margin: 4px 0 0; color: var(--muted); }
.views-count { white-space: nowrap; color: var(--muted); font-size: 12px; background: #fff; padding: 8px 12px; border-radius: 999px; }
.game-player-section { background: #21164f; border-radius: 18px; padding: 12px; box-shadow: var(--shadow); }
.game-player { width: 100%; aspect-ratio: 16 / 9; min-height: 300px; background: #090713; border-radius: 11px; overflow: hidden; }
.game-player iframe { display: block; width: 100%; height: 100%; min-height: 300px; border: 0; background: #090713; }
.player-toolbar { color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 2px 0; font-size: 13px; }
.secondary-button { display: inline-flex; justify-content: center; align-items: center; border: 1px solid #ded8f0; background: white; color: var(--purple); padding: 8px 14px; border-radius: 999px; font-size: 12px; font-weight: 800; cursor: pointer; }
.info-panel { margin-top: 20px; padding: 22px; border-radius: 16px; background: #fff; border: 1px solid var(--line); }
.info-panel h2 { margin: 0 0 8px; font-size: 19px; }
.info-panel p { margin: 0; white-space: normal; color: #504b62; }
.player-unavailable { color: var(--ink); background: #fff; }
.player-unavailable > span { font-size: 35px; }
.player-unavailable h2 { margin: 5px 0; }
.player-unavailable p { color: var(--muted); }
.related-section { margin-top: 32px; }
.related-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 13px; }

/* Admin */
.admin-body { min-height: 100vh; background: #f5f3fb; }
.login-shell { width: min(440px, calc(100% - 30px)); margin: 6vh auto; }
.login-brand { display: block; text-align: center; color: var(--purple); margin-bottom: 22px; }
.login-card { background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 20px; padding: 28px; }
.login-card h1 { margin: 4px 0; font-size: 25px; }
.login-card p { color: var(--muted); margin: 0 0 20px; font-size: 13px; }
.login-card form { display: flex; flex-direction: column; gap: 9px; }
.login-card label { font-size: 13px; font-weight: 700; margin-top: 7px; }
.login-card input { width: 100%; height: 44px; padding: 8px 12px; border: 1px solid #dedbea; border-radius: 10px; outline: none; }
.login-card input:focus { border-color: #8069cc; box-shadow: 0 0 0 3px rgba(128,105,204,.12); }
.primary-button { min-height: 44px; margin-top: 12px; }
.full-width { width: 100%; }
.form-error { background: #fff0f1; color: #a61d35; padding: 10px; border-radius: 9px; font-size: 12px; margin: 12px 0; }
.back-link { display: block; text-align: center; color: var(--muted); font-size: 12px; margin-top: 18px; }
.admin-topbar { min-height: 70px; padding: 12px max(20px, calc((100% - 1200px)/2)); background: var(--purple); color: #fff; display: flex; justify-content: space-between; align-items: center; }
.admin-top-actions { display: flex; align-items: center; gap: 18px; font-size: 13px; }
.admin-top-actions form { margin: 0; }
.logout-button { border: 1px solid rgba(255,255,255,.4); border-radius: 999px; color: #fff; padding: 7px 14px; background: transparent; cursor: pointer; }
.admin-container { width: min(1200px, calc(100% - 36px)); margin: 32px auto; }
.admin-welcome { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.admin-welcome h1 { margin: 3px 0; font-size: 27px; }
.admin-welcome p { color: var(--muted); margin: 0; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat-card, .admin-panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 20px; box-shadow: 0 5px 20px rgba(48,32,120,.04); }
.stat-card span { display: block; color: var(--muted); font-size: 12px; }
.stat-card strong { display: block; color: var(--purple); font-size: 32px; margin-top: 5px; }
.admin-panel { margin-top: 20px; }
.admin-panel h2 { margin: 0 0 7px; }
.admin-panel p { color: var(--muted); font-size: 13px; }
.admin-shortcuts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-top: 18px; }
.shortcut-card { border: 1px solid var(--line); border-radius: 13px; padding: 15px; display: flex; flex-direction: column; gap: 5px; }
.shortcut-card > span { font-size: 25px; }
.shortcut-card strong { font-size: 13px; }
.shortcut-card small { color: var(--muted); font-size: 11px; }

@media (max-width: 1050px) {
    .games-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
    .related-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
    .container, .header-inner { width: min(100% - 24px, 560px); }
    .header-inner { min-height: 64px; gap: 10px; }
    .brand { font-size: 26px; }
    .header-tagline { font-size: 11px; }
    .header-action { padding: 8px 12px; font-size: 11px; }
    .hero { min-height: 155px; margin: 14px 0 22px; padding: 23px 19px; border-radius: 18px; }
    .hero h1 { font-size: 24px; max-width: 280px; }
    .hero p { font-size: 12px; }
    .hero-decoration { font-size: 28px; gap: 5px; margin-inline-start: -15px; }
    .hero-decoration span:first-child { font-size: 40px; }
    .hero-decoration span:last-child { font-size: 35px; }
    .section-heading h2 { font-size: 19px; }
    .section-note { display: none; }
    .games-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; grid-auto-rows: auto; }
    .game-image-wrap { border-radius: 10px; }
    .game-title { font-size: 11px; }
    .ad-card { border-radius: 11px; }
    .ad-placeholder { padding: 8px; gap: 5px; }
    .ad-placeholder small { font-size: 10px; }
    .game-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
    .game-player-section { padding: 7px; border-radius: 12px; }
    .game-player, .game-player iframe { min-height: 230px; }
    .player-toolbar { font-size: 11px; }
    .related-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-welcome { align-items: flex-start; flex-direction: column; }
    .admin-topbar { padding-inline: 14px; }
    .admin-top-actions { gap: 9px; font-size: 11px; }
    .login-card { padding: 22px; }
}

/* Statistics dashboard */
.admin-nav-link { color: #fff; font-size: 12px; font-weight: 750; text-decoration: none; }
.stats-filter { display: flex; align-items: center; gap: 8px; }
.stats-filter label { color: var(--muted); font-size: 12px; font-weight: 700; }
.stats-filter select { min-height: 40px; border: 1px solid #dedbea; border-radius: 10px; background: #fff; color: var(--ink); padding: 7px 12px; font: inherit; }
.stats-grid-dashboard { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats-panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 16px; }
.stats-panel-heading h2 { margin: 0 0 4px; }
.stats-panel-heading p { margin: 0; }
.chart-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 13px; color: var(--muted); font-size: 11px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; }
.legend-page { background: #7354c8; }
.legend-game { background: #22b8a5; }
.stats-chart { min-height: 220px; display: grid; grid-template-columns: repeat(auto-fit, minmax(28px, 1fr)); align-items: end; gap: 5px; overflow-x: auto; padding: 12px 2px 0; border-bottom: 1px solid #e9e5f2; }
.chart-day { min-width: 0; height: 200px; display: flex; flex-direction: column; justify-content: end; align-items: center; gap: 7px; }
.chart-bars { width: 100%; height: 170px; display: flex; justify-content: center; align-items: end; gap: 3px; }
.chart-bar { display: block; width: min(38%, 13px); min-height: 0; border-radius: 5px 5px 0 0; }
.chart-bar-page { background: #7354c8; }
.chart-bar-game { background: #22b8a5; }
.chart-day small { color: var(--muted); font-size: 9px; white-space: nowrap; }
.stats-empty { border: 1px dashed #d9d3e8; color: var(--muted); background: #fbfaff; border-radius: 12px; padding: 25px; text-align: center; font-size: 13px; }
.table-wrap { width: 100%; overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th, .admin-table td { padding: 12px 10px; text-align: right; border-bottom: 1px solid #eeeaf5; white-space: nowrap; }
.admin-table th { color: var(--muted); background: #faf9fd; font-size: 11px; }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.stats-disclaimer { color: var(--muted); font-size: 11px; line-height: 1.6; margin: 15px 2px; }
.shortcut-card[href] { color: inherit; text-decoration: none; transition: border-color .18s ease, transform .18s ease; }
.shortcut-card[href]:hover { border-color: #a99ad8; transform: translateY(-2px); }
@media (max-width: 800px) {
    .stats-grid-dashboard { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stats-panel-heading { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 560px) {
    .stats-filter { width: 100%; }
    .stats-filter select { flex: 1; }
    .stats-chart { grid-template-columns: repeat(7, minmax(27px, 1fr)); overflow-x: auto; }
}
