/* Base styles reused from Check-Mate v1.6.0 css/app.css (chess-board rules left in place, unused). Bare Pairs additions at the bottom. */
@font-face { font-family: "BP Display"; src: url("../assets/fonts/Fraunces.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
:root {
  --bg: #120e17; --bg2: #1c1622; --card: #221b29; --line: #3a2f43;
  --text: #f5eef7; --muted: #b3a6b8;
  --pink: #ff6fae; --pink-d: #c23c7c; --pink-soft: #ffd1e6;
  --blue: #4fa3ff; --blue-d: #1f63b8; --blue-soft: #cfe6ff;
  --sq-light: #ece3e9; --sq-dark: #9c8b99;
  --danger: #ff5a5f;
  --radius: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "BP Display", Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); }
body {
  background: radial-gradient(120% 60% at 0% 0%, rgba(255,111,174,.16), transparent 60%),
              radial-gradient(120% 60% at 100% 100%, rgba(79,163,255,.16), transparent 60%), var(--bg);
  background-size: cover; background-attachment: fixed;
  overscroll-behavior: none; -webkit-user-select: none; user-select: none;
}
textarea { -webkit-user-select: text; user-select: text; }
#app { max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; }
.screen { padding: max(14px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; min-height: 100dvh; }
h1, h2, h3 { margin: 0; }
h2 { font-size: 18px; letter-spacing: .2px; }
p { line-height: 1.45; margin: 0; }
.muted { color: var(--muted); } .small { font-size: 13px; } .center { text-align: center; }

/* brand */
.brand { text-align: center; padding: 8px 0 2px; }
.brand .company { font-size: 13px; letter-spacing: 3px; text-transform: uppercase; color: var(--muted); }
.brand .presents { font-size: 12px; font-style: italic; color: var(--muted); margin: 2px 0; }
.brand .title { font-family: var(--display); font-size: 42px; font-weight: 700; line-height: 1;
  background: linear-gradient(90deg, var(--pink), #fff 50%, var(--blue)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand.big { padding-top: 10vh; } .brand.big .title { font-size: 56px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.brand.has-logo { padding: 4px 0 0; }
.brand .logo-full { display: block; margin: 0 auto; width: min(250px, 66vw); height: auto; filter: drop-shadow(0 6px 18px rgba(224, 24, 92, .25)); }
.brand.has-logo.big { padding-top: 4vh; } .brand.has-logo.big .logo-full { width: min(340px, 88vw); }
.mini-brand.has-logo { display: flex; align-items: center; gap: 6px; height: 42px; }
.mini-brand .mini-mark { height: 40px; width: auto; }
.mini-brand .mini-word { height: 30px; width: auto; }
.brand .logo { max-width: 220px; max-height: 90px; display: block; margin: 0 auto; }
.brand .title-art { max-width: 90%; max-height: 120px; display: block; margin: 0 auto; }

.card { background: color-mix(in srgb, var(--card) 92%, transparent); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; }

/* buttons */
.btn { appearance: none; border: 1px solid var(--line); background: var(--bg2); color: var(--text); font: 600 16px var(--font);
  border-radius: 12px; padding: 13px 16px; cursor: pointer; text-align: center; text-decoration: none; display: inline-block; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.wide { width: 100%; }
.btn.primary { background: linear-gradient(90deg, var(--pink-d), var(--blue-d)); border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn.link { background: none; border: none; color: var(--muted); text-decoration: underline; font-weight: 500; font-size: 14px; padding: 6px; }
.icon-btn { background: var(--bg2); border: 1px solid var(--line); color: var(--text); width: 42px; height: 42px; border-radius: 12px; font-size: 20px; cursor: pointer; }

/* gate */
.gate .card { margin-top: 24px; align-items: stretch; text-align: center; }
.badge18 { align-self: center; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 22px;
  border: 3px solid var(--pink); box-shadow: 0 0 0 3px var(--blue) inset; }

/* setup */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opt { appearance: none; background: var(--bg2); border: 1px solid var(--line); color: var(--text); border-radius: 12px; padding: 12px 10px; font: 600 15px var(--font); cursor: pointer; }
.opt small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); margin-top: 3px; }
.opt.on { border-color: transparent; background: linear-gradient(135deg, rgba(255,111,174,.35), rgba(79,163,255,.35)); box-shadow: 0 0 0 2px #fff3 inset; }
.opt:disabled { opacity: .45; }
.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.side { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 12px; border: 1px solid var(--line); }
.side img { width: 40px; height: 40px; } .side small { display: block; color: var(--muted); font-size: 12px; }
.side.pink { background: rgba(255,111,174,.12); border-color: rgba(255,111,174,.5); }
.side.blue { background: rgba(79,163,255,.12); border-color: rgba(79,163,255,.5); }
table.times { width: 100%; border-collapse: collapse; font-size: 14px; }
table.times th, table.times td { padding: 6px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.times th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
table.times .hl { color: #fff; background: rgba(255,255,255,.06); font-weight: 600; }
table.qc td:first-child { width: 34%; }
textarea { width: 100%; background: var(--bg2); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 10px; font: 15px var(--font); resize: vertical; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.check input { margin-top: 3px; accent-color: var(--pink); }
.confirm-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn.confirm.pink { border-color: var(--pink); color: var(--pink-soft); }
.btn.confirm.blue { border-color: var(--blue); color: var(--blue-soft); }
.btn.confirm.pink.on { background: var(--pink-d); color: #fff; }
.btn.confirm.blue.on { background: var(--blue-d); color: #fff; }

/* board */
.topbar { display: flex; justify-content: space-between; align-items: center; }
.mini-brand span { display: block; font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.mini-brand b { font-family: var(--display); font-size: 22px; }
.player-row { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; padding: 6px 10px; border-radius: 12px; border: 1px solid transparent; min-height: 40px; }
.player-row .dot-ind { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.player-row.pink .dot-ind { background: var(--pink); } .player-row.blue .dot-ind { background: var(--blue); }
.player-row.active.pink { border-color: var(--pink); background: rgba(255,111,174,.12); }
.player-row.active.blue { border-color: var(--blue); background: rgba(79,163,255,.12); }
.tray { display: flex; flex-wrap: wrap; margin-left: auto; }
.tray img { width: 20px; height: 20px; margin-left: -4px; }
.board { display: grid; grid-template-columns: repeat(8, 1fr); width: 100%; aspect-ratio: 1; border-radius: 10px; overflow: hidden;
  box-shadow: 0 10px 40px rgba(0,0,0,.5), 0 0 0 2px var(--line); }
.sq { position: relative; border: 0; padding: 0; margin: 0; aspect-ratio: 1; display: grid; place-items: center; cursor: pointer; }
.sq.light { background: var(--sq-light); } .sq.dark { background: var(--sq-dark); }
.sq img { width: 88%; height: 88%; pointer-events: none; filter: drop-shadow(0 1px 1px rgba(0,0,0,.35)); }
.sq.last::before { content: ""; position: absolute; inset: 0; background: rgba(255, 214, 90, .38); }
.sq.sel::before { content: ""; position: absolute; inset: 0; background: rgba(255, 214, 90, .7); }
.sq.dot::after { content: ""; position: absolute; width: 28%; height: 28%; border-radius: 50%; background: rgba(30, 20, 40, .45); }
.sq.cap::after { content: ""; position: absolute; inset: 4%; border-radius: 50%; border: 5px solid rgba(30, 20, 40, .45); }
.sq.check { background: radial-gradient(circle, #ff3b3b 0%, #ff3b3bbb 40%, transparent 75%), var(--sq-light); }
.sq img { position: relative; z-index: 1; }
.cf, .cr { position: absolute; font-size: 10px; font-weight: 700; color: rgba(40,25,45,.55); z-index: 2; }
.cf { right: 3px; bottom: 1px; } .cr { left: 3px; top: 1px; }
.status { display: flex; justify-content: center; gap: 8px; align-items: center; min-height: 36px; }
.turn-pill, .check-pill { padding: 7px 16px; border-radius: 999px; font-weight: 700; }
.turn-pill.pink { background: var(--pink); color: #3a0820; } .turn-pill.blue { background: var(--blue); color: #061d3d; }
.check-pill { background: var(--danger); color: #fff; animation: pulse 1s infinite alternate; }
@keyframes pulse { to { transform: scale(1.06); } }
.foot { text-align: center; }

/* task */
.task-head { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.task-piece { width: 64px; height: 64px; flex: none; filter: drop-shadow(0 3px 8px rgba(0,0,0,.5)); }
.kicker { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 1.5px; }
.task-head h2 { font-family: var(--display); font-size: 28px; }
.roles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.role { border-radius: 12px; padding: 8px 10px; border: 1px solid; }
.role small { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
.role.pink { border-color: var(--pink); background: rgba(255,111,174,.12); } .role.blue { border-color: var(--blue); background: rgba(79,163,255,.12); }
.task-text { font-size: 18px; line-height: 1.5; }
.task-text.big { font-family: var(--display); font-size: 26px; }
.timer-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ring { --p: 1; width: 168px; height: 168px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--pink) 0turn, var(--blue) calc(var(--p) * 1turn), #ffffff14 calc(var(--p) * 1turn)); }
.timer { width: 146px; height: 146px; border-radius: 50%; background: var(--bg); display: grid; place-items: center; font: 700 44px var(--font); font-variant-numeric: tabular-nums; }
.task-screen.done .timer { color: var(--danger); animation: pulse .3s infinite alternate; }
.btn.start { font-size: 20px; padding: 16px; }

/* finished */
.finished h2 { font-family: var(--display); font-size: 30px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0; }
.stats div { background: var(--bg2); border-radius: 12px; padding: 10px; }
.stats b { font-size: 24px; display: block; } .stats small { color: var(--muted); }

/* modal */
.modal-back { position: fixed; inset: 0; background: rgba(5,3,8,.7); display: grid; place-items: center; padding: 16px; z-index: 50; backdrop-filter: blur(4px); }
.modal { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; width: min(440px, 100%); max-height: 90vh; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.modal-actions { display: flex; flex-direction: column; gap: 8px; }
.promo-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; }
.promo-pic img { width: 100%; max-width: 64px; } .promo-pic small, .promo-pic em { display: block; font-size: 11px; color: var(--muted); }
.modal-actions .promo-btn { display: inline-block; }
.modal:has(.promo-row) .modal-actions { display: grid; grid-template-columns: repeat(4, 1fr); }
.modal:has(.promo-row) .modal-actions .ghost { grid-column: 1 / -1; }
.btn.promo-btn { padding: 10px 4px; font-size: 13px; }
.btn.promo-btn.pink { border-color: var(--pink); } .btn.promo-btn.blue { border-color: var(--blue); }

.debug { position: fixed; bottom: 4px; left: 4px; font-size: 10px; background: #ff0; color: #000; padding: 2px 6px; border-radius: 4px; z-index: 60; }

/* rook (untimed) */
.untimed { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 18px 12px; border: 2px dashed var(--line); border-radius: var(--radius); }
.untimed b { font-size: 20px; } .untimed span { color: var(--muted); font-size: 14px; }
.rook-banner { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; font-weight: 700; font-size: 14px;
  background: linear-gradient(90deg, rgba(255,111,174,.25), rgba(79,163,255,.25)); border: 1px solid #ffffff33; animation: glow 1.6s infinite alternate; }
.rook-banner img { width: 26px; height: 26px; flex: none; }
@keyframes glow { to { box-shadow: 0 0 16px rgba(255,111,174,.35); } }
.closed .card { margin-top: 24px; }

/* two phones */
.seg.lobby .btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 8px; }
.seg.lobby .btn small { font-weight: 400; font-size: 11px; opacity: .8; }
.join-form { display: flex; gap: 8px; margin-top: 10px; }
.join-form input { flex: 1; min-width: 0; font: 700 26px/1 var(--display); letter-spacing: 6px; text-align: center; text-transform: uppercase;
  background: var(--bg2); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.join-form input:focus { outline: 2px solid var(--pink); }
.room { text-align: center; border: 1px dashed var(--line); border-radius: 14px; padding: 10px 12px; margin: 10px 0 6px; }
.room > small { text-transform: uppercase; letter-spacing: 2px; font-size: 11px; color: var(--muted); }
.room-code { font: 800 44px/1.1 var(--display); letter-spacing: 10px; padding-left: 10px; color: var(--pink-soft); user-select: all; }
.room p { margin: 6px 0; }
.net-status { font-size: 13px; color: var(--muted); }
.net-status.connected { color: #7be0a4; }
.small-h { font-size: 13px; margin: 12px 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: 1.5px; }
.side.mine { box-shadow: 0 0 0 2px currentColor inset; }
.side .you, .player-row .you, .role .you { display: inline-block; font-style: normal; font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  background: rgba(255,255,255,.12); border-radius: 6px; padding: 1px 6px; margin-left: 6px; vertical-align: middle; }
.side .you { margin: 4px 0 0; }
.btn.confirm.static { display: flex; align-items: center; justify-content: center; opacity: .75; cursor: default; }
.net-banner { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 8px; justify-content: center; text-align: center;
  padding: 8px 12px; font-size: 13px; font-weight: 600; background: #3a2a10; color: #ffe2a8; border-bottom: 1px solid #8a6a2a; }
.net-banner.waiting { background: #1d2333; color: #cfe0ff; border-color: #3e5a8a; }
.net-banner .spinner { width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .9s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.draw-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: center; padding: 8px 10px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg2); font-size: 14px; font-weight: 600; }
.draw-bar .btn { padding: 6px 12px; min-height: 0; font-size: 13px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; transition: .25s; z-index: 200;
  background: #000c; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; pointer-events: none; max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ===================== Bare Pairs ===================== */
@font-face { font-family: "BP Script"; src: url("../assets/fonts/KaushanScript.ttf") format("truetype"); font-display: swap; }
:root { --script: "BP Script", "Brush Script MT", cursive; --gold: #f4cf6e; --wine: #5c0f33; --rose: #d0104f; }
.brand .company { letter-spacing: 3px; }
.brand .title { font-family: var(--script); font-weight: 400; font-size: 54px; line-height: 1.15; padding: 0 6px;
  background: linear-gradient(90deg, var(--pink), #fff 50%, var(--blue)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand.big .title { font-size: 68px; }
.brand .tagline { font-family: var(--display); font-style: italic; color: var(--gold); font-size: 15px; margin-top: 2px; }
.mini-brand b { font-family: var(--script); font-weight: 400; font-size: 26px; color: var(--pink-soft); }
.btn small { display: block; font-weight: 400; font-size: 12px; opacity: .8; margin-top: 2px; }
.row-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; font-weight: 600; }
.row-label small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.seg3 { display: grid; grid-template-columns: repeat(3, 48px); gap: 6px; }
.seg3 .opt { padding: 10px 0; }
.qr { width: 176px; margin: 8px auto 4px; background: #fff; border-radius: 12px; padding: 6px; }
.qr svg { display: block; width: 100%; height: auto; }
/* board */
.scores { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.player-row { justify-content: space-between; }
.player-row.active.blue { border-color: var(--blue); background: rgba(79,163,255,.12); }
.player-row .pts { font: 700 24px var(--display); margin-left: auto; }
.player-row.pink .pts { color: var(--pink); } .player-row.blue .pts { color: var(--blue); }
.shield-chip { font-size: 12px; background: #0a2550; border: 1px solid #9ccdff; color: #cfe6ff; border-radius: 8px; padding: 1px 6px; }
.turn-pill.miss { background: #3a2f43; color: var(--text); }
.turn-pill.match { animation: pulse .4s infinite alternate; }
.small-btn { padding: 6px 12px; font-size: 13px; }
.grid { display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 8px; width: 100%; perspective: 900px; }
.grid.g6 { gap: 5px; }
.mcard { appearance: none; border: 0; padding: 0; background: none; aspect-ratio: 3 / 4; cursor: pointer; position: relative; }
.mcard[aria-disabled="true"] { cursor: default; }
.mcard .inner { position: absolute; inset: 0; transition: transform .45s cubic-bezier(.3,1.4,.5,1); transform-style: preserve-3d; }
.mcard.up .inner { transform: rotateY(180deg); }
.mcard .back, .mcard .front { position: absolute; inset: 0; border-radius: 10px; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: grid; place-items: center; overflow: hidden; }
.mcard .back { background: radial-gradient(circle at 30% 20%, #ff6fae, #c23c7c 45%, #5c0f33 100%); border: 2px solid #f4cf6e88;
  box-shadow: 0 4px 12px rgba(0,0,0,.4); }
.mcard.alt .back { background: radial-gradient(circle at 30% 20%, #4fa3ff, #1f63b8 45%, #0a2550 100%); }
.mcard .back svg { width: 70%; height: auto; }
.mcard .front { transform: rotateY(180deg); background: linear-gradient(160deg, #fff7fb, #ffe3ef); border: 2px solid #fff; color: var(--wine);
  grid-template-rows: 1fr auto; padding: 8% 6% 6%; }
.mcard .front svg { width: 78%; height: auto; align-self: center; justify-self: center; }
.mcard .front em { font-style: normal; font: 600 11px var(--font); color: var(--wine); }
.grid.g6 .mcard .front em { font-size: 8px; }
.mcard.special .front { background: linear-gradient(160deg, #2a1830, #120e17); border-color: var(--gold); }
.mcard.special .front em { color: var(--gold); }
.mcard.matched .front { opacity: .82; }
.mcard.matched.pink .front { box-shadow: 0 0 0 3px var(--pink) inset; } .mcard.matched.blue .front { box-shadow: 0 0 0 3px var(--blue) inset; }
.mcard.just-matched .front { opacity: 1; animation: glowc .5s infinite alternate; }
.mcard.miss .front { box-shadow: 0 0 0 3px #ffffff55 inset; }
@keyframes glowc { to { box-shadow: 0 0 18px 4px var(--gold); } }
/* dare */
.task-face { width: 72px; height: 72px; flex: none; border-radius: 14px; background: linear-gradient(160deg, #fff7fb, #ffe3ef); display: grid; place-items: center; }
.task-face.shield { background: linear-gradient(160deg, #2a1830, #120e17); border: 2px solid var(--gold); }
.task-face svg { width: 80%; height: auto; }
.task-head h2 { margin: 2px 0 4px; }
.roles.one { grid-template-columns: 1fr; }
.role.both { border-color: var(--gold); background: rgba(244,207,110,.1); }
.rules-specials { display: flex; flex-direction: column; gap: 8px; }
.rules-specials > div { display: flex; gap: 10px; align-items: center; }
.rules-specials .ico { width: 44px; height: 44px; flex: none; border-radius: 10px; background: #2a1830; border: 1px solid var(--gold); display: grid; place-items: center; }
.rules-specials .ico svg { width: 80%; }
.rules-specials p { font-size: 13px; }
.finished .btn small { font-size: 12px; }
@media (min-width: 900px) { #app { max-width: 620px; } }
/* logo (concept 3a): the tile already carries the company name and a frame */
.brand.has-logo .logo-full { border-radius: 18px; width: min(150px, 40vw); filter: drop-shadow(0 8px 24px rgba(224, 24, 92, .3)); }
.brand.has-logo.big .logo-full { width: min(320px, 82vw); }
.brand.has-logo .tagline { text-align: center; margin-top: 10px; }
.mini-brand.has-logo .mini-mark { height: 38px; width: 38px; border-radius: 9px; }
.mini-brand.has-logo b { font-size: 24px; }
/* board sizes: 24 (4x6), 48 (6x8), 72 (8x9) in portrait; rows/cols swap in landscape.
   The grid is sized so the whole board fits the screen height without scrolling (--chrome = header/scores/status/footer). */
.seg.sizes { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
.board-screen { --chrome: 232px; gap: 8px; }
.grid { --c: var(--cols); --r: var(--rows); grid-template-columns: repeat(var(--c), 1fr);
  width: min(100%, calc((100vh - var(--chrome)) * var(--c) / var(--r) * .75)); margin: 0 auto; }
@supports (height: 100dvh) { .grid { width: min(100%, calc((100dvh - var(--chrome)) * var(--c) / var(--r) * .75)); } }
.grid.g8 { gap: 4px; }
.grid.g8 .mcard .front { padding: 10% 6%; grid-template-rows: 1fr; }
.grid.g8 .mcard .front em { display: none; }
.grid.g8 .mcard .back, .grid.g8 .mcard .front { border-radius: 7px; border-width: 1.5px; }
.grid.g8 .mcard .back svg { width: 82%; }
.mcard.tint-b .front { background: linear-gradient(160deg, #eef6ff, #bcdcff); border-color: #9ccdff; }
.mcard.tint-g .front { background: linear-gradient(160deg, #fff8e6, #f4cf6e); border-color: #f4cf6e; }
@media (orientation: landscape) {
  body[data-phase="board"] #app { max-width: 1100px; }
  .board-screen { --chrome: 200px; }
  .grid { --c: var(--rows); --r: var(--cols); }
  .mcard .back { background: radial-gradient(circle at 30% 20%, #ff6fae, #c23c7c 45%, #5c0f33 100%) !important; }
  .mcard.lalt .back { background: radial-gradient(circle at 30% 20%, #4fa3ff, #1f63b8 45%, #0a2550 100%) !important; }
  .grid.g6 .mcard .front em { font-size: 9px; }
}
@media (orientation: landscape) and (max-height: 500px) {
  /* phone held sideways: scores/status in a side column, board fills the height; cards a little squarer */
  body[data-phase="board"] #app { max-width: none; }
  .board-screen { display: grid; grid-template-columns: minmax(170px, 230px) 1fr; grid-auto-rows: min-content; align-content: start; gap: 8px 14px;
    padding-top: max(10px, env(safe-area-inset-top)); padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
  .board-screen > * { grid-column: 1; }
  .board-screen > .grid { grid-column: 2; grid-row: 1 / span 6; align-self: start;
    width: min(100%, calc((100vh - 24px) * var(--c) / var(--r) * .8)); }
  @supports (height: 100dvh) { .board-screen > .grid { width: min(100%, calc((100dvh - 24px) * var(--c) / var(--r) * .8)); } }
  .board-screen .mcard { aspect-ratio: 4 / 5; }
  .board-screen .scores { grid-template-columns: 1fr; gap: 4px; }
  .board-screen .player-row { min-height: 34px; padding: 4px 10px; }
  .board-screen .status { flex-wrap: wrap; }
  .board-screen .debug { grid-column: 1; }
}
/* rounds */
.seg.rounds { grid-template-columns: repeat(4, 1fr); }
.seg.rounds .opt { font-size: 20px; font-weight: 700; }
.round-chip { font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--gold); border: 1px solid #f4cf6e66; border-radius: 999px; padding: 3px 10px; margin-left: auto; margin-right: 8px; }
.player-row b { display: flex; flex-direction: column; line-height: 1.15; }
.player-row .total { font-weight: 500; font-size: 11px; color: var(--muted); }
.scores.running { margin: 10px 0 4px; }
.scores.running .player-row.pink { border-color: rgba(255,111,174,.5); } .scores.running .player-row.blue { border-color: rgba(79,163,255,.5); }
table.rounds-table { margin: 8px 0; text-align: center; } table.rounds-table th, table.rounds-table td { text-align: center; }
table.rounds-table th.pink { color: var(--pink); } table.rounds-table th.blue { color: var(--blue); }
.bonus-card { border-color: #f4cf6e66; }
.crown { font: 400 34px var(--script); margin: 4px 0; }
.crown.pink { color: var(--pink); } .crown.blue { color: var(--blue); }
/* 4 x 8 portrait: slightly squarer cards so they are wider on phones (fits without scrolling) */
@media (orientation: portrait) {
  .grid.g4 { width: min(100%, calc((100vh - var(--chrome)) * var(--c) / var(--r) * .84)); }
  @supports (height: 100dvh) { .grid.g4 { width: min(100%, calc((100dvh - var(--chrome)) * var(--c) / var(--r) * .84)); } }
  .grid.g4 .mcard { aspect-ratio: 5 / 6; }
}

/* Deck cards: the set's icon (SVG file) + title on both cards of a pair. Black shape + red accent on a light face. */
.mcard .front img { width: 64%; max-height: 62%; object-fit: contain; align-self: center; justify-self: center; pointer-events: none; }
.mcard .front em { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-align: center;
  line-height: 1.05; font-size: 10px; word-break: break-word; }
.mcard.special .front { background: linear-gradient(160deg, #fff7fb, #ffe3ef); border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold) inset; }
.mcard.special .front em { color: var(--wine); }
@media (min-width: 700px) and (min-height: 600px) { .mcard .front em { font-size: 14px; } }
.task-face img { width: 100%; height: 100%; object-fit: contain; }
.task-face img { width: 82%; height: 82%; }

/* ---- Card art (card-art/): squat 3:4 cards sized from the height left under the header / scores / status.
   The grid-wrap takes the remaining height (container query units) and the grid is as wide as fits both ways. ---- */
.board-screen { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
.board-screen > .grid-wrap { flex: 1 1 0; min-height: 0; container-type: size; display: grid; place-items: start center; }
.board-screen .grid-wrap > .grid { --gap: 6px; gap: var(--gap); margin: 0;
  width: min(100cqw, calc((100cqh - (var(--r) - 1) * var(--gap)) * 3 / (4 * var(--r)) * var(--c) + (var(--c) - 1) * var(--gap))); }
.board-screen .grid-wrap .grid .mcard { aspect-ratio: 3 / 4; }
@media (orientation: landscape) and (max-height: 500px) {
  .board-screen > .grid-wrap { grid-column: 2; grid-row: 1 / span 6; height: calc(100dvh - 24px); }
}
/* face-down: the card-back design */
.mcard .back, .mcard.alt .back, .mcard.lalt .back { background: #0b080b url(../cards/card-back.svg) center / cover no-repeat !important; border: 0; }
/* face-up: cream paper, gold double border, icon + title */
.mcard .front, .mcard.special .front { background: linear-gradient(180deg, #fffaf1, #f3e8d6); border: 1.5px solid #e6b24a;
  box-shadow: inset 0 0 0 2px #fffaf1, inset 0 0 0 3px #e6b24a99; color: #151015; }
.mcard .front em, .mcard.special .front em { font-family: "BP Display", Georgia, serif; font-weight: 700; color: #151015; }
.mcard.matched.pink .front { box-shadow: inset 0 0 0 3px var(--pink); } .mcard.matched.blue .front { box-shadow: inset 0 0 0 3px var(--blue); }
.mcard.matched .front { opacity: .6; }
.task-face { background: linear-gradient(180deg, #fffaf1, #f3e8d6); border: 2px solid #e6b24a; }
/* David: face-up cards show NO text, only the set's full-face graphic (3:4), edge to edge. Title + action appear only in the prompt pop-up. */
.mcard .front, .mcard.special .front, .grid.g8 .mcard .front { padding: 0; display: block; background: #fffaf1; border: 0; box-shadow: none; overflow: hidden; }
.mcard .front img, .grid .mcard .front img { display: block; width: 100%; height: 100%; max-height: none; object-fit: cover; }
.mcard .front em { display: none !important; }
.mcard.matched .front { opacity: .82; }
.mcard.matched.pink .front, .mcard.matched.blue .front { box-shadow: none; }
.mcard.matched.pink::after, .mcard.matched.blue::after { content: ''; position: absolute; inset: 0; border-radius: 10px; pointer-events: none; box-shadow: inset 0 0 0 3px var(--pink); }
.mcard.matched.blue::after { box-shadow: inset 0 0 0 3px var(--blue); }
.task-face { padding: 0; overflow: hidden; }
.task-face img { width: 100%; height: 100%; object-fit: cover; }
.task-face.art { width: 84px; height: 112px; border: 0; background: none; border-radius: 10px; box-shadow: 0 6px 18px #0008; }
.task-face:not(.art) img { object-fit: contain; width: 82%; height: 82%; }
.crown.both { background: linear-gradient(90deg, var(--pink), var(--blue)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.finished [data-testid=chooser] { margin-top: 6px; }
.bonus-opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 10px; }
.bonus-opt { aspect-ratio: 3 / 4; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: none; cursor: pointer; box-shadow: 0 4px 14px #0006; transition: transform .15s; }
.bonus-opt:hover, .bonus-opt:focus-visible { transform: translateY(-4px); outline: 2px solid var(--gold); }
.bonus-opt img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (min-width: 700px) { .bonus-opts { max-width: 520px; margin-inline: auto; } }
.bonus-card .waiting { font-size: 18px; font-weight: 600; margin: 8px 0; }
.bonus-card.pink { border-color: var(--pink); } .bonus-card.blue { border-color: var(--blue); }

/* David's prompts: "Woman: …" and "Man: …" on separate lines */
.task-text { white-space: pre-line; }

/* back to all games (naughtydice.com home), same as Check-Mate */
.home-row { display: flex; justify-content: flex-start; margin-bottom: -4px; }
.home-link { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px 6px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg2); color: var(--text); font: 600 14px var(--font); text-decoration: none; white-space: nowrap; }
.home-link .arrow { font-size: 16px; line-height: 1; color: var(--pink-soft); }
.home-link:hover, .home-link:focus-visible { border-color: var(--pink); outline: none; }
.top-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.topbar .home-link { min-height: 42px; border-radius: 12px; }
@media (max-width: 400px) { .topbar .home-link .lbl { display: none; } .topbar .home-link { padding: 6px 12px; } }

/* pre-game shower tip (setup screen) */
.fresh-tip { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--radius);
  border: 1px dashed rgba(255,111,174,.55); background: linear-gradient(90deg, rgba(255,111,174,.12), rgba(79,163,255,.12)); }
.fresh-tip .tip-icon { font-size: 24px; line-height: 1; flex: none; }
.fresh-tip p { font-size: 14px; } .fresh-tip b { color: var(--pink-soft); }
.gate-legal { margin-top: 4px; } .gate-legal a { color: var(--pink-soft); }

/* bonus card timer phases (each card's own timings) */
.bonus-steps { margin: 0; padding: 10px 14px 10px 32px; border-radius: var(--radius); background: var(--bg2); border: 1px solid var(--line); font-size: 14px; line-height: 1.45; }
.bonus-steps li { color: var(--muted, #b9a9b8); }
.bonus-steps li.past { text-decoration: line-through; opacity: .6; }
.bonus-steps li.now { color: var(--text); font-weight: 700; }
.phase-label { text-align: center; font: 700 17px var(--font); color: var(--pink-soft); }
.bonus-outcome { text-align: center; }
.bonus-outcome h3 { margin: 0 0 10px; }
.outcome-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.outcome-btns .btn small { display: block; font-weight: 500; font-size: 12px; opacity: .85; margin-top: 2px; white-space: normal; }
.switch-at { color: var(--pink-soft); font-weight: 700; }

/* Narrow phones: keep the top bar on one line (title, round chip, home + menu buttons). */
.mini-brand b, .round-chip { white-space: nowrap; }
@media (max-width: 400px) {
  .round-chip { font-size: 11px; letter-spacing: .5px; padding: 3px 8px; margin-right: 6px; }
  .round-chip .rc-word { display: none; }
  .mini-brand.has-logo b { font-size: 21px; }
}
