/* Color Clash: page-specific styles on top of ../arcade-common/pz.css */
body[data-tod="day"] { --accent: #e5392f; --accent2: #f08a00; --glow: rgba(229, 57, 47, .22); --felt1: #3fa57a; --felt2: #1f6f58; --felt-ink: #fff; }
body[data-tod="night"] { --accent: #ff5d73; --accent2: #ffb347; --glow: rgba(255, 93, 115, .16); --felt1: #1b3d6e; --felt2: #0a1330; --felt-ink: #eaf0ff; }
.field > span em { font-style: normal; text-transform: none; letter-spacing: 0; font-weight: 400; }
.col { display: grid; gap: 16px; min-width: 0; }
.menu-grid > * { min-width: 0; }

/* ---------- cards ---------- */
.play, .hero-card { --cw: 64px; --ch: calc(var(--cw) * 1.46); }
.cd {
  --cc: #555; --cg: #555; --ch: calc(var(--cw) * 1.46); position: relative; display: inline-block; flex: none; box-sizing: border-box; width: var(--cw); height: var(--ch);
  border-radius: calc(var(--cw) * .13); background: var(--cc); color: #fff; border: calc(var(--cw) * .06) solid #fff; padding: 0; margin: 0;
  box-shadow: 0 2px 7px rgba(0, 0, 0, .38); font-family: var(--font); user-select: none; -webkit-user-select: none; overflow: hidden; line-height: 1;
}
.cd.cR { --cc: #e53935; --cg: #d32f2f; }
.cd.cY { --cc: #f6b800; --cg: #b87900; }
.cd.cG { --cc: #2e9e4f; --cg: #1f7a3a; }
.cd.cB { --cc: #1e6fe0; --cg: #1553b3; }
.cd.cW { --cc: #1b1b30; --cg: #fff; }
.cd .ov { position: absolute; left: 10%; right: 10%; top: 12%; bottom: 12%; border-radius: 50%; background: #fff; transform: rotate(-22deg); }
.cd.cW .ov { background: conic-gradient(#e53935 0 25%, #f6b800 0 50%, #2e9e4f 0 75%, #1e6fe0 0); }
.cd .gl { position: absolute; inset: 0; display: grid; place-items: center; color: var(--cg); font-weight: 800; font-size: calc(var(--cw) * .5); letter-spacing: -.04em; }
.cd .gl.sm { font-size: calc(var(--cw) * .36); }
.cd.cW .gl { color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .75), 0 0 2px #000; }
.cd .tl, .cd .br { position: absolute; font-style: normal; font-weight: 800; font-size: calc(var(--cw) * .2); }
.cd .tl { left: 7%; top: 5%; }
.cd .br { right: 7%; bottom: 5%; transform: rotate(180deg); }
.cd.cY .tl, .cd.cY .br { color: #3b2a00; }
.cd .sy { position: absolute; left: 0; right: 0; bottom: 3%; text-align: center; font-style: normal; font-size: calc(var(--cw) * .17); opacity: .92; }
.cd.cY .sy { color: #3b2a00; }
.cd.back { --cc: #151c42; background: #151c42; border-color: #f3f5ff; }
.cd.back::before { content: ""; position: absolute; left: 12%; right: 12%; top: 14%; bottom: 14%; border-radius: 50%; background: linear-gradient(135deg, #ff5d73, #ffb347); transform: rotate(-22deg); }
.cd.back b { position: absolute; inset: 0; display: grid; place-items: center; font-size: calc(var(--cw) * .3); font-weight: 800; color: #fff; letter-spacing: -.02em; text-shadow: 0 1px 3px rgba(0, 0, 0, .55); z-index: 1; }
.cd.mini { --cw: calc(var(--cwo, 64px) * .46); border-width: 1.5px; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.cd.mini::before { left: 14%; right: 14%; }

/* ---------- hero fan on the menu ---------- */
.hero-fan { position: relative; height: calc(var(--ch) + 46px); margin: 14px 0 2px; }
.hero-fan .cd { position: absolute; left: 50%; top: 20px; margin-left: calc(var(--cw) / -2); transform-origin: 50% 190%; transform: rotate(calc((var(--i) - 3) * 11deg)); animation: sway 5s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -.6s); }
@keyframes sway { from { transform: rotate(calc((var(--i) - 3) * 11deg)); } to { transform: rotate(calc((var(--i) - 3) * 8deg + 3deg)) translateY(-5px); } }

/* ---------- menu pickers ---------- */
.label.lvl { display: block; margin-top: 16px; }
.modes { display: grid; gap: 8px; margin-top: 8px; }
.modes button { text-align: left; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--card2); color: var(--ink); min-height: 44px; }
.modes button b { font-size: 1rem; }
.modes button span { grid-column: 1; font-size: .8rem; color: var(--muted); line-height: 1.3; }
.modes button small { grid-column: 2; grid-row: 1 / span 2; font-weight: 700; font-size: .78rem; color: var(--muted); white-space: nowrap; }
.modes button[aria-checked="true"] { border-color: transparent; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; box-shadow: 0 6px 18px var(--glow); }
.modes button[aria-checked="true"] span, .modes button[aria-checked="true"] small { color: rgba(255, 255, 255, .92); }
#botPick { margin-top: 8px; }
#botPick button { flex: 1 1 0; min-height: 48px; }
.how { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.how li { display: flex; gap: 12px; align-items: flex-start; font-size: .9rem; line-height: 1.45; color: var(--ink); }
.how .pi { flex: none; width: 38px; height: 38px; border-radius: 12px; background: var(--card2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 1.2rem; }
.lb { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.lb li { display: grid; grid-template-columns: 28px 1fr auto auto; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 12px; background: var(--card2); font-size: .92rem; min-width: 0; }
.lb li.me { outline: 2px solid var(--accent); }
.lb .rk { font-weight: 800; color: var(--muted); text-align: center; }
.lb li:nth-child(-n+3) .rk { color: var(--accent); }
.lb .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.lb .md { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.lb b { font-variant-numeric: tabular-nums; }
#lbBody .hint { text-align: center; padding: 14px 4px; }
.seg button, .chips button { min-height: 44px; }
.seg { padding: 2px; }
.btn.small { min-height: 44px; }

/* ---------- play screen ---------- */
body[data-screen="play"] { overflow: hidden; position: fixed; inset: 0; width: 100%; overscroll-behavior: none; }
body[data-screen="play"] .top, body[data-screen="play"] main > #scMenu { display: none; }
.play { position: fixed; inset: 0; z-index: 20; margin: 0; display: flex; flex-direction: column; color: var(--felt-ink); background: radial-gradient(ellipse at 50% 42%, var(--felt1), var(--felt2) 78%); --cw: clamp(52px, 15.5vw, 86px); }
.play[hidden] { display: none; }
.hud { flex: none; display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; padding: max(8px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 4px max(10px, env(safe-area-inset-left)); z-index: 3; }
.hudbtn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .35); background: rgba(10, 14, 40, .45); color: #fff; font-size: 1.1rem; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.hudbtn[aria-pressed="false"] { opacity: .55; }
.hud-mid { text-align: center; min-width: 0; }
.hud-round { font-weight: 800; font-size: 1rem; text-shadow: 0 2px 8px rgba(0, 0, 0, .5); }
.hud-target { font-size: .74rem; opacity: .85; font-weight: 600; }
.table { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 4px; padding: 0 max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); position: relative; }
.opps { flex: none; display: flex; justify-content: center; gap: clamp(6px, 2vw, 22px); align-items: flex-start; --cwo: var(--cw); }
.opp { flex: 1 1 0; max-width: 220px; min-width: 0; display: grid; justify-items: center; gap: 3px; padding: 6px 6px 8px; border-radius: 14px; background: rgba(0, 0, 0, .22); border: 2px solid transparent; transition: border-color .2s, background .2s, box-shadow .2s; position: relative; }
.opp.turn { border-color: #ffd24a; background: rgba(255, 210, 74, .16); box-shadow: 0 0 18px rgba(255, 210, 74, .45); }
.opp.exposed { border-color: #ff5d73; }
.opp .nm { font-weight: 800; font-size: .86rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opp .meta { font-size: .72rem; opacity: .9; font-weight: 600; white-space: nowrap; }
.opp .mfan { display: flex; justify-content: center; min-height: calc(var(--cwo) * .46 * 1.46); max-width: 100%; }
.opp .mfan .cd + .cd { margin-left: calc(var(--cwo) * -.3); }
.opp .mfan .cd { margin-left: 0; }
.opp .cntb { position: absolute; top: -8px; right: -6px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; background: #fff; color: #14233a; font-weight: 800; font-size: .8rem; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0, 0, 0, .4); }
.center { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; gap: clamp(14px, 6vw, 40px); }
.pile { position: relative; width: var(--cw); height: var(--ch); flex: none; border: 0; background: none; padding: 0; }
.drawpile { cursor: pointer; }
.drawpile .cd { position: absolute; left: 0; top: 0; }
.drawpile .cd:nth-child(1) { transform: translate(-4px, 4px); }
.drawpile .cd:nth-child(2) { transform: translate(-2px, 2px); }
.drawpile.can { animation: nudge 1.4s ease-in-out infinite; }
.drawpile.can .cd.top { box-shadow: 0 0 0 3px #ffd24a, 0 0 18px 4px rgba(255, 210, 74, .75); }
.drawpile:disabled { cursor: default; }
@keyframes nudge { 50% { transform: translateY(-4px); } }
.cnt { position: absolute; right: -8px; bottom: -8px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; background: rgba(0, 0, 0, .7); color: #fff; font-style: normal; font-weight: 700; font-size: .75rem; display: grid; place-items: center; z-index: 2; }
.dir { font-size: clamp(1.6rem, 6vw, 2.4rem); line-height: 1; opacity: .85; text-shadow: 0 2px 8px rgba(0, 0, 0, .5); transition: transform .5s; }
.dir.rev { animation: flip .6s; }
@keyframes flip { from { transform: scaleX(-1) rotate(-200deg); } }
.discard .ring { position: absolute; inset: -9px; border-radius: calc(var(--cw) * .2); box-shadow: 0 0 0 4px var(--rc, #888), 0 0 26px 8px var(--rc, #888); opacity: .95; transition: box-shadow .3s; }
.discard .ring[data-c="R"] { --rc: #ff4b47; } .discard .ring[data-c="Y"] { --rc: #ffcb1f; } .discard .ring[data-c="G"] { --rc: #35c768; } .discard .ring[data-c="B"] { --rc: #3d8bff; }
.discard .disc-slot { position: absolute; inset: 0; }
.discard .disc-slot .cd { position: absolute; left: 0; top: 0; }
.discard .cur { position: absolute; left: 50%; bottom: calc(var(--ch) * -.2); transform: translateX(-50%); padding: 2px 10px; border-radius: 999px; background: rgba(0, 0, 0, .65); color: #fff; font-size: .72rem; font-weight: 700; white-space: nowrap; z-index: 2; }
.msg { flex: none; min-height: 2.6em; display: grid; place-items: center; text-align: center; font-weight: 700; font-size: clamp(.82rem, 3.2vw, 1rem); text-shadow: 0 2px 6px rgba(0, 0, 0, .55); padding: 0 6px; }
.mine { flex: none; display: grid; gap: 4px; justify-items: center; min-width: 0; }
.actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; min-height: 44px; }
.act { min-height: 44px; padding: 8px 18px; border-radius: 999px; border: 2px solid rgba(255, 255, 255, .45); background: rgba(10, 14, 40, .5); color: #fff; font-weight: 800; font-size: .92rem; letter-spacing: .02em; }
.act[hidden] { display: none; }
.act.last { background: linear-gradient(135deg, #ff5d73, #ff9f1c); border-color: #fff; box-shadow: 0 4px 14px rgba(255, 93, 115, .5); }
.act.last:disabled { opacity: .4; box-shadow: none; filter: grayscale(.5); }
.act.last.hot:not(:disabled) { animation: pulse 1s ease-in-out infinite; }
.act.last[aria-pressed="true"] { background: linear-gradient(135deg, #35d97a, #1aa551); animation: none; }
.act.catch { background: linear-gradient(135deg, #7c3aed, #ec4899); border-color: #fff; animation: pulse .8s ease-in-out infinite; }
.act.keep { background: rgba(255, 255, 255, .92); color: #14233a; }
@keyframes pulse { 50% { transform: scale(1.07); } }
.youbar { font-size: .76rem; font-weight: 700; opacity: .95; display: flex; gap: 8px; align-items: center; justify-content: center; }
.youbar .dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, .35); }
.youbar.turn .dot { background: #ffd24a; box-shadow: 0 0 10px #ffd24a; }
.hand { width: 100%; max-width: 1100px; display: grid; justify-items: center; gap: 0; padding-top: 14px; }
.hrow { display: flex; justify-content: center; align-items: flex-end; max-width: 100%; }
.hrow + .hrow { margin-top: calc(var(--ch) * -.5); }
.hand .cd { cursor: pointer; transition: transform .14s, filter .2s; touch-action: manipulation; }
.hand .cd + .cd { margin-left: var(--ov, -30px); }
.hand.myturn .cd:not(.ok) { filter: brightness(.55) saturate(.7); cursor: not-allowed; }
.hand .cd.ok { box-shadow: 0 0 0 2px #fff, 0 0 14px 3px rgba(255, 210, 74, .75); }
.hand.myturn .cd.ok { transform: translateY(-8px); }
.hand .cd:focus-visible { outline: 3px solid #fff; outline-offset: 2px; transform: translateY(-16px); z-index: 6; }
@media (hover: hover) { .hand .cd:hover { transform: translateY(-14px); z-index: 6; } }
.hand .cd.drew { animation: drew .5s; }
@keyframes drew { 30% { transform: translateY(-26px) scale(1.08); } }
.hand .cd.deal { animation: dealin .35s backwards; }
@keyframes dealin { from { transform: translateY(-120px) scale(.6); opacity: 0; } }

/* wild colour picker */
.picker { position: absolute; inset: 0; z-index: 12; display: grid; place-items: center; background: rgba(5, 8, 25, .6); padding: 14px; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.picker[hidden] { display: none; }
.picker-box { background: var(--card); color: var(--ink); border-radius: 20px; padding: 18px; width: min(360px, 100%); text-align: center; box-shadow: 0 20px 50px rgba(0, 0, 0, .5); animation: pop .25s; }
.picker-box p { margin: 0 0 12px; font-weight: 800; font-size: 1.15rem; }
.picker-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pk { min-height: 64px; border-radius: 16px; border: 3px solid #fff; color: #fff; font-weight: 800; font-size: 1rem; display: grid; place-items: center; gap: 0; padding: 8px; box-shadow: 0 3px 10px rgba(0, 0, 0, .3); }
.pk i { font-style: normal; font-size: 1.3rem; line-height: 1; }
.pk.cR { background: #e53935; } .pk.cY { background: #f6b800; color: #3b2a00; } .pk.cG { background: #2e9e4f; } .pk.cB { background: #1e6fe0; }
.pk:focus-visible { outline: 4px solid var(--ink); outline-offset: 2px; }

/* effects layer: flying cards and call-outs */
.fxl { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 30; }
.fxl .cd { position: fixed; margin: 0; z-index: 31; }
.bubble { position: fixed; transform: translate(-50%, -50%); padding: 6px 14px; border-radius: 999px; background: #fff; color: #c2185b; font-weight: 800; font-size: .95rem; box-shadow: 0 6px 18px rgba(0, 0, 0, .4); animation: bub 1.6s forwards; white-space: nowrap; }
@keyframes bub { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -90%); } }
.overlay[id="pzOverlay"] { z-index: 60; }

/* result overlay */
.newbest { display: inline-block; margin-bottom: 6px; padding: 4px 14px; border-radius: 999px; font-weight: 800; font-size: .85rem; color: #1a1030; background: linear-gradient(135deg, #ffd24a, #ff8a3d); }
.ovscore { font-size: clamp(2.2rem, 12vw, 3.2rem); font-weight: 800; line-height: 1.05; background: linear-gradient(90deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ovsub { color: var(--muted); font-weight: 700; font-size: .85rem; letter-spacing: .04em; text-transform: uppercase; }
.sb { list-style: none; margin: 12px 0 4px; padding: 0; display: grid; gap: 6px; text-align: left; }
.sb li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(40px, 90px) auto; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 12px; background: var(--card2); font-size: .9rem; }
.sb li.win { outline: 2px solid var(--accent); }
.sb .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.sb .bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.sb .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.sb b { font-variant-numeric: tabular-nums; }
.ovname { text-align: left; margin-top: 12px; }
.ovboard { text-align: left; margin-top: 8px; }
.ovboard .label { margin: 8px 0 0; }
.overlay > .card { display: flex; flex-direction: column; overflow: hidden; padding: 16px; }
.overlay .ovbody { overflow-y: auto; min-height: 0; flex: 1 1 auto; overscroll-behavior: contain; padding: 0 2px; }
.overlay .big, .overlay h2, .overlay .row { flex: none; }
.overlay .row .btn { flex: 1 1 130px; }
.overlay .btn.go { margin-top: 0; width: auto; }
@media (max-height: 680px) { .overlay .big { display: none; } .overlay h2 { font-size: 1.3rem; margin-top: 0; } .ovboard { display: none; } }
@media (max-height: 520px) { .overlay .row { margin-top: 10px; flex-wrap: nowrap; } .overlay .row .btn { flex: 1 1 0; padding: 8px 6px; font-size: .9rem; } }
@media (max-width: 420px) { .overlay .row { gap: 8px; } .overlay .row .btn { flex: 1 1 40%; padding: 8px 4px; font-size: .88rem; } }

/* short screens (phones on their side) */
@media (max-height: 640px) { .play { --cw: clamp(40px, 11vw, 60px); } .cd .tl, .cd .br { display: none; } }
@media (max-height: 640px) and (min-width: 700px) { .opps { gap: 10px; } .opp { padding: 3px 6px 4px; } .msg { min-height: 1.6em; } }
@media (max-height: 460px) {
  .play { --cw: 40px; }
  .hud { position: absolute; left: 0; right: 0; top: 0; padding-bottom: 0; pointer-events: none; display: flex; justify-content: space-between; }
  .hud > * { pointer-events: auto; }
  .hud-mid { display: none; }
  .table { padding-top: 4px; }
  .opps { padding: 0 56px; gap: 8px; }
  .opp { display: flex; gap: 6px; align-items: center; justify-content: center; padding: 4px 8px; }
  .opp .mfan { display: none; }
  .opp .cntb { position: static; min-width: 22px; height: 22px; box-shadow: none; }
  .opp .nm { order: 1; } .opp .meta { order: 2; } .opp .cntb { order: 0; }
  .youbar { display: none; }
  .hand { padding-top: 6px; }
  .discard .cur { display: none; }
  .msg { min-height: 1.5em; }
}
@media (max-width: 360px) { .opp .nm { font-size: .78rem; } .act { padding: 8px 12px; font-size: .84rem; } }
@media (min-width: 900px) and (min-height: 760px) { .play { --cw: 88px; } }
@media (min-width: 1500px) and (min-height: 940px) { .play { --cw: 104px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
