/* Game District: hero scene, lobby (continue strip, filters, game cards, recent activity), settings drawer. */

/* ------------------------------------------------------------------ hero */
.hub-hero {
    position: relative; isolation: isolate; overflow: hidden;
    display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .85fr); gap: 20px;
    min-height: clamp(300px, 36vw, 400px);
    margin-bottom: 22px; padding: clamp(18px, 2.4vw, 32px);
    border-radius: 24px; border: 1px solid var(--line-2);
    background: #120d2b; box-shadow: var(--shadow);
}
.hub-scene {
    position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%;
    image-rendering: pixelated; image-rendering: crisp-edges; object-fit: cover; object-position: center bottom;
}
.hub-hero-shade {
    position: absolute; inset: 0; z-index: -1;
    background:
        linear-gradient(90deg, rgba(10, 7, 26, .9) 0%, rgba(10, 7, 26, .6) 36%, rgba(10, 7, 26, 0) 66%),
        linear-gradient(180deg, rgba(10, 7, 26, .1), rgba(10, 7, 26, .55));
}
:root[data-theme="day"] .hub-hero-shade {
    background: linear-gradient(90deg, rgba(20, 12, 50, .9) 0%, rgba(20, 12, 50, .7) 40%, rgba(20, 12, 50, .08) 72%), linear-gradient(180deg, rgba(10, 7, 26, .1), rgba(10, 7, 26, .5));
}
.hub-hero-copy { display: grid; align-content: center; gap: 14px; max-width: 640px; color: #f6efe0; }
.hub-hero .retro-kicker { color: #ff8fc1; }
.hub-hero .retro-title {
    font-family: var(--font-display); font-weight: 400; line-height: 1.02; letter-spacing: .01em;
    font-size: clamp(1.9rem, 4.4vw, 3.4rem); color: #fff2bf;
    text-shadow: 0 3px 0 #7a3b00, 0 0 28px rgba(255, 190, 70, .45);
}
.hub-hero .retro-copy { color: #e4dcf5; max-width: 52ch; font-size: 1rem; }
.hub-hero-cta { display: flex; flex-wrap: wrap; gap: 10px; }
.hub-continue { font-size: 1rem; min-height: 48px; padding: 10px 22px; max-width: 100%; }
.hub-continue .retro-button-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-hero-highlights { display: flex; flex-wrap: wrap; gap: 8px; }
.hub-hero .dashboard-hero-stat { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .22); color: #f2eafc; }

.hub-today {
    align-self: end; display: grid; gap: 10px; padding: 16px; border-radius: 18px;
    background: rgba(14, 10, 34, .78); border: 1px solid rgba(255, 255, 255, .2);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: #f6efe0;
}
.hub-today h2 { font-size: 1.15rem; margin-top: 2px; }
.hub-today .retro-kicker { color: #6fe3ff; }
.hub-today-reset { color: #b9b2d8; font-weight: 700; }
.hub-today-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.hub-today-item {
    display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center;
    padding: 7px 9px; border-radius: 12px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1);
    color: inherit; text-decoration: none; transition: background .15s, transform .15s, border-color .15s;
}
.hub-today-item:hover { background: rgba(255, 255, 255, .14); border-color: var(--accent, var(--gold)); transform: translateX(2px); }
.hub-today-thumb { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; border: 2px solid var(--accent, var(--gold)); background: #000; }
.hub-today-item strong { display: block; font-size: .92rem; line-height: 1.15; }
.hub-today-item small { color: #c9c1e6; font-weight: 700; font-size: .74rem; }
.hub-today-go { font-size: .74rem; font-weight: 900; padding: 3px 9px; border-radius: 999px; background: var(--accent, var(--gold)); color: #1a1030; white-space: nowrap; }
.hub-today-item.is-done .hub-today-go { background: rgba(95, 227, 161, .2); color: #7bf0b8; }
.hub-streak { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: .85rem; color: #e4dcf5; }
.hub-streak-dots { display: inline-flex; gap: 5px; }
.hub-streak-dots span { width: 11px; height: 11px; border-radius: 50%; background: rgba(255, 255, 255, .16); }
.hub-streak-dots span.is-done { background: var(--gold); box-shadow: 0 0 8px rgba(255, 201, 74, .8); }
.hub-streak-dots span.is-today { outline: 2px solid #fff; outline-offset: 1px; }

/* ------------------------------------------------------------ lobby chrome */
.hub-lobby { display: grid; gap: 22px; }
.hub-strip-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.hub-strip-head h2 { font-family: var(--font-display); font-size: 1.15rem; letter-spacing: .02em; }
.hub-strip-head small { color: var(--muted); font-weight: 700; }
.hub-strip-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.hub-resume {
    position: relative; display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: center; text-align: left;
    padding: 8px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
    cursor: pointer; overflow: hidden; transition: transform .15s, border-color .15s, box-shadow .15s;
}
.hub-resume::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--accent, var(--gold)); }
.hub-resume:hover { transform: translateY(-2px); border-color: var(--accent, var(--gold)); box-shadow: 0 8px 22px color-mix(in srgb, var(--accent, #000) 25%, transparent); }
.hub-resume img { width: 96px; height: 60px; object-fit: cover; border-radius: 10px; display: block; background: #000; }
.hub-resume strong { display: block; line-height: 1.15; }
.hub-resume small { display: block; color: var(--muted); font-weight: 700; font-size: .78rem; margin-top: 2px; }
.hub-resume .hub-resume-go { position: absolute; right: 10px; top: 10px; font-size: 1.1rem; color: var(--accent, var(--gold)); }

.dashboard-favorites { display: grid; gap: 10px; }
.dashboard-favorites-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.dashboard-favorites-head h2 { font-family: var(--font-display); font-size: 1.05rem; letter-spacing: .02em; display: flex; gap: 8px; align-items: center; }
.dashboard-favorites-head h2 i { color: var(--gold); }
.dashboard-favorites-list { display: flex; flex-wrap: wrap; gap: 8px; }
.dashboard-favorites-empty { color: var(--muted); font-weight: 700; font-size: .9rem; }
.dashboard-favorite-chip {
    display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 10px; border-radius: 999px;
    background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text); cursor: pointer; text-align: left;
    transition: border-color .15s, transform .15s;
}
.dashboard-favorite-chip:hover { border-color: var(--gold); transform: translateY(-1px); }
.dashboard-favorite-chip span { display: grid; line-height: 1.1; }
.dashboard-favorite-chip small { color: var(--muted); font-size: .7rem; font-weight: 700; }
.dashboard-favorite-icon { width: 20px; height: 20px; stroke: var(--gold); stroke-width: 2; color: var(--gold); flex: 0 0 auto; }
.dashboard-favorite-toggle {
    margin-left: auto; flex: 0 0 auto; width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 10px;
    border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); cursor: pointer; padding: 0;
    transition: color .15s, background .15s, transform .15s;
}
.dashboard-favorite-toggle:hover { color: var(--gold); transform: scale(1.1); }
.dashboard-favorite-toggle.is-active { color: var(--gold); background: color-mix(in srgb, var(--gold) 16%, var(--surface-2)); border-color: var(--gold); }
.dashboard-favorite-toggle .dashboard-favorite-icon { width: 18px; height: 18px; }

.hub-toolbar { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; }
.hub-toolbar .hub-chips { order: 5; flex: 1 0 100%; }
.hub-toolbar .hub-count { order: 3; }
.hub-toolbar .hub-gameloadouts { order: 4; }
.hub-search { position: relative; flex: 1 1 280px; max-width: 420px; display: block; }
.hub-search i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--dim); pointer-events: none; }
.hub-search input { padding-left: 38px !important; }
.hub-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hub-chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px;
    border: 1px solid var(--line-2); background: var(--surface); color: var(--muted); font-weight: 800; font-size: .84rem; cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.hub-chip:hover { border-color: var(--gold); color: var(--text); }
.hub-chip[aria-pressed="true"] { background: var(--gold); color: var(--on-gold); border-color: transparent; }
.hub-chip .hub-chip-n { opacity: .7; font-weight: 900; font-size: .74rem; }
.hub-sort select { min-width: 170px; }
.hub-count { color: var(--muted); font-weight: 800; font-size: .84rem; margin-left: auto; }

/* ------------------------------------------------------------ game cards */
.dashboard-portal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 20px; }
.dashboard-game-card {
    --accent: var(--gold);
    position: relative; display: grid; grid-template-rows: auto 1fr; overflow: hidden;
    border-radius: 20px; background: var(--surface); border: 1px solid var(--line);
    box-shadow: var(--shadow-sm); transition: transform .2s, border-color .2s, box-shadow .2s;
}
.dashboard-game-card::after {
    content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; z-index: 3;
    background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 30%, transparent));
}
.dashboard-game-card:hover, .dashboard-game-card:focus-within {
    transform: translateY(-4px); border-color: var(--accent);
    box-shadow: 0 16px 34px rgba(0, 0, 0, .45), 0 0 0 1px var(--accent), 0 0 30px color-mix(in srgb, var(--accent) 28%, transparent);
}
.dashboard-game-card[hidden] { display: none; }
.dashboard-game-art { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #000; cursor: pointer; }
.dashboard-art-frame { position: absolute; inset: 0; }
.dashboard-game-preview-image { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s cubic-bezier(.2, .8, .3, 1), filter .3s; image-rendering: auto; }
.dashboard-game-card:hover .dashboard-game-preview-image { transform: scale(1.06); }
.dashboard-game-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(8, 5, 20, .72)); pointer-events: none; }
.hub-card-shine {
    position: absolute; inset: -40% auto -40% -60%; width: 40%; z-index: 2; pointer-events: none;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .22), transparent); transform: skewX(-18deg);
}
.dashboard-game-card:hover .hub-card-shine { animation: hubShine .9s ease; }
@keyframes hubShine { to { left: 130%; } }
.hub-card-state {
    position: absolute; left: 10px; bottom: 10px; z-index: 3; padding: 3px 10px; border-radius: 999px;
    background: rgba(10, 7, 26, .82); color: #fff; font-size: .72rem; font-weight: 900; border: 1px solid var(--accent);
    display: inline-flex; gap: 6px; align-items: center;
}
.hub-card-state[hidden] { display: none; }
.hub-card-state.is-daily { background: var(--accent); color: #1a1030; }
.dashboard-game-copy { display: grid; grid-template-rows: auto 1fr auto auto auto; gap: 10px; padding: 14px 16px 16px; }
.dashboard-game-topline { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.dashboard-game-topline > strong { font-family: var(--font-display); font-weight: 400; font-size: 1.05rem; letter-spacing: .01em; line-height: 1.15; flex: 1 1 100px; min-width: 0; overflow-wrap: anywhere; }
.dashboard-game-topline .retro-showcase-badge { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.dashboard-game-copy > p {
    color: var(--muted); font-size: .9rem; line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.dashboard-game-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.hub-card-progress { display: flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 800; color: var(--muted); padding: 6px 10px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); }
.hub-card-progress[hidden] { display: none; }
.hub-card-progress i { color: var(--accent); }
.hub-card-progress b { color: var(--text); }
.dashboard-action-row { display: flex; flex-wrap: wrap; gap: 8px; }
.dashboard-action-row .retro-button { flex: 1 1 auto; }
.dashboard-game-card .retro-button { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 78%, #fff), var(--accent)); color: #0d0620 !important; box-shadow: 0 4px 0 rgba(0, 0, 0, .3); }
:root[data-theme="day"] .dashboard-game-card .retro-button { color: #fff !important; }
.hub-daily-link { font-size: .8rem; min-height: 36px; padding: 6px 12px; }

.hub-empty { display: grid; place-items: center; gap: 10px; padding: 36px; }
.hub-empty[hidden] { display: none; }
.hub-empty i { font-size: 2rem; color: var(--dim); }

.hub-recent { display: grid; gap: 4px; }
.hub-recent-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.hub-recent-list li {
    display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center;
    padding: 8px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line);
}
.hub-recent-list li i { font-size: 1.1rem; color: var(--cyan); text-align: center; }
.hub-recent-list li.is-coin i { color: var(--gold); }
.hub-recent-list li strong { font-size: .9rem; line-height: 1.2; }
.hub-recent-list li small { color: var(--dim); font-weight: 700; white-space: nowrap; }
.hub-recent-empty { color: var(--muted); font-weight: 700; }

/* ------------------------------------------------------------ settings drawer */
.hub-drawer-wrap { place-items: stretch end; padding: 0; }
.hub-drawer {
    width: min(440px, 100%); height: 100%; overflow: auto; display: grid; align-content: start; gap: 18px;
    padding: 22px; background: var(--surface); border-left: 1px solid var(--line-2); box-shadow: var(--shadow);
    animation: hubSlide .25s cubic-bezier(.2, .8, .3, 1);
}
@keyframes hubSlide { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.hub-dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.hub-dialog-head h2 { font-family: var(--font-display); font-size: 1.4rem; margin-top: 4px; }
.hub-set-group { display: grid; gap: 8px; }
.hub-set-label { font-size: .75rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.hub-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.hub-seg button {
    flex: 1 1 auto; min-height: 42px; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--line-2);
    background: var(--surface-2); color: var(--text); font-weight: 800; cursor: pointer; transition: background .15s, border-color .15s;
}
.hub-seg button:hover { border-color: var(--gold); }
.hub-seg button[aria-pressed="true"] { background: var(--gold); color: var(--on-gold); border-color: transparent; }
.hub-muted { color: var(--muted); font-weight: 600; font-size: .86rem; }
.hub-drawer-foot { display: flex; gap: 10px; justify-content: space-between; margin-top: 6px; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1100px) {
    .hub-hero { grid-template-columns: 1fr; }
    .hub-today { align-self: stretch; }
    .hub-hero-shade { background: linear-gradient(180deg, rgba(10, 7, 26, .55), rgba(10, 7, 26, .88)); }
}
@media (max-width: 700px) {
    .hub-hero { border-radius: 18px; min-height: 0; padding: 16px; }
    .hub-hero .retro-copy { font-size: .92rem; }
    .hub-search { max-width: none; flex-basis: 100%; }
    .hub-chips { flex-basis: 100%; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
    .hub-chips::-webkit-scrollbar { display: none; }
    .hub-chip { flex: 0 0 auto; }
    .hub-count { margin-left: 0; }
    .dashboard-portal-grid { gap: 16px; }
}
@media (hover: none) {
    .dashboard-game-card:hover { transform: none; }
}

/* flex/grid children may shrink below their content: keeps the chip row scrolling inside itself */
.hub-lobby, .hub-lobby > *, .hub-toolbar > *, .hub-main, .hub-panels, .dashboard-tab-panel { min-width: 0; }
.hub-chips { max-width: 100%; }

/* title on its own line, badge and pin below it (long names like "Cindershaft Minesweeper" never break mid-word) */
.dashboard-game-topline > strong { flex: 1 0 100%; overflow-wrap: break-word; word-break: normal; hyphens: manual; font-size: 1.02rem; }
.dashboard-game-topline .dashboard-favorite-toggle { margin-left: auto; }
.dashboard-game-topline { row-gap: 6px; }
