:root {
    color: #1e2637;
    background: #f7f8ff;
    font-family: Inter, system-ui, sans-serif;
    --accent: #b83345;
    --line: #e8ebf4;
}
* { box-sizing: border-box; }
body { margin: 0; padding-bottom: 90px; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
.frame { width: min(100%, 1280px); margin-inline: auto; padding-inline: 24px; }
.site-header { position: sticky; top: 0; z-index: 2; background: #fff; border-bottom: 1px solid var(--line); }
.header-inner { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.logo { display: block; width: clamp(130px, 26vw, 190px); height: 46px; object-fit: contain; }
.header-inner > a:first-child { background: #1e2637; border-radius: 10px; padding-inline: 6px; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.primary, .shortcut { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; font-weight: 700; }
.primary { padding: 8px 14px; background: var(--accent); color: #fff; font-size: 13px; white-space: nowrap; }
.shortcut { width: 36px; height: 36px; background: #f7f8ff; color: var(--accent); }
.hero-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-block: 12px 20px; }
.hero { display: grid; align-content: end; justify-items: start; min-height: 240px; padding: 24px; border-radius: 16px; color: #fff; background: linear-gradient(0deg, #111728e8, transparent 85%), #1e2637 url("../images/lobby/aviator-banner.jpg") center / cover no-repeat; }
.hero h1 { margin: 0 0 12px; font-size: clamp(22px, 4vw, 34px); }
.quick-links { display: grid; align-content: center; gap: 8px; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.quick-links a { display: flex; justify-content: space-between; padding: 12px; border-radius: 10px; background: #f7f8ff; font-weight: 650; }
.category-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.category-grid a { padding: 9px 15px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-size: 14px; font-weight: 650; }
.category-grid [aria-current] { background: var(--accent); border-color: var(--accent); color: #fff; }
.game-section { margin-bottom: 24px; }
.game-section h2 { border-left: 5px solid #f95959; padding-left: 8px; margin: 0 0 12px; font-size: 19px; }
.card-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.game-card { position: relative; aspect-ratio: 4 / 5; isolation: isolate; overflow: hidden; padding: 0; background: #25304a; color: #fff; border: 0; border-radius: 14px; cursor: pointer; text-align: left; }
.game-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.game-card span { position: absolute; inset: auto 0 0; padding: 16px 8px 8px; background: linear-gradient(transparent, #121728 65%); font-size: 13px; font-weight: 700; }
.game-card:disabled { opacity: .6; cursor: wait; }
#lobbyStatus { color: #96202e; }
#lobbyStatus:empty { display: none; }
.bottom-nav { position: fixed; inset: auto 0 0; z-index: 2; display: flex; justify-content: space-evenly; background: #fff; border-top: 1px solid var(--line); padding: 8px 4px max(8px, env(safe-area-inset-bottom)); }
.bottom-nav a { min-width: 60px; text-align: center; font-size: 12px; }
.bottom-nav span { display: block; font-size: 23px; line-height: 1.2; }
.bottom-nav [aria-current] { color: var(--accent); font-weight: 750; }
@media (max-width: 1000px) { .card-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 680px) {
    .frame { padding-inline: 12px; }
    .hero-grid { grid-template-columns: 1fr; gap: 8px; }
    .hero { min-height: 0; aspect-ratio: 16 / 9; padding: 16px; }
    .quick-links { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 6px; }
    .quick-links a { padding: 8px 5px; align-items: center; font-size: 12px; }
    .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}

/* Mobile lobby proportions from the recorded reference. */
body { background: #f4f5fa; }
.frame { width: min(100%, 460px); padding-inline: 12px; }
main.frame, .site-header { background: #fff; }
main.frame { min-height: 100vh; padding-bottom: 18px; }
.header-inner { min-height: 48px; }
.header-inner > a:first-child { background: transparent; padding: 0; }
.logo { height: 42px; width: 113px; }
.hero-grid { display: block; margin: 0 0 8px; padding-top: 5px; }
.hero { display: block; min-height: 0; aspect-ratio: 2.16; padding: 0; overflow: hidden; border-radius: 9px; background: #252233; }
.hero img { display: block; width: 100%; height: 100%; object-fit: cover; }
.lobby-notice { display: flex; align-items: center; gap: 7px; padding: 5px 7px; margin-bottom: 8px; font-size: 11px; color: #5b5968; }
.lobby-notice a { margin-left: auto; color: #a62f43; border-radius: 10px; background: #fff2f3; padding: 4px 7px; }
.category-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; margin-bottom: 10px; }
.category-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; grid-column: span 2; border: 0; border-radius: 9px; padding: 3px 4px 6px; background: linear-gradient(#72a9ff,#5385f6,#3f6ce8); color: #fff; cursor: pointer; font-weight: 750; font-size: 12px; }
.category-tile img { width: 74px; max-width: 100%; height: 60px; object-fit: contain; filter: drop-shadow(0 3px 3px #28204545); }
.category-tile:nth-child(2) { background: linear-gradient(#c795fa,#ad6df0,#9955e4); }
.category-tile:nth-child(3) { background: linear-gradient(#63dfeb,#32c4dd,#1aaec9); }
.category-coral { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0,1fr)); border-radius: 9px; overflow: hidden; background: linear-gradient(90deg,#ff9f6c,#ff8362,#f8725a); }
.category-coral .category-tile { grid-column: auto; background: transparent; border-radius: 0; }
.category-coral .category-tile + .category-tile { border-left: 1px solid #ffffff40; }
.category-coral img { height: 45px; }
.category-grid > .category-tile:nth-last-child(-n+2) { grid-column: span 3; flex-direction: row; justify-content: space-between; padding: 3px 13px 3px 6px; background: linear-gradient(90deg,#ffc163,#ffa544,#f98b32); }
.category-grid > .category-tile:last-child { background: linear-gradient(90deg,#ff9ec7,#f77cb2,#ed5d9d); }
.category-grid > .category-tile:nth-last-child(-n+2) img { height: 44px; }
.category-tile:focus-visible { outline: 2px solid #501c48; outline-offset: -3px; }
.card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.game-card { aspect-ratio: 1; border-radius: 8px; }
.game-card span { padding: 13px 4px 5px; font-size: 11px; }
.game-section h2 { font-size: 14px; border-width: 3px; color: #a62f43; margin-bottom: 8px; }
.bottom-nav {
    width: min(100%, 460px);
    margin-inline: auto;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: end;
    padding: 4px 4px max(4px, env(safe-area-inset-bottom));
    box-shadow: 0 -4px 16px #1e26370d;
}
.bottom-nav a { min-width: 0; min-height: 44px; display: grid; justify-items: center; align-content: end; gap: 3px; padding-bottom: 4px; font-size: 10px; color: #616d83; }
.bottom-nav svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.bottom-nav [aria-current], .bottom-nav .rewards-tab { color: #bc3548; font-weight: 750; }
.rewards-tab img { width: min(100%, 72px); height: 45px; object-fit: contain; margin-top: -18px; }

.lobby-splash:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: grid;
    justify-items: center;
    background: #9699a6;
    pointer-events: none;
}
.splash-panel {
    width: min(100%, 400px);
    display: grid;
    place-content: center;
    justify-items: center;
    gap: clamp(32px, 9vh, 86px);
    background: linear-gradient(#d00000, #f23737);
}
.splash-art { width: min(68vw, 280px); }
.splash-logo { width: min(50vw, 190px); }

:root { --lobby-width: 400px; }
body { background: #9699a6; }
.frame, .bottom-nav, .site-header { width: min(100%, var(--lobby-width)); margin-inline: auto; }
.header-inner { min-height: 49px; }
main.frame { background: #f5f6fd; }
.hero-grid { padding-top: 11px; margin-bottom: 9px; }
.hero { display: flex; aspect-ratio: 2.2; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: 12px; }
.hero::-webkit-scrollbar { display: none; }
.hero a { flex: 0 0 100%; min-width: 0; scroll-snap-align: start; scroll-snap-stop: always; }
.hero img { object-position: center; }
.carousel-controls { display: flex; justify-content: center; align-items: center; gap: 4px; margin-top: -26px; position: relative; pointer-events: none; }
.carousel-controls button { pointer-events: auto; border: 0; color: #fff; background: #222a41ae; border-radius: 99px; width: 22px; height: 22px; padding: 0; cursor: pointer; }
.carousel-controls [data-slide]::before { content: ''; display: block; margin: auto; width: 6px; height: 6px; border-radius: 50%; background: #ffffff9f; }
.carousel-controls [data-slide][aria-current]::before { background: white; }
.lobby-notice { min-height: 40px; background: #fff; border-radius: 24px; padding: 3px 9px; margin-bottom: 15px; font-size: 12px; font-weight: 650; }
.lobby-notice svg { flex: 0 0 18px; fill: none; stroke: #f95959; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.lobby-notice a { color: #b72b3b; border: 1px solid #ff636d; border-radius: 20px; background: #fff; padding: 5px 12px; font-weight: 500; }
.category-grid { gap: 14px 12px; margin-bottom: 12px; }
.category-tile { min-height: 104px; font-size: 14px; border-radius: 12px; }
.category-tile img { width: 94px; height: 78px; }
.category-coral { border-radius: 12px; }
.category-coral .category-tile { min-height: 88px; }
.category-coral img { height: 58px; }
.category-grid > .category-tile:nth-last-child(-n+2) { min-height: 68px; }
.category-grid > .category-tile:nth-last-child(-n+2) img { height: 57px; }
.card-grid { gap: 12px; }
.game-section h2 { color: #252838; font-size: 15px; margin-bottom: 12px; }
.featured-games .game-card { border: 4px solid #ff8180; border-radius: 11px; }
.bottom-nav { border-radius: 15px 15px 0 0; }

.demo-wins h2 span { margin-left: 4px; padding: 2px 6px; border-radius: 6px; background: #ffe1e4; color: #8b2435; font-size: 11px; }
.demo-wins p { margin: -5px 0 10px; color: #535e74; font-size: 12px; }
#demoWinRows { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 6px; }
#demoWinRows li { display: grid; grid-template-columns: 34px minmax(42px, 1fr) 49px minmax(76px, auto); gap: 7px; align-items: center; background: #fff; border-radius: 8px; padding: 8px; font-size: 11px; }
.demo-avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #ece8ff; color: #534080; font-weight: 750; }
#demoWinRows img { width: 49px; height: 34px; object-fit: cover; border-radius: 6px; }
.demo-amount { text-align: right; font-weight: 750; }
#demoWinsToggle { border: 1px solid #e4cad0; border-radius: 8px; background: #fff; color: #8b2435; padding: 5px 9px; cursor: pointer; font-size: 11px; }
.lobby-dock { position: fixed; right: 14px; bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 3; display: grid; gap: 8px; }
.lobby-dock a { display: grid; place-items: center; width: 47px; height: 47px; border-radius: 50%; border: 2px solid #fff; background: radial-gradient(circle at 38% 26%, #ffe0b4, #fa7e75 70%); box-shadow: 0 2px 7px #27324c3d; font-size: 24px; }
.lobby-dock img { width: 42px; }
@media (max-width: 510px) {
    .lobby-dock { position: static; width: min(100%, var(--lobby-width)); margin: 0 auto; display: flex; justify-content: center; background: #f5f6fd; padding: 8px; }
}

:root { --lobby-width: 454px; }
.frame { padding-inline: 15px; }
.card-grid { gap: 14px; }
.game-card { border: 4px solid #ff8180; border-radius: 12px; }
.game-card span { font-size: 12px; padding: 15px 6px 5px; }
.game-section h2 { font-size: 20px; line-height: 1.15; }
.demo-wins p { font-size: 13px; }
#demoWinRows li { grid-template-columns: 48px minmax(50px, 1fr) 76px minmax(92px, auto); min-height: 72px; gap: 9px; padding: 10px; font-size: 14px; }
#demoWinRows img { width: 76px; height: 48px; border-radius: 9px; }
#demoWinRows .demo-avatar { width: 48px; height: 48px; border-radius: 50%; }
.demo-amount { line-height: 1.25; }
.lobby-dock a { width: 58px; height: 58px; }
.lobby-dock img { width: 49px; height: 49px; object-fit: contain; }
@media (max-width: 370px) {
    .frame { padding-inline: 10px; }
    .card-grid { gap: 8px; }
    #demoWinRows li { grid-template-columns: 38px minmax(42px, 1fr) 53px minmax(76px, auto); gap: 6px; font-size: 12px; }
    #demoWinRows .demo-avatar { width: 38px; height: 38px; }
    #demoWinRows img { width: 53px; height: 38px; }
}

/* Every demo row uses the same column positions regardless of its amount. */
#demoWinRows li {
    grid-template-columns: 48px minmax(0, 1fr) 76px minmax(0, 148px);
    gap: 10px;
}
#demoWinRows li > strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-amount { text-align: left; font-variant-numeric: tabular-nums; }
.demo-amount strong, .demo-amount small { display: block; white-space: nowrap; }
.demo-amount small { margin-top: 4px; color: #616d83; font-weight: 500; font-size: 12px; }
.demo-wins .demo-ranking-title { margin-top: 32px; }
#demoPodium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; list-style: none; padding: 24px 0 0; margin: 0; }
#demoPodium li { position: relative; display: grid; justify-items: center; gap: 4px; min-height: 112px; padding: 12px 3px 8px; border-radius: 12px 12px 6px 6px; background: linear-gradient(#e9ecff,#bcc8ee); color: #283559; text-align: center; font-size: 13px; }
#demoPodium li[data-rank="1"] { grid-column: 2; grid-row: 1; min-height: 133px; background: linear-gradient(#ffc0b9,#ff7978); }
#demoPodium li[data-rank="2"] { grid-column: 1; grid-row: 1; }
#demoPodium li[data-rank="3"] { grid-column: 3; grid-row: 1; background: linear-gradient(#ffe1c0,#f9ae7f); }
#demoPodium .demo-avatar { width: 48px; height: 48px; margin-top: -32px; border: 2px solid #fff; border-radius: 50%; }
#demoPodium li[data-rank="1"] .demo-avatar { border-color: #ffe695; }
#demoPodium li > span:not(.demo-avatar) { background: #fff8; border-radius: 5px; padding: 1px 8px; font-size: 11px; }
#demoPodium small { font-variant-numeric: tabular-nums; }
@media (max-width: 420px) {
    #demoWinRows li { grid-template-columns: 42px minmax(0, 1fr) 61px minmax(0, 112px); gap: 7px; font-size: 12px; }
    #demoWinRows img { width: 61px; height: 42px; }
    #demoWinRows .demo-avatar { width: 42px; height: 42px; }
}
@media (max-width: 350px) {
    #demoWinRows li { grid-template-columns: 34px minmax(0, 1fr) 47px minmax(0, 96px); gap: 5px; }
    #demoWinRows img { width: 47px; height: 34px; }
    #demoWinRows .demo-avatar { width: 34px; height: 34px; }
}

#demoRankRows { display: grid; gap: 9px; list-style: none; margin: 0; padding: 0; }
#demoRankRows li { display: grid; grid-template-columns: 25px 48px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 7px 11px; min-height: 62px; border-radius: 8px; background: #fff; color: #626d83; }
#demoRankRows li > span { text-align: center; font-size: 19px; font-weight: 700; }
#demoRankRows strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#demoRankRows small { border-radius: 999px; padding: 7px 9px; background: linear-gradient(90deg,#f84953,#ff8c80); color: #fff; font-weight: 750; white-space: nowrap; }
#demoWinRows .demo-avatar, #demoPodium .demo-avatar, #demoRankRows .demo-avatar { display: block; background-position: center; background-size: cover; background-repeat: no-repeat; }
#demoRankRows .demo-avatar { width: 48px; height: 48px; border-radius: 50%; }
.lobby-dock a { background: transparent; border: 0; box-shadow: none; }
.lobby-dock img { display: block; width: 100%; height: 100%; object-fit: contain; }
.lobby-dock a:nth-child(4) img { border: 2px solid #fff; border-radius: 50%; object-fit: cover; }
.lobby-dock{max-height:calc(100svh - 150px);overflow-y:auto;overflow-x:hidden;padding:4px;scrollbar-width:none}
.lobby-dock a{width:50px;height:50px;min-width:0;min-height:0;aspect-ratio:1;display:grid;place-items:center;flex-shrink:0;border-radius:50%;padding:0;overflow:hidden;box-sizing:border-box}
.lobby-dock img{width:100%;height:100%;max-width:none;max-height:none;aspect-ratio:1;object-fit:contain;border-radius:50%;box-sizing:border-box}
@media (max-width: 510px) {
    .lobby-dock { position: fixed; width: auto; margin: 0; padding: 0; right: 7px; bottom: calc(70px + env(safe-area-inset-bottom)); display: grid; background: transparent; }
    .lobby-dock a { width: 42px; height: 42px; }
}

.event-sheet { position:fixed; inset:auto 0 0; width:min(100%, var(--lobby-width)); max-width:none; margin:0 auto; border:0; border-radius:26px 26px 0 0; padding:22px 20px max(16px,env(safe-area-inset-bottom)); text-align:center; color:#20283c; background:linear-gradient(#ffe5e8,#fff 45%); }
.event-sheet::backdrop { background:#10152599; }
.event-sheet img { width:78px; height:78px; }
.event-sheet h2 { margin:10px 0; }
.event-sheet p { font-size:14px; margin:0 0 18px; }
.event-sheet .primary { width:100%; padding:12px; }
.event-sheet button { border:0; background:none; padding:12px; color:inherit; cursor:pointer; }
#player-banner-dialog{width:min(360px,calc(100vw - 26px));max-height:85dvh;padding:0;border:0;border-radius:14px;background:#fff;color:#20263b;box-shadow:0 18px 65px #0d102a55;font:14px system-ui,sans-serif}
#player-banner-dialog::backdrop{background:#171923a6}
.player-banner-head{display:grid;grid-template-columns:1fr 34px;align-items:center;padding:10px 8px 10px 15px;background:#f6f6fa}
.player-banner-head h2{margin:0;text-align:center;font-size:16px}
.player-banner-head button{border:0;background:transparent;color:#5e667b;font-size:24px;cursor:pointer}
#player-banner-dialog img{display:block;width:100%;height:auto;object-fit:contain;background:#f8f5f9;border-radius:12px}
.player-banner-body{max-height:60dvh;overflow-y:auto;padding:14px;background:#f8f7fb;overscroll-behavior:contain}
.player-banner-head{background:linear-gradient(90deg,#ff555e,#ff958a);color:#fff}
.player-banner-actions{background:#fff;position:sticky;bottom:0}
.banner-task{position:relative;background:#f0f0f2;border-radius:12px;padding:12px;margin-bottom:10px;display:grid;gap:8px;color:#25314a}
.banner-task span{color:#ff923f;font-size:12px}
.banner-task progress{width:100%;height:9px;accent-color:#ff626d}
.banner-task small{color:#75819b}.banner-task a{justify-self:end;color:#ff8739;border:1px solid #ffb36d;border-radius:6px;padding:5px 12px;text-decoration:none}
#player-banner-dialog p{margin:12px;padding:8px 11px;border-radius:8px;background:#f6f5f9;line-height:1.45;white-space:pre-wrap;overflow-wrap:anywhere}
.player-banner-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:8px;padding:11px}
.player-banner-actions label{margin-right:auto;color:#57617d;font-size:11px;display:flex;align-items:center;gap:4px}
.player-banner-actions input{accent-color:#f65364}
.player-banner-actions :is(a,button){border:0;border-radius:18px;padding:6px 10px;color:white;background:linear-gradient(90deg,#f04d5d,#fc837d);font:700 12px system-ui;text-decoration:none;cursor:pointer}
#player-banner-dialog [hidden]{display:none!important}

.app-install {
    width: min(360px, calc(100% - 32px));
    max-height: 85dvh;
    box-sizing: border-box;
    padding: 24px;
    border: 1px solid #ffd9db;
    border-radius: 20px;
    background: #fff;
    color: #20263b;
    text-align: center;
    box-shadow: 0 18px 65px #17192355;
}
.app-install::backdrop { background: #171923aa; }
.app-install h2 { margin: 12px 0 8px; font-size: 21px; }
.app-install p { margin: 0 0 14px; line-height: 1.5; }
#app-install-help { padding: 12px; border-radius: 12px; background: #fff4f3; font-size: 13px; }
.app-install button { width: 100%; min-height: 44px; border: 0; border-radius: 12px; font: inherit; font-weight: 700; cursor: pointer; }
#app-install-action { margin-bottom: 8px; background: #b52342; color: #fff; }
.app-install form button { background: #f6f3f6; color: #352a38; }

.notification-badge{font:700 10px system-ui;padding:5px;border-radius:12px;background:#fff0f2;color:#b82042;text-decoration:none;white-space:nowrap}
