/* A standalone home screen; gameplay keeps its established layout. */
body.home-active > #top-bar,
body.home-active > #game-stage,
body.home-active > #buttons-bar,
body.home-active > .controls-wrapper { display: none !important; }
body.home-active:not(.arena-active):not(.adventure-active) { touch-action: pan-y; }
.home-screen[hidden] { display: none !important; }
body.arena-active > .home-screen, body.adventure-active > .home-screen { display: none !important; }
.home-screen {
    --home-accent: #78cf93;
    --home-tint: rgba(81, 171, 116, .12);
    position: fixed; inset: 0; z-index: 4; box-sizing: border-box;
    height: 100vh; height: 100dvh; display: flex; flex-direction: column;
    padding: var(--home-safe-top, 104px) var(--home-safe-right, 16px)
        var(--home-safe-bottom, 20px) var(--home-safe-left, 16px);
    background: radial-gradient(ellipse at 15% 0, rgba(59, 113, 105, .16), transparent 55%), #172533;
    color: #f4f7fb; overflow: hidden; touch-action: pan-y;
}
.home-screen[data-mode=arcade] { --home-accent: #ffc967; --home-tint: rgba(221, 153, 56, .13); }
.home-screen[data-mode=arena] { --home-accent: #79c9fa; --home-tint: rgba(70, 158, 217, .12); }
.home-screen[data-mode=adventure] { --home-accent: #bfd893; --home-tint: rgba(145, 180, 87, .13); }
.home-header { width: 100%; max-width: 640px; margin: 0 auto 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-shrink: 0; }
.home-brand { display: flex; align-items: center; gap: 10px; }
.home-brand-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; font-size: 26px; background: #294438; border: 1px solid #45694e; }
.home-brand strong { display: block; font-size: 21px; line-height: 1.15; letter-spacing: -.02em; }
.home-brand small { display: block; margin-top: 3px; font-size: 9px; letter-spacing: .13em; text-transform: uppercase; color: #a9bfbb; }
.home-wallet { min-height: 42px; padding: 8px 12px; border-radius: 14px; border: 1px solid #776747; background: #3a342525; color: #ffe097; font: inherit; font-size: 15px; font-weight: 750; cursor: pointer; white-space: nowrap; }
.home-scroll { width: 100%; max-width: 640px; margin: 0 auto; min-height: 0; flex: 1; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: none; padding-bottom: 4px; }
.home-scroll::-webkit-scrollbar { display: none; }
.home-section-label { margin: 0 0 12px; color: #b8c8d6; font-size: 13px; font-weight: 600; }
.home-screen .overlay-card { width: 100%; padding: 0; background: transparent; border: 0; box-shadow: none; border-radius: 0; text-align: left; }
.home-screen .mode-selector { gap: 10px; margin: 0 0 14px; }
.home-screen .mode-option {
    position: relative; min-width: 0; min-height: 96px; display: flex; flex-direction: column;
    align-items: flex-start; gap: 4px; text-align: left; padding: 12px 14px;
    background: #223342; color: #edf3fa; border: 1px solid #405264; border-radius: 16px;
    font: inherit; -webkit-tap-highlight-color: transparent; cursor: pointer;
}
.home-mode-icon { font-size: 25px; line-height: 1; margin-bottom: 2px; }
.home-mode-name { font-size: 15px; font-weight: 750; line-height: 1.2; }
.home-mode-caption { font-size: 11px; line-height: 1.3; color: #aebfcf; }
.home-screen .mode-option.active { border-color: var(--home-accent); background: linear-gradient(130deg, var(--home-tint), transparent), #253746; box-shadow: inset 0 0 0 1px var(--home-accent); }
.home-screen .mode-option.active::after { content: '✓'; position: absolute; top: 10px; right: 12px; font-size: 13px; font-weight: 800; color: var(--home-accent); }
.home-screen .mode-option:focus-visible, .home-shortcut:focus-visible, .home-wallet:focus-visible { outline: 2px solid var(--home-accent); outline-offset: -4px; }
.home-screen .mode-details { padding: 16px; margin-bottom: 12px; border: 1px solid #3a4b5b; border-radius: 16px; background: linear-gradient(130deg, var(--home-tint), transparent), #1d2d3b; }
.home-screen .overlay-title { font-size: 22px; line-height: 1.25; margin: 0 0 8px; letter-spacing: -.025em; }
.home-screen .overlay-text { font-size: 13px; line-height: 1.5; margin: 0; color: #c7d4df; }
.home-screen .overlay-record { font-size: 12px; line-height: 1.4; opacity: 1; color: var(--home-accent); margin: 10px 0 0; font-weight: 600; }
.home-screen .mode-note { font-size: 10px; line-height: 1.45; text-align: left; opacity: 1; color: #a1b3c3; margin: 10px 0 0; }
.home-screen .arcade-size-selector { margin: 12px 0 0; gap: 6px; }
.home-screen .arcade-size-label { font-size: 11px; }
.home-screen .arcade-size-option { min-height: 36px; font-size: 12px; border-radius: 10px; }
.home-screen #overlay-action { min-height: 52px; padding: 14px 18px; border-radius: 14px; font-size: 17px; color: #12241b; background: #8bd29f; }
.home-screen[data-mode=arcade] #overlay-action { background: #ffc967; color: #39280b; }
.home-screen[data-mode=arena] #overlay-action { background: #83ccfa; color: #102b40; }
.home-screen[data-mode=adventure] #overlay-action { background: #bfd893; color: #25341b; }
.home-screen .overlay-secondary-row { display: none; }
.home-screen .overlay-save-status { margin: 0 0 12px; }
.home-shortcuts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 16px 0 0; }
.home-shortcuts[hidden] { display: none; }
.home-shortcut { position: relative; min-width: 0; min-height: 58px; padding: 10px 5px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; border: 1px solid #3a4b5b; border-radius: 13px; background: #203140; color: #dfe9f1; font: inherit; font-size: 12px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.home-shortcut > span:first-child { font-size: 19px; line-height: 1; }
.home-badge { position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; border-radius: 50%; background: #ffc967; }
.home-badge[hidden] { display: none; }
.home-helper { margin: 12px 0 0; text-align: center; color: #8399ac; font-size: 10px; line-height: 1.4; }
.home-loading { color: #b8c8d6; text-align: center; padding: 30px 0; }
.countdown-hint { position: absolute; left: 12px; right: 12px; bottom: 14px; margin: 0; font-size: 13px; line-height: 1.45; text-align: center; color: #e4f0e6; }
.countdown-hint[hidden] { display: none; }
@media(min-width: 650px) {
    .home-header { margin-bottom: 22px; }
    .home-screen .mode-option { min-height: 110px; padding: 16px 20px; }
    .home-mode-name { font-size: 17px; }
    .home-mode-caption { font-size: 12px; }
    .home-screen .mode-details { padding: 20px; }
    .home-shortcut { min-height: 66px; font-size: 12px; }
}
@media(max-width: 360px) {
    .home-screen .mode-option { padding: 12px 10px; }
    .home-mode-name { font-size: 14px; }
    .home-brand strong { font-size: 19px; }
    .home-wallet { padding: 8px 10px; font-size: 13px; }
}
