/* Bid Wars. Mobile first: the video is a phone screen, so this is a phone-shaped column that grows on bigger screens. */
:root {
  --bg: #0d0f14; --panel: #171a22; --panel2: #1f232d; --line: #2b303c; --text: #f4f6fb; --dim: #98a1b3;
  --accent: #d9ff3f; --money: #39ff14; --bad: #ff5d5d; --good: #5dff9a;
  --font: "Arial Rounded MT Bold", "SF Pro Rounded", ui-rounded, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; min-height: 100dvh; overscroll-behavior-y: none; touch-action: manipulation; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; touch-action: manipulation; }
button:disabled { cursor: default; }
[hidden] { display: none !important; }
.screen { max-width: 560px; margin: 0 auto; padding: calc(var(--safe-t) + 10px) 14px calc(var(--safe-b) + 30px); min-height: 100vh; min-height: 100dvh; }

/* ---------- the outlined text the video uses everywhere ---------- */
.outline { text-shadow: -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000, 0 3px 0 #000, 0 0 10px rgba(0,0,0,.5); letter-spacing: .01em; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 14px; background: var(--panel2); border: 1px solid var(--line); font-size: 16px; font-weight: 700; }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.985); }
.btn.primary { background: var(--accent); color: #101400; border-color: transparent; }
.btn.big { min-height: 58px; font-size: 20px; width: 100%; border-radius: 18px; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .45; }
.chip { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 14px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--line); font-size: 15px; font-weight: 700; }
.chip.on { background: var(--accent); color: #101400; border-color: transparent; }
.icon { width: 44px; height: 44px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line); font-size: 20px; line-height: 1; }

/* ================================================================ SETUP */
.logo { text-align: center; padding: 10px 0 6px; }
.logo h1 { margin: 0; font-size: 46px; line-height: 1; font-weight: 900; color: var(--accent); }
.logo p { margin: 6px 0 0; color: var(--dim); font-size: 15px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 16px; margin: 14px 0; }
.card h2 { margin: 0 0 12px; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.resume { display: flex; align-items: center; gap: 12px; background: linear-gradient(135deg, #20260a, #171a22); border-color: #3c4a10; }
.resume .t { flex: 1; min-width: 0; } .resume b { display: block; font-size: 17px; } .resume span { color: var(--dim); font-size: 14px; }
.topics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 520px) { .topics { grid-template-columns: repeat(3, 1fr); } }
.topic { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; min-height: 92px; text-align: left; border-radius: 16px; background: var(--panel2); border: 2px solid transparent; }
.topic .e { font-size: 30px; line-height: 1; } .topic b { font-size: 16px; line-height: 1.15; } .topic small { color: var(--dim); font-size: 12px; }
.topic.on { border-color: var(--tc, var(--accent)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tc, var(--accent)) 25%, transparent); }
.topic.on::after { content: "✓"; position: absolute; top: 8px; right: 10px; color: var(--tc, var(--accent)); font-weight: 900; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field { display: block; } .field span { display: block; margin: 0 0 6px 2px; color: var(--dim); font-size: 13px; }
.inp { width: 100%; min-height: 48px; padding: 0 14px; border-radius: 14px; background: var(--panel2); border: 1px solid var(--line); font-size: 18px; outline: none; }
.inp:focus { border-color: var(--accent); }
textarea.inp { padding: 12px 14px; min-height: 140px; resize: vertical; line-height: 1.35; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.stepper { display: flex; align-items: center; gap: 10px; } .stepper b { min-width: 34px; text-align: center; font-size: 22px; }
.hint { margin: 10px 0 0; color: var(--dim); font-size: 13px; line-height: 1.4; }
.seg { display: flex; background: var(--panel2); border: 1px solid var(--line); border-radius: 14px; padding: 4px; gap: 4px; }
.seg button { flex: 1; min-height: 40px; border-radius: 10px; background: transparent; font-size: 14px; font-weight: 700; color: var(--dim); }
.seg button.on { background: var(--accent); color: #101400; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.switch button { width: 54px; height: 32px; border-radius: 16px; background: var(--line); position: relative; transition: background .15s; }
.switch button::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch button.on { background: var(--accent); } .switch button.on::after { transform: translateX(22px); }
.status { font-size: 12px; color: var(--dim); line-height: 1.5; } .status b { color: var(--text); } .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--dim); } .dot.ok { background: var(--good); } .dot.warn { background: #ffc857; }
.score { display: flex; justify-content: space-between; padding: 6px 2px; border-bottom: 1px solid var(--line); } .score:last-child { border-bottom: 0; }
.start-wrap { position: sticky; bottom: 0; padding: 12px 0 calc(var(--safe-b) + 4px); background: linear-gradient(to top, var(--bg) 70%, transparent); }

/* ================================================================ GAME */
.game { background: radial-gradient(120% 60% at 50% 0%, color-mix(in srgb, var(--accent) 14%, #0d0f14) 0%, var(--bg) 60%); max-width: 560px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.round { font-size: 15px; font-weight: 800; color: var(--dim); text-align: center; flex: 1; } .round b { color: var(--text); }
.gtitle { margin: 6px 0 0; text-align: center; font-size: clamp(30px, 9.5vw, 46px); line-height: 1.02; font-weight: 900; color: var(--accent); display: flex; align-items: center; justify-content: center; gap: 10px; }
.gtitle .bars { font-size: .7em; filter: drop-shadow(0 2px 0 #000); }
.gsub { margin: 2px 0 8px; text-align: center; font-size: 17px; font-weight: 800; color: #fff; }
.budgets { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: center; font-size: clamp(20px, 6.4vw, 28px); font-weight: 900; color: #fff; margin-top: 4px; }
.budgets b { color: var(--money); } .budgets .low b { color: #ffb347; } .budgets .zero b { color: var(--bad); }
.players { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.pcol { background: var(--panel); border: 2px solid var(--line); border-radius: 18px; padding: 10px; transition: border-color .15s, box-shadow .15s; }
.pcol.lead { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent), 0 0 26px color-mix(in srgb, var(--accent) 30%, transparent); }
.pname { width: 100%; min-height: 40px; padding: 0 6px; background: transparent; border: 0; border-bottom: 2px dashed var(--line); font-size: 20px; font-weight: 900; text-align: center; outline: none; border-radius: 0; text-overflow: ellipsis; }
.pname:focus { border-bottom-color: var(--accent); }
.bidbox { display: flex; align-items: center; gap: 4px; margin-top: 8px; background: var(--panel2); border: 2px solid var(--line); border-radius: 14px; padding: 0 8px; }
.bidbox:focus-within { border-color: var(--accent); }
.bidbox .cur { color: var(--money); font-size: 26px; font-weight: 900; }
.bid { flex: 1; min-width: 0; width: 100%; height: 56px; background: transparent; border: 0; outline: none; font-size: 30px; font-weight: 900; text-align: left; }
.bid::placeholder { color: #566; }
.bidbox.bad { border-color: var(--bad); } .bidbox.bad .bid { color: var(--bad); }
.quick { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin-top: 8px; }
.quick button { min-height: 40px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line); font-size: 16px; font-weight: 900; }
.quick button:active { background: var(--accent); color: #101400; }
.perr { min-height: 18px; margin-top: 6px; color: var(--bad); font-size: 12px; font-weight: 700; text-align: center; line-height: 1.25; }
.stage { position: relative; display: flex; flex-direction: column; align-items: center; margin: 10px 0 4px; }
.bignum { font-size: clamp(54px, 18vw, 84px); line-height: 1; font-weight: 900; color: #fff; min-height: 1em; transition: transform .12s; }
.bignum.pop { animation: pop .22s ease; }
.stage[data-leader="0"] .bignum { color: var(--accent); } .stage[data-leader="1"] .bignum { color: var(--accent); } .stage[data-leader="-1"] .bignum { color: #ffb347; }
.leadtag { height: 20px; font-size: 14px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.photo { position: relative; width: clamp(150px, 46vw, 220px); aspect-ratio: 1; border-radius: 20px; overflow: hidden; background: linear-gradient(135deg, var(--panel2), var(--panel)); border: 3px solid #fff; box-shadow: 0 10px 30px rgba(0,0,0,.45); }
.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; animation: fade .3s ease; z-index: 1; }
.photo .emoji { position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(70px, 24vw, 110px); }
.photo.loading::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.14) 50%, transparent 70%); background-size: 220% 100%; animation: shimmer 1.2s linear infinite; }
.swap { z-index: 2; position: absolute; right: 6px; bottom: 6px; width: 38px; height: 38px; border-radius: 50%; background: rgba(0,0,0,.62); font-size: 17px; }
.iname { margin-top: 10px; font-size: clamp(24px, 7.5vw, 32px); font-weight: 900; text-align: center; color: #fff; line-height: 1.1; }
.credit { margin-top: 4px; min-height: 16px; font-size: 11px; color: var(--dim); text-align: center; max-width: 90%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .credit a { color: var(--dim); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.actions .btn { flex: 1 1 0; min-width: 140px; }
.actions .sold { flex: 1 1 100%; min-height: 66px; font-size: 22px; border-radius: 20px; background: var(--accent); color: #101400; font-weight: 900; box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 30%, transparent); }
.actions .sold:disabled { background: var(--panel2); color: var(--dim); box-shadow: none; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.tile { position: relative; aspect-ratio: 1 / 1.12; border-radius: 18px; overflow: hidden; background: linear-gradient(160deg, #2a2f3b, #14171e); border: 3px solid #fff; box-shadow: 0 8px 22px rgba(0,0,0,.4); cursor: pointer; padding: 0; text-align: left; width: 100%; }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: fade .5s ease; }
.tile .label { position: absolute; left: 0; right: 0; top: 0; padding: 7px 10px; font-size: 14px; font-weight: 900; background: linear-gradient(to bottom, rgba(0,0,0,.7), transparent); z-index: 2; }
.tile .badge { position: absolute; left: 8px; bottom: 8px; right: 8px; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12px; font-weight: 800; }
.tile .badge span { background: rgba(0,0,0,.68); padding: 4px 8px; border-radius: 999px; }
.tile .busy { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; background: rgba(8,10,14,.5); font-size: 13px; font-weight: 800; text-align: center; padding: 10px; }
.tile .busy i { display: block; width: 26px; height: 26px; margin: 0 auto 8px; border-radius: 50%; border: 3px solid rgba(255,255,255,.25); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.tile.got { animation: got .5s ease; }
.tcard { position: absolute; inset: 0; padding: 34px 10px 36px; display: flex; flex-direction: column; justify-content: center; gap: 8px; background: radial-gradient(90% 70% at 50% 20%, color-mix(in srgb, var(--accent) 22%, #1d212b), #12151b); }
.tcard .emojis { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 6px; font-size: 34px; line-height: 1.1; }
.tcard .names { text-align: center; font-size: 12px; line-height: 1.35; color: #dfe5f2; font-weight: 800; }
.tcard .empty { text-align: center; color: var(--dim); font-size: 13px; font-weight: 800; } .tcard .ebig { font-size: 54px; opacity: .45; margin-bottom: 6px; }
.tcard.big .emojis { font-size: 54px; } .tcard.big .names { font-size: 16px; } .tcard.big { padding: 48px 18px 20px; }
.lists { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.list { display: flex; flex-direction: column; gap: 6px; }
.got-item { display: flex; justify-content: space-between; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px 9px; font-size: 13px; font-weight: 800; } .got-item i { font-style: normal; color: var(--money); }
.flyer { position: fixed; z-index: 90; pointer-events: none; border-radius: 16px; overflow: hidden; border: 3px solid #fff; display: grid; place-items: center; background: var(--panel2); font-size: 64px; transform-origin: center; }
.flyer img { width: 100%; height: 100%; object-fit: cover; }
.stamp { position: fixed; z-index: 95; left: 50%; top: 34%; transform: translate(-50%, -50%) rotate(-8deg); pointer-events: none; text-align: center; padding: 8px 26px 12px; border: 6px solid var(--accent); border-radius: 18px; color: var(--accent); font-size: 70px; font-weight: 900; letter-spacing: .04em; background: rgba(8,10,14,.82); animation: stamp 1.3s ease forwards; }
.stamp small { display: block; font-size: 24px; color: #fff; letter-spacing: 0; margin-top: -4px; }
.confetti { position: fixed; top: -30px; z-index: 96; pointer-events: none; font-size: 26px; animation: fall linear forwards; }

/* ================================================================ OVERLAYS */
.modal { position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-end; justify-content: center; background: rgba(4,6,10,.72); animation: fade .15s ease; }
.modal .sheet { width: 100%; max-width: 560px; max-height: 92dvh; overflow: auto; background: var(--panel); border-radius: 24px 24px 0 0; border: 1px solid var(--line); padding: 18px 16px calc(var(--safe-b) + 18px); animation: up .2s ease; }
.modal.center { align-items: center; padding: 16px; } .modal.center .sheet { border-radius: 24px; }
.sheet h3 { margin: 0 0 10px; font-size: 22px; } .sheet .btns { display: grid; gap: 10px; margin-top: 14px; }
.bigimg { position: relative; aspect-ratio: 1 / 1.05; border-radius: 18px; overflow: hidden; border: 3px solid #fff; background: #12151b; } .bigimg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vlist { margin-top: 12px; display: grid; gap: 6px; }
.crown { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .crown .tie { grid-column: 1 / -1; }
.results .rtiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; } .rcol h3 { margin: 0 0 8px; font-size: 22px; text-align: center; } .rcol .meta { text-align: center; font-size: 13px; color: var(--dim); margin: 8px 0; }
.winner-banner { text-align: center; font-size: 34px; font-weight: 900; color: var(--accent); margin: 14px 0 0; }
#toast { position: fixed; left: 50%; bottom: calc(var(--safe-b) + 22px); transform: translateX(-50%); z-index: 120; max-width: min(92vw, 460px); padding: 12px 18px; border-radius: 14px; background: #fff; color: #111; font-size: 15px; font-weight: 800; box-shadow: 0 8px 30px rgba(0,0,0,.5); text-align: center; animation: up .2s ease; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pop { 0% { transform: scale(.85); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -220% 0; } }
@keyframes got { 0% { transform: scale(1); } 35% { transform: scale(1.05); } 100% { transform: scale(1); } }
@keyframes stamp { 0% { transform: translate(-50%, -50%) rotate(-8deg) scale(2.4); opacity: 0; } 22% { transform: translate(-50%, -50%) rotate(-8deg) scale(1); opacity: 1; } 78% { opacity: 1; } 100% { transform: translate(-50%, -50%) rotate(-8deg) scale(1); opacity: 0; } }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
@media (min-width: 900px) { .screen { padding-top: 24px; } body { background: radial-gradient(80% 60% at 50% 0%, #1b2030, var(--bg)); } }

/* ================================================================ iPAD AND OTHER BIG SCREENS
   On a phone everything is one column, like the video. From 700px wide (iPad portrait and up) the two players move to the sides and the
   item, the big bid number and the SOLD button sit in the middle, so a bid can be typed with the item in view and nothing needs scrolling. */
@media (min-width: 700px) {
  .screen { max-width: 880px; padding-left: 28px; padding-right: 28px; }
  .setup .topics { grid-template-columns: repeat(4, 1fr); }
  .setup .logo h1 { font-size: 60px; }
  .card { padding: 20px; border-radius: 22px; }
  .topic { min-height: 104px; } .topic b { font-size: 17px; }
  .btn { min-height: 52px; font-size: 17px; }

  .screen.game:not(.results) { max-width: 1180px; display: grid; align-content: start; column-gap: 22px;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 1.1fr) minmax(0, 1fr);
    grid-template-areas: "top top top" "title title title" "sub sub sub" "b0 stage b1" "p0 stage p1" "p0 actions p1" "tiles tiles tiles" "lists lists lists"; }
  .area-top { grid-area: top; } .area-title { grid-area: title; } .area-sub { grid-area: sub; } .area-stage { grid-area: stage; } .area-actions { grid-area: actions; } .area-tiles { grid-area: tiles; } .area-lists { grid-area: lists; }
  .budgets, .players { display: contents; }
  .bud.b0 { grid-area: b0; } .bud.b1 { grid-area: b1; } .pcol.p0 { grid-area: p0; } .pcol.p1 { grid-area: p1; }
  .bud { align-self: end; font-size: clamp(26px, 3.4vw, 36px); }
  .gtitle { font-size: clamp(44px, 6vw, 64px); } .gsub { font-size: 22px; margin-bottom: 14px; }
  .pcol { padding: 16px; align-self: start; border-radius: 22px; margin-top: 8px; } .pname { font-size: 26px; min-height: 52px; }
  .bid { height: 72px; font-size: 40px; } .bidbox .cur { font-size: 34px; } .bidbox { border-radius: 16px; margin-top: 12px; }
  .quick button { min-height: 56px; font-size: 20px; } .quick { gap: 10px; margin-top: 12px; }
  .perr { font-size: 14px; min-height: 22px; }
  .stage { margin-top: 0; justify-content: flex-start; } .bignum { font-size: clamp(84px, 11vw, 120px); } .leadtag { font-size: 17px; height: 24px; }
  .photo { width: clamp(220px, 28vw, 300px); } .iname { font-size: clamp(30px, 3.6vw, 42px); }
  .actions { margin-top: 8px; align-self: start; } .actions .sold { min-height: 78px; font-size: 26px; }
  .tiles { max-width: 820px; width: 100%; margin: 26px auto 0; gap: 18px; } .lists { max-width: 820px; width: 100%; margin: 14px auto 0; gap: 18px; } .got-item { font-size: 15px; padding: 8px 12px; }
  .tile .label { font-size: 17px; padding: 10px 14px; } .tile .badge { font-size: 14px; } .tcard .emojis { font-size: 46px; } .tcard .names { font-size: 15px; }
  .modal { align-items: center; padding: 20px; } .modal .sheet { border-radius: 26px; max-width: 620px; }
  .results .rtiles { gap: 22px; } .screen.results { max-width: 980px; }
}
/* a short wide screen (iPad on its side): keep the title compact so the auction fits without scrolling */
@media (min-width: 700px) and (max-height: 860px) {
  .gtitle { font-size: 44px; margin-top: 0; } .gsub { margin-bottom: 4px; font-size: 18px; }
  .photo { width: clamp(180px, 22vw, 230px); } .bignum { font-size: 92px; } .bid { height: 62px; }
}
