/* Oasis Bloom round 3: one button system (8 px grid, 48 px targets, pressed/disabled states),
   settings sheet, streak chip, daily gift moment, near-miss, puzzle sets and blockers. Loaded last. */
:root { --t-12: 12px; --t-14: 14px; --t-16: 16px; --t-20: 20px; --t-24: 24px; --t-32: 32px;
  --gold: #F2B23A; --gold-d: #C98A1C; --gold-l: #FFD877; --danger: #C2492B; --danger-d: #94341D; --lip: 4px; }

/* ---- buttons ---- */
.btn { position: relative; min-height: 48px; height: 48px; padding: 0 24px; border-radius: 16px; font-size: var(--t-16); font-weight: 700; letter-spacing: .01em;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: transform .09s ease-out, box-shadow .09s ease-out, filter .15s, background .15s; }
.btn .ic { width: 20px; height: 20px; stroke-width: 2.2; flex: none; }
.btn em { font-style: normal; font-size: var(--t-14); font-weight: 800; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .22); }
.btn > img { width: 24px; height: 24px; }
.btn.primary { background: linear-gradient(180deg, #179692, var(--teal)); color: #fff; box-shadow: 0 var(--lip) 0 var(--teal-d), 0 8px 16px rgba(18, 130, 127, .18); }
.btn.gold { background: linear-gradient(180deg, var(--gold-l), var(--gold)); color: var(--ink); box-shadow: 0 var(--lip) 0 var(--gold-d), 0 8px 18px rgba(242, 178, 58, .3); }
.btn.soft { height: 48px; padding: 0 16px; background: linear-gradient(180deg, #FFFDF7, var(--sand-100)); color: var(--ink); box-shadow: 0 var(--lip) 0 var(--sand-300), inset 0 1px 0 #fff; }
.btn.ghost { background: var(--sand-50); color: var(--ink-2); box-shadow: inset 0 0 0 2px var(--sand-200); }
.btn.danger { background: linear-gradient(180deg, #D35838, var(--danger)); color: #fff; box-shadow: 0 var(--lip) 0 var(--danger-d); }
.btn.sm { height: 40px; min-height: 40px; padding: 0 16px; font-size: var(--t-14); border-radius: 12px; }
.btn.sm::after, .round::after, .order .serve::after, #info .sell::after, #info .collect::after, .sheet .x::after, .seg button::after, .pin::after, .pzn::after, .streak::after {
  content: ''; position: absolute; inset: -4px; }
.btn.lg { height: 56px; font-size: 18px; border-radius: 18px; }
.btn.wide { width: 100%; }
@media (hover: hover) { .btn:hover:not(:disabled) { filter: brightness(1.04); } }
.btn:active:not(:disabled) { transform: translateY(var(--lip)); box-shadow: 0 0 0 transparent, 0 2px 6px rgba(0, 0, 0, .08); }
.btn.ghost:active:not(:disabled) { transform: scale(.97); box-shadow: inset 0 0 0 2px var(--sand-300); }
.btn:disabled, .btn.primary:disabled, .btn.gold:disabled { background: #E3DACB; color: #A3937C; box-shadow: 0 var(--lip) 0 #CDBFA8; cursor: default; filter: none; }
.btn:disabled img { filter: grayscale(1); opacity: .6; }
.btn:focus-visible, .round:focus-visible, .tab:focus-visible, .row:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.round { position: relative; width: 40px; height: 40px; transition: transform .09s; }
.round:active { transform: scale(.92); }
.row2 { display: flex; gap: 8px; } .row2 > .btn { flex: 1; padding: 0 12px; }
.sheet .btn.wide + .btn.wide, .sheet .row2 + .btn { margin-top: 12px; }

/* orders: 32 px serve with a 48 px target; energy chip */
.order .serve { height: 32px; inset: auto 8px -16px; box-shadow: 0 3px 0 #2C6A28; }
.order .serve:active { transform: translateY(3px); box-shadow: none; animation: none; }
.order .rew .en { color: #2F7A2B; }
#info .sell, #info .collect { height: 40px; padding: 0 16px; position: relative; box-shadow: 0 3px 0 var(--sand-300); }
#info .sell:active, #info .collect:active { transform: translateY(3px); box-shadow: none; }
.pw { width: 48px; } .pw .pwi { transition: transform .09s; }
.tab { min-height: 52px; transition: color .15s; } .tab:active { transform: scale(.92); }

/* ---- goal row: streak chip + goal bar (the next goal, always on screen) ---- */
#goal { height: 48px; }
.streak { position: relative; flex: none; height: 32px; display: inline-flex; align-items: center; gap: 4px; padding: 0 8px 0 6px; border-radius: 999px; background: var(--sand-0); box-shadow: var(--shadow); color: #C9661E; }
.streak .ic { width: 18px; height: 18px; stroke-width: 2; }
.streak b { font-size: var(--t-14); font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink); }
.streak .pips { display: flex; gap: 2px; } .streak .pips i { width: 4px; height: 12px; border-radius: 2px; background: var(--sand-200); transition: background .2s; }
.streak .pips i.on { background: linear-gradient(#FFB547, #E97A24); }
.streak.zero { color: var(--ink-3); } .streak.zero b { color: var(--ink-3); }
.streak.hot { background: linear-gradient(#FFF4DC, #FFE7B8); box-shadow: 0 0 0 2px #F5B14A, var(--shadow); }
.streak[hidden], .streak.none { display: none; }
.goalbar { position: relative; height: 32px; transition: transform .09s; } .goalbar:active { transform: scale(.98); }
.goalbar .ggo { display: none; }
.goalbar.full.restore .gn, .goalbar.full.restore .gr { display: none; }
.goalbar.full.restore { background: linear-gradient(180deg, var(--gold-l), var(--gold)); box-shadow: 0 3px 0 var(--gold-d); animation: goalCall 1.6s ease-in-out infinite; }
.goalbar.full.restore .gtrack { display: none; }
.goalbar.full.restore .gl { max-width: none; flex: 1; color: var(--ink); }
.goalbar.full.restore .ggo { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; font-size: var(--t-14); color: var(--ink); padding: 0 4px; }
.goalbar.full.restore .ggo .ic { width: 16px; height: 16px; stroke-width: 2.2; }
@keyframes goalCall { 50% { transform: translateY(-2px); } }
.reduce .goalbar.full.restore, .reduce .order.ready .serve { animation: none; }

/* oasis: idle loops (pin pulse, button glow) pause while an area is being revealed */
#oasis.revealing .pin, #oasis.revealing .pin *, #oasis.revealing .opanel * { animation-play-state: paused !important; }

/* ---- sheets ---- */
#sheet.on { animation: dimIn .2s ease-out both; }
@keyframes dimIn { from { background: rgba(43, 29, 18, 0); } }
.sheet { padding: 24px 24px 24px; }
.sheet h2 { font-size: var(--t-24); margin: 0 0 16px; }
.sheet .x { width: 40px; height: 40px; top: 12px; }
.sheet .note { margin: -8px 0 16px; color: var(--ink-2); font-size: var(--t-14); }
.sheet .warn-ic { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: #FBE3DA; color: var(--danger); margin-bottom: 8px; }
.sheet .warn-ic .ic { width: 28px; height: 28px; }
.sheet.settings { text-align: start; } .sheet.settings h2 { text-align: center; }
.sheet.settings .rows { gap: 0; border-radius: 16px; overflow: hidden; background: var(--sand-50); margin-bottom: 16px; }
.sheet.settings .row { height: 56px; border-radius: 0; background: none; padding: 0 16px; gap: 16px; font-size: var(--t-16); }
.sheet.settings .row + .row { box-shadow: inset 0 1px 0 var(--sand-100); }
.sheet.settings .row:active { background: var(--sand-100); }
.sheet.settings .ri { flex: none !important; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--sand-0); color: var(--teal); box-shadow: 0 1px 0 var(--sand-200); }
.sheet.settings .ri .ic { width: 18px; height: 18px; }
.sheet.settings .row.danger .ri { color: var(--danger); }
.sheet.settings .chev { width: 18px; height: 18px; transform: scaleX(-1); color: var(--ink-3); } html[dir=rtl] .sheet.settings .chev { transform: none; }
.sw { width: 52px; height: 32px; border-radius: 16px; } .sw::after { top: 4px; inset-inline-start: 4px; width: 24px; height: 24px; }
.toggle.on .sw::after { inset-inline-start: 24px; }
.langseg { margin: 0 16px 16px; padding: 4px; border-radius: 12px; } .langseg button { flex: 1; height: 40px; position: relative; font-size: var(--t-16); }
.langseg button[lang=ar] { font-family: 'PlexUI', 'PlexAR', sans-serif; }
.ver { margin: 0; text-align: center; font-size: var(--t-12); color: var(--ink-3); }

/* hub: compact claim buttons in rows, gold when a reward is waiting */
.qrow .btn, .qbonus .btn { height: 40px; min-height: 40px; padding: 0 16px; font-size: var(--t-14); border-radius: 12px; }
.qrow .btn.primary, .qbonus .btn.primary, .hub .claim.primary { background: linear-gradient(180deg, var(--gold-l), var(--gold)); color: var(--ink); box-shadow: 0 var(--lip) 0 var(--gold-d); }
.qall { margin-bottom: 12px; }
.fwd { transform: scaleX(-1); } html[dir=rtl] .fwd { transform: none; } html[dir=rtl] .btn .flip { transform: scaleX(-1); }

/* ---- daily gift moment ---- */
.dmoment .dm-gift { position: relative; width: 160px; height: 136px; margin: 0 auto 8px; display: grid; place-items: center; }
.dmoment .dm-gift .sunb { position: absolute; inset: -24px; border-radius: 50%; background: repeating-conic-gradient(from 0deg, rgba(255, 216, 119, .45) 0 10deg, transparent 10deg 24deg);
  mask: radial-gradient(closest-side, #000 40%, transparent); -webkit-mask: radial-gradient(closest-side, #000 40%, transparent); animation: spin 18s linear infinite; }
.dmoment .dm-box { position: relative; width: 120px; height: 120px; object-fit: contain; filter: drop-shadow(0 10px 12px rgba(120, 80, 30, .3)); transition: transform .35s cubic-bezier(.2,.9,.3,1.3), opacity .3s; }
.dmoment .dm-prize { position: absolute; width: 96px; height: 96px; object-fit: contain; opacity: 0; transform: scale(.3) translateY(20px); transition: transform .5s cubic-bezier(.2,.9,.3,1.4) .1s, opacity .3s .1s; }
.dmoment.opened .dm-box { transform: scale(1.3); opacity: 0; } .dmoment.opened .dm-prize { opacity: 1; transform: none; }
.dm-strip { display: flex; justify-content: center; gap: 8px; margin: 0 0 16px; }
.dm-strip i { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: var(--t-14); background: var(--sand-100); color: var(--ink-3); }
.dm-strip i.now { background: var(--gold); color: var(--ink); box-shadow: 0 0 0 3px #FFE7AE; }
.dm-strip i.done { background: var(--palm); color: #fff; } .dm-strip i .ic { width: 16px; height: 16px; stroke-width: 3; }
.dm-chips { margin-bottom: 16px; }
@keyframes spin { to { transform: rotate(360deg); } }
.reduce .dmoment .sunb { animation: none; }

/* ---- puzzle near miss ---- */
.nm-hero { width: 96px; height: 96px; margin: 0 auto 8px; border-radius: 50%; background: radial-gradient(#FFF1C6, #FFD877); display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 0 0 6px #FFF4D9; }
.nm-hero b { font-size: var(--t-32); line-height: 1; } .nm-hero small { font-size: var(--t-12); font-weight: 700; color: var(--ink-2); }
.nm-hero.out { background: var(--sand-100); box-shadow: none; color: var(--ink-3); } .nm-hero.out .ic { width: 40px; height: 40px; }
.pzlose .btn.coins em { background: var(--sand-200); }

/* ---- puzzle list in sets, hard badge, blockers ---- */
.pzlist { flex: 1; overflow-y: auto; padding: 8px 0 24px; max-width: 520px; width: 100%; margin: 0 auto; }
.pzset + .pzset { margin-top: 24px; }
.pzsh { display: flex; align-items: center; gap: 8px; height: 32px; margin-bottom: 8px; }
.pzsh b { font-size: var(--t-16); } .pzsize { font-size: var(--t-12); font-weight: 700; color: var(--ink-3); padding: 2px 8px; border-radius: 999px; background: rgba(255, 252, 246, .7); }
.pzsp { flex: 1; height: 8px; border-radius: 4px; background: rgba(255, 252, 246, .7); overflow: hidden; } .pzsp i { display: block; height: 100%; background: var(--palm); border-radius: 4px; }
.pzsh small { font-size: var(--t-12); font-weight: 700; color: var(--ink-2); }
.pzlist .pzgrid { overflow: visible; padding: 0; flex: none; }
.pzn { transition: transform .09s; } .pzn:active:not(:disabled) { transform: scale(.94); }
.pzn.hard { background: linear-gradient(160deg, #FFF1EC, #FBD9CF); } .pzn.hard::after { display: none; }
.hb { display: inline-flex; align-items: center; gap: 2px; font-style: normal; font-size: 10px; font-weight: 800; color: #fff; background: #C94B39; border-radius: 999px; padding: 1px 6px 1px 4px; text-transform: uppercase; letter-spacing: .03em; }
.hb .ic { width: 10px; height: 10px; fill: currentColor; stroke-width: 1.5; }
.pzn .hb { position: absolute; top: -6px; left: 50%; transform: translateX(-50%); box-shadow: 0 2px 0 #8F2E21; }
.hb.big { font-size: var(--t-12); padding: 2px 8px 2px 6px; margin-inline-start: 8px; vertical-align: middle; } .hb.big .ic { width: 12px; height: 12px; }
.pzc { display: inline-flex; align-items: center; gap: 4px; } .pzc img { width: 24px; height: 24px; }
.pzwrap { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; }
.pzboard { --c: min(calc((100vw - 56px) / var(--pw) - 3px), calc((100vh - 300px - var(--safe-t) - var(--safe-b)) / var(--ph) - 3px), 76px); margin: 0 auto; }
.pc.crate { background: repeating-linear-gradient(90deg, rgba(0, 0, 0, 0) 0 30%, rgba(90, 55, 20, .18) 30% 33%), linear-gradient(160deg, #C98B4E, #A86A34);
  box-shadow: inset 0 0 0 3px #8A5426, inset 0 2px 0 4px rgba(255, 220, 170, .35), inset 0 -3px 0 3px rgba(70, 40, 10, .3); }
.pc.crate::before { content: ''; position: absolute; inset: 18%; background: linear-gradient(45deg, transparent 44%, #8A5426 44% 56%, transparent 56%); opacity: .8; }
.pc.ice { background: linear-gradient(150deg, #E9F7FC, #BFE3F2); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .9), inset 0 -3px 0 rgba(70, 140, 170, .3); }
.pc.ice img { opacity: .82; filter: saturate(.75) drop-shadow(0 2px 2px rgba(40, 90, 120, .25)); }
.pc.ice::after { content: ''; position: absolute; inset: 4px; border-radius: 9px; background: linear-gradient(130deg, rgba(255, 255, 255, .7) 0 18%, transparent 18% 60%, rgba(255, 255, 255, .45) 60% 64%, transparent 64%); pointer-events: none; }
.gch .tick { position: absolute; top: -4px; inset-inline-end: -4px; width: 20px; height: 20px; border-radius: 50%; background: var(--palm); color: #fff; display: none; place-items: center; }
.gch .tick .ic { width: 12px; height: 12px; stroke-width: 3.5; } .gch.have .tick { display: grid; }
.pzf { gap: 12px; padding-top: 8px; } .pzf .btn { width: auto; min-width: 128px; height: 48px; }

/* ---- layout: small phones and desktop ---- */
@media (max-width: 370px) {
  .btn { padding: 0 16px; } .row2 > .btn { padding: 0 8px; font-size: var(--t-14); }
  .pzf .btn { min-width: 112px; }
  .streak .pips { display: none; }
}
@media (min-width: 960px) {
  .sheet { max-width: 440px; }
  .pzlist .pzgrid { grid-template-columns: repeat(10, 1fr); }
  .pzlist { max-width: 720px; }
}
