/* Rewards use the table's rank palette, with gold reserved for claimable rewards. */
#mission-title { border: 0; background: none; padding: 0; text-align: left; cursor: pointer; min-width: 0; }
#mission-title:hover { text-decoration: underline; text-underline-offset: 3px; }
#mission-title:focus-visible, #mission-guide-modal button:focus-visible { outline: 2px solid #fcd34d !important; outline-offset: 2px; }
.mission-guide-window { position: relative; width: min(440px, 94vw); text-align: left; }
#mission-guide-close { position: absolute; right: 12px; top: 10px; border: 0; background: none; color: #cbd5e1; cursor: pointer; font-size: 26px; }
#mission-guide-chapter { padding-right: 25px; margin-bottom: 14px; }
#mission-guide-title { font-size: 22px; margin: 0 0 12px; }
#mission-guide-hint { color: #cbd5e1; font-size: 13px; line-height: 1.65; }
#mission-guide-progress { color: #6ee7b7; font-size: 12px; }
#mission-guide-reward { color: #f3ce81; font-size: 12px; }
#mission-guide-action { width: 100%; margin-top: 10px; }
.upgrade-card.mission-highlight { outline: 2px solid #fbbf24 !important; outline-offset: -2px; box-shadow: inset 0 0 20px #fbbf2425; }
:root { --rewards-header-height: calc(56px + env(safe-area-inset-top, 0px)); }
/* Reserve real space: menus and cards start below this header at every breakpoint. */
#game-board { top: var(--rewards-header-height) !important; height: calc(100% - var(--rewards-header-height)) !important; }
#right-panel { top: var(--rewards-header-height) !important; height: calc(100% - var(--rewards-header-height)) !important; }
#settings-menu { top: calc(var(--rewards-header-height) + 8px) !important; }
/* Keep every existing control reachable above sponsors and the bottom banner. */
body #game-board ~ #right-panel #game-controls { max-height: var(--controls-max-height, calc(100dvh - var(--rewards-header-height) - 90px)); overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: none; }
#game-controls::-webkit-scrollbar { display: none; }
#game-controls > button { flex-shrink: 0; }
#game-controls, #game-controls * { touch-action: pan-y !important; }
#game-controls #mobile-menu-btn { position: sticky; top: 0; flex-shrink: 0; }
#settings-menu { max-height: calc(100dvh - var(--rewards-header-height) - 80px); overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y !important; }
#rewards-dock { position: fixed; inset: 0 0 auto; height: var(--rewards-header-height); z-index: 120; display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: calc(6px + env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) 6px max(12px, env(safe-area-inset-left, 0px)); background: var(--glass-bg); border-bottom: 1px solid #fbbf2425; }
#rewards-dock::before { content: 'REWARDS & GOALS'; margin-right: auto; color: #cbd5e1; font: 700 10px var(--font-ui); letter-spacing: 1.5px; }
#rewards-dock button { font-family: var(--font-ui); cursor: pointer; color: #f8fafc; }
#playtime-gift-button { display: grid; grid-template-columns: 36px 1fr; grid-template-rows: 14px 16px; align-content: center; align-items: center; column-gap: 6px; width: 142px; height: 44px; flex-shrink: 0; padding: 4px 10px 4px 4px; background: linear-gradient(160deg, rgba(32, 41, 59, .96), rgba(10, 16, 30, .95)); border: 1px solid #64748b55; border-radius: 12px; transition: border-color .2s; }
#playtime-gift-button:hover { border-color: #fbbf24; }
.gift-orbit { position: relative; display: grid; place-items: center; width: 36px; height: 36px; grid-row: 1 / 3; }
.gift-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); fill: none; stroke-width: 3; }
.gift-ring-track { stroke: #ffffff12; }
#gift-ring-progress { stroke: #fbbf24; stroke-linecap: round; stroke-dasharray: 188.5; stroke-dashoffset: 188.5; transition: stroke-dashoffset .3s linear; }
.gift-box { width: 25px; height: 25px; filter: drop-shadow(0 3px 5px #0005); }
.gift-hud-label { color: #cbd5e1; font-size: 7px; font-weight: 800; letter-spacing: .6px; white-space: nowrap; }
#gift-countdown { color: #fde68a; font-variant-numeric: tabular-nums; font-size: 10px; font-weight: 800; white-space: nowrap; }
#gift-notification { position: absolute; right: 2px; top: 3px; width: 12px; height: 12px; border: 2px solid #172033; border-radius: 50%; background: #fb4b65; animation: gift-dot-pulse 1.8s infinite; }
#gift-notification[hidden], #rewards-chest-bank[hidden] { display: none; }
#playtime-gift-button.gift-ready { border-color: #fbbf2480; box-shadow: 0 0 24px #f59e0b25, 0 8px 24px #0005; }
.gift-ready .gift-box { animation: gift-wiggle 3s ease-in-out infinite; filter: drop-shadow(0 0 8px #fbbf2480); }
#daily-goals-button { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 12px; height: 44px; flex-shrink: 0; border: 1px solid #94a3b844; border-radius: 12px; background: #111c30ed; font-size: 10px; font-weight: 800; }
#daily-goals-button > span:first-child { color: #a5b4fc; font-size: 15px; }
#goals-hud-count { color: #94a3b8; }
#daily-goals-button.goals-ready { border-color: #6ee7b780; }
#daily-goals-button.goals-ready #goals-hud-count { color: #6ee7b7; }
@keyframes gift-wiggle { 0%, 65%, 100% { transform: rotate(0); } 70%, 80% { transform: rotate(-12deg); } 75%, 85% { transform: rotate(12deg); } 90% { transform: rotate(-5deg); } }
@keyframes gift-dot-pulse { 50% { box-shadow: 0 0 0 5px #fb4b6525; } }

#rewards-modal { padding: 18px 14px 76px !important; }
#rewards-modal .rewards-window { display: flex; flex-direction: column; width: min(760px, 100%); max-width: 760px; max-height: calc(100dvh - 94px) !important; padding: 0 !important; overflow: hidden !important; text-align: left; border: 1px solid #cbd5e12b !important; border-radius: 24px; box-shadow: 0 32px 100px #0009; background: radial-gradient(ellipse at 85% 0%, #b48a3b16, transparent 50%), var(--modal-bg) !important; }
.rewards-header { display: flex; justify-content: space-between; gap: 16px; padding: 28px 30px 22px; background: linear-gradient(110deg, #ffffff04, #f59e0b09); }
.reward-eyebrow { display: block; color: #f3ce81; letter-spacing: 2px; font-size: 9px; font-weight: 800; }
#rewards-modal .rewards-header h2 { margin: 9px 0 8px; font-family: var(--font-display); color: #f8fafc; font-size: clamp(20px, 3.4vw, 28px); line-height: 1.18; letter-spacing: -.8px; }
.rewards-header h2 span { color: #fbbf24; }
#rewards-modal p { line-height: 1.5; }
#rewards-modal .rewards-header p { color: #a0aec2; font-size: 12px; margin: 0; }
#rewards-close { flex-shrink: 0; display: grid; place-items: center; align-self: flex-start; width: 34px; height: 34px; border-radius: 50%; border: 1px solid #ffffff20; background: #ffffff06; color: #cbd5e1; font-size: 25px; cursor: pointer; }
#rewards-tabs { display: flex; gap: 5px; border-top: 1px solid #ffffff08; border-bottom: 1px solid #ffffff0f; padding: 0 24px; }
#rewards-tabs button { position: relative; flex: 1; display: flex; justify-content: center; align-items: center; gap: 8px; padding: 17px 4px; border: 0; background: transparent; color: #94a3b8; cursor: pointer; font: 600 12px var(--font-ui); }
#rewards-tabs button[aria-selected="true"] { color: #f9d38a; background: linear-gradient(0deg, #fbbf240c, transparent); }
#rewards-tabs button[aria-selected="true"]::after { content: ''; position: absolute; bottom: -1px; left: 16px; right: 16px; height: 2px; background: #fbbf24; }
#rewards-tabs small { padding: 2px 5px; border-radius: 5px; color: #e2e8f0; background: #ffffff0d; font-size: 9px; }
#rewards-scroll { min-height: 0; overflow-y: auto; padding: 24px 30px; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #64748b66 transparent; touch-action: pan-y; }
.reward-section-heading { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 20px; }
#rewards-modal h3 { color: #f1f5f9; font-size: 15px; margin: 0 0 5px; }
#rewards-modal .reward-section-heading p { font-size: 11px; color: #94a3b8; margin: 0; }
.reward-tag { flex-shrink: 0; background: #ffffff06; border: 1px solid #ffffff12; color: #a9b6c9; font-size: 9px; font-weight: 700; letter-spacing: .4px; padding: 7px 9px; border-radius: 7px; font-variant-numeric: tabular-nums; }
.gift-road { display: grid; gap: 10px; }
.gift-stop { display: grid; grid-template-columns: 32px 48px minmax(0, 1fr) 86px; align-items: center; gap: 13px; padding: 14px; border: 1px solid #ffffff0e; border-radius: 13px; background: #ffffff03; }
.gift-stop.is-ready { border-color: #fbbf2460; background: linear-gradient(110deg, #f59e0b10, #f59e0b03); }
.gift-time { color: #d0d8e4; font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; text-align: center; }
.gift-time small { display: block; font-size: 8px; font-weight: 600; color: #73849e; letter-spacing: 1px; margin-top: 2px; }
.reward-art { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: #ffffff05; }
.reward-art span { font-size: 27px; }
.reward-art img { width: 46px; height: 46px; object-fit: contain; filter: drop-shadow(0 3px 4px #0004); }
#rewards-modal h4 { margin: 0; color: #e5edf9; font-size: 12px; font-weight: 700; }
#rewards-modal .reward-copy p { color: #91a1b8; font-size: 10px; margin: 4px 0 10px; }
.reward-copy { min-width: 0; }
.reward-meter { height: 4px; overflow: hidden; background: #ffffff0a; border-radius: 8px; }
.reward-meter > span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #b38738, #f5d38b); transition: width .25s; }
.is-complete .reward-meter > span { background: #6ee7b7; }
#rewards-modal .reward-claim { border: 1px solid #fbd88a80; border-radius: 8px; min-height: 36px; padding: 8px 10px; background: linear-gradient(135deg, #f7d894, #eab75e); color: #352408; font: 800 10px var(--font-ui); cursor: pointer; white-space: nowrap; transition: filter .2s; font-variant-numeric: tabular-nums; }
#rewards-modal .reward-claim:hover:not(:disabled) { filter: brightness(1.1); }
#rewards-modal .reward-claim:disabled { background: #ffffff04; border-color: #ffffff0a; color: #8291a7; cursor: default; }
#rewards-modal .is-complete .reward-claim:disabled { color: #6ee7b7; }
#rewards-modal .reward-footnote { color: #7e8da5; font-size: 10px; margin: 18px 0 0; line-height: 1.65; }
.daily-finish { display: flex; align-items: center; gap: 20px; padding: 18px 24px; margin-bottom: 18px; border: 1px solid #d8ad5b40; border-radius: 14px; background: radial-gradient(ellipse at 0% 100%, #f59e0b17, #f59e0b03); }
.daily-finish > img { width: 84px; height: 84px; object-fit: contain; filter: drop-shadow(0 5px 16px #f59e0b26); }
#rewards-modal .daily-finish h4 { font-size: 18px; color: #f7dca5; margin: 7px 0 4px; }
#rewards-modal .daily-finish p { color: #b5a485; font-size: 10px; margin: 0; }
.daily-checks { display: flex; gap: 6px; margin-top: 12px; }
.daily-checks span { width: 24px; height: 22px; display: grid; place-items: center; font-size: 10px; color: #8c795a; border: 1px solid #fbbf2425; border-radius: 5px; }
.daily-checks .done { color: #192f27; background: #6ee7b7; border-color: #6ee7b7; }
.quest-list { display: grid; gap: 10px; }
.quest-card { display: flex; align-items: center; gap: 14px; border: 1px solid #ffffff10; background: #ffffff03; border-radius: 12px; padding: 16px; }
.quest-icon { display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; background: #9aa9ff0d; color: #b9c3ff; border-radius: 10px; font-size: 24px; }
.quest-card .reward-copy { flex: 1; }
.quest-heading { display: flex; justify-content: space-between; gap: 8px; }
.quest-heading > span { font-size: 10px; color: #becadc; font-variant-numeric: tabular-nums; }
.quest-card small { display: block; color: #8392ab; font-size: 9px; margin-top: 6px; }
.quest-card.is-complete { border-color: #6ee7b730; }
.quest-card.is-complete small { color: #6ee7b7; }
#rewards-chest-bank { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #fbbf2410; border: 1px solid #fbbf2440; border-radius: 12px; margin-bottom: 18px; padding: 13px 16px; }
#rewards-chest-bank strong { display: block; font-size: 12px; color: #f7dca5; }
#rewards-chest-bank small { display: block; margin-top: 4px; color: #b2a58e; font-size: 10px; }
.milestone-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.milestone-card { border: 1px solid #ffffff10; background: #ffffff03; padding: 16px; border-radius: 12px; }
.milestone-icon { display: block; color: #f3ce81; font-size: 24px; margin-bottom: 10px; }
#rewards-modal .milestone-card p { color: #91a1b8; font-size: 10px; margin: 5px 0 12px; }
.milestone-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; }
.milestone-footer small { font-size: 10px; color: #a0aec0; }
#rewards-modal .classic-heading { margin-top: 26px; }
.classic-heading span { display: block; font-size: 10px; color: #91a1b8; font-weight: 400; margin: 6px 0 15px; }
.classic-list { display: grid; gap: 10px; }
.classic-achievement { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 9px; border: 1px solid #ffffff0a; border-radius: 10px; padding: 12px; }
#rewards-modal .classic-achievement p { margin: 5px 0 0; font-size: 10px; color: #91a1b8; }
.classic-achievement > span { color: #f3ce81; font-size: 10px; }
.classic-achievement.is-complete > span { color: #6ee7b7; }
.classic-achievement .reward-meter { grid-column: 1 / -1; }
.rewards-footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 14px 30px; border-top: 1px solid #ffffff0d; color: #8392a9; font-size: 9px; font-variant-numeric: tabular-nums; }
.rewards-footer > span:first-child { font-size: 8px; letter-spacing: .4px; }
.rewards-footer i { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: #6ee7b7; margin-right: 5px; }
#rewards-modal button:focus-visible, #rewards-dock button:focus-visible, #rewards-panel:focus-visible { outline: 2px solid #fcd34d !important; outline-offset: 3px; }
.rewards-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 600px) {
    #rewards-dock { justify-content: center; }
    #rewards-dock::before { display: none; }
    #rewards-modal { padding: 10px 8px 74px !important; }
    #rewards-modal .rewards-window { max-height: calc(100dvh - 84px) !important; border-radius: 18px; }
    .rewards-header { padding: 20px 18px 18px; gap: 8px; }
    #rewards-modal .rewards-header h2 { font-size: 22px; max-width: 260px; }
    .reward-eyebrow { font-size: 8px; letter-spacing: 1.5px; }
    #rewards-tabs { padding: 0 10px; gap: 0; }
    #rewards-tabs button { font-size: 10px; gap: 5px; padding: 15px 3px; }
    #rewards-scroll { padding: 18px 14px; }
    #rewards-modal h3 { font-size: 13px; }
    .reward-section-heading { flex-wrap: wrap; gap: 9px; margin-bottom: 16px; }
    .gift-stop { grid-template-columns: 25px 36px minmax(0, 1fr); gap: 10px; padding: 12px 10px; }
    .gift-time { font-size: 17px; }
    .reward-art, .reward-art img { width: 36px; height: 36px; }
    .reward-art span { font-size: 23px; }
    .gift-stop > .reward-claim { grid-column: 3; justify-self: start; min-width: 95px; }
    .daily-finish { padding: 16px 12px; gap: 12px; }
    .daily-finish > img { width: 62px; height: 62px; }
    #rewards-modal .daily-finish h4 { font-size: 15px; }
    .quest-card { gap: 10px; padding: 13px 10px; }
    .quest-icon { width: 30px; height: 36px; font-size: 21px; }
    .quest-heading { flex-wrap: wrap; gap: 4px; }
    .milestone-grid { gap: 8px; }
    .milestone-card { padding: 12px; }
    .milestone-footer { flex-wrap: wrap; }
    .rewards-footer { padding: 12px 16px; flex-wrap: wrap; gap: 7px; }
}
@media (max-height: 520px) {
    #rewards-modal .rewards-window { max-height: calc(100dvh - 84px) !important; }
    .rewards-header { padding: 12px 18px; }
    #rewards-modal .rewards-header h2 { font-size: 18px !important; margin: 5px 0; }
    #rewards-modal .rewards-header p, .rewards-footer > span:first-child { display: none; }
    #rewards-tabs button { padding: 10px 3px; }
    #rewards-scroll { padding: 14px 18px; }
    .rewards-footer { padding: 8px 18px; }
}
/* Reclaim unused cash-HUD whitespace on short phones so the new header does not
   crowd out a full-size playable card. Combo and equipped relics share one row. */
@media (max-width: 600px) and (max-height: 700px) {
    #top-hud { gap: 2px !important; }
    #hud-missions { margin-top: 0 !important; }
    #mission-card { padding: 5px 8px !important; }
    #mission-card > div:first-child { margin-bottom: 0 !important; }
    #mission-card .progress-track { margin-top: 3px; }
    #hud-money { display: grid; grid-template-columns: auto auto; column-gap: 8px; padding: 5px 10px; }
    #hud-money > div:first-child, #cash-display { grid-column: 1 / -1; }
    #hud-money #cash-display { font-size: 24px; margin: 0; }
    #hud-money #combo-meter { font-size: 10px; margin-top: 4px; align-self: center; }
    #hud-money #relic-tray { margin-top: 4px; justify-content: flex-end; }
}
@media (prefers-reduced-motion: reduce) {
    #rewards-dock *, #rewards-modal * { animation: none !important; transition: none !important; }
}
