/* Adjugé ! — salle des ventes : bois sombre, papier crème, dorure. Mobile d'abord ; chaque écran tient dans 100svh
   (CONSTATS E1), seuls la feuille du bas et l'écran de fin défilent. */
:root {
  --wood: #3a1f17; --wood2: #24120d; --paper: #fbf4e6; --paper2: #efe3cb; --ink: #2b1a12; --muted: #8a7766;
  --gold: #d6a447; --gold2: #f2cf7e; --cream: #f6ead4; --plus: #2f8f5b; --moins: #c2453d; --line: rgba(246, 234, 212, .16);
  --safe-b: max(16px, env(safe-area-inset-bottom)); --safe-t: max(10px, env(safe-area-inset-top));
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overscroll-behavior: none; }
body {
  background: radial-gradient(120% 80% at 50% 0%, #4d2a1f 0%, var(--wood) 45%, var(--wood2) 100%) fixed;
  color: var(--cream); font: 16px/1.35 -apple-system, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
}
#app { height: 100svh; max-width: 520px; margin: 0 auto; position: relative; overflow: hidden; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; touch-action: manipulation; }
button:disabled { opacity: .45; cursor: default; }
input { font: inherit; user-select: text; -webkit-user-select: text; }
h1, h2, h3 { font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; font-weight: 700; margin: 0; }
small { font-size: 12px; }

.screen { height: 100%; display: flex; flex-direction: column; padding: var(--safe-t) 16px var(--safe-b); gap: 10px; }
.primary, .secondary {
  min-height: 48px; border-radius: 12px; padding: 10px 16px; font-weight: 700; font-size: 17px; width: 100%;
}
.primary { background: linear-gradient(180deg, var(--gold2), var(--gold)); color: var(--ink); box-shadow: 0 2px 0 #8d6420, 0 6px 18px rgba(0,0,0,.35); }
.primary:active:not(:disabled) { transform: translateY(1px); box-shadow: 0 1px 0 #8d6420; }
.secondary { background: rgba(246,234,212,.08); border: 1px solid var(--line); }
.link { color: var(--gold2); text-decoration: underline; min-height: 44px; }
.hint, .small { color: #d9c8ad; font-size: 14px; margin: 0; }
.small b { color: var(--cream); }
.notice { background: rgba(194,69,61,.2); border: 1px solid rgba(194,69,61,.5); padding: 10px 12px; border-radius: 10px; margin: 0; }
.tip { margin: 0; font-size: 14px; background: rgba(214,164,71,.14); border-left: 3px solid var(--gold); padding: 8px 10px; border-radius: 6px; color: var(--cream); }
.gold { color: var(--gold2); }
.chip { min-height: 36px; min-width: 44px; padding: 6px 10px; border-radius: 18px; border: 1px solid var(--line); background: rgba(246,234,212,.06); font-size: 14px; }
.chip.on { background: var(--gold); color: var(--ink); border-color: var(--gold); font-weight: 700; }
.chip.static { display: inline-block; min-height: 0; padding: 2px 8px; margin: 2px; font-size: 13px; }
.chip.plus.on { background: var(--plus); border-color: var(--plus); color: #fff; }
.chip.moins.on { background: var(--moins); border-color: var(--moins); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.row { display: flex; gap: 8px; align-items: center; }
.row2 { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 8px; }
.row2 .primary, .row2 .secondary { font-size: 15px; padding: 8px; }

/* Home */
.home { justify-content: center; gap: 14px; }
.brand { text-align: center; margin-bottom: 8px; }
.brand h1 { font-size: 46px; color: var(--gold2); text-shadow: 0 2px 0 #6b3d14, 0 8px 24px rgba(0,0,0,.5); letter-spacing: .5px; }
.brand p { margin: 6px 0 0; color: #e3d2b5; }
.gavel { width: 64px; height: 64px; margin: 0 auto 6px; background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cg transform='rotate(-35 32 32)'%3E%3Crect x='14' y='10' width='30' height='16' rx='4' fill='%23f2cf7e' stroke='%238d6420' stroke-width='2'/%3E%3Crect x='26' y='26' width='6' height='30' rx='3' fill='%23b07a35'/%3E%3C/g%3E%3Crect x='8' y='52' width='30' height='6' rx='3' fill='%238d6420'/%3E%3C/svg%3E"); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field span { font-size: 14px; color: #d9c8ad; }
.field input { min-height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); padding: 0 14px; font-size: 18px; }

/* Lobby */
.lobby { align-items: stretch; overflow-y: auto; }
.lobby h2 { text-align: center; color: var(--gold2); font-size: 28px; }
.qr { width: min(62vw, 240px); margin: 0 auto; background: var(--paper); padding: 8px; border-radius: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.qr svg { display: block; width: 100%; height: auto; }
.players { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.players li { background: rgba(246,234,212,.1); border: 1px solid var(--line); padding: 6px 12px; border-radius: 16px; }
.players li.away { opacity: .5; }
.players small { color: var(--gold2); }
.tempo { justify-content: center; }

/* Game */
.game { gap: 6px; padding-bottom: 0; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; }
.purse { display: flex; align-items: center; gap: 6px; font-size: 22px; }
.coin { display: inline-block; width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff2c2, var(--gold) 55%, #8d6420); box-shadow: inset 0 0 0 1.5px #8d6420; vertical-align: -3px; }
.turnno { color: #d9c8ad; font-size: 14px; }
.timer { min-width: 52px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--gold2); }
.timer.low { color: #ff8a7a; }
.goals { display: grid; gap: 4px; }
.goal { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 10px; font-size: 14px; background: rgba(246,234,212,.07); }
.goal b { font-size: 18px; text-align: center; }
.goal.plus b { color: #7fe0a6; } .goal.moins b { color: #ff9a8f; }
.goal em { font-style: normal; color: #d9c8ad; font-size: 13px; }
.stage { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; padding-bottom: 8px; }
.say { margin: 0; font-size: 16px; }
.say b { color: var(--gold2); }

.card.big { background: linear-gradient(180deg, var(--paper), var(--paper2)); color: var(--ink); border-radius: 16px; padding: 8px 10px 10px; box-shadow: 0 10px 28px rgba(0,0,0,.45), inset 0 0 0 1px rgba(43,26,18,.12); position: relative; border-top: 10px solid var(--band); }
.card.big .band { position: absolute; top: -2px; right: 12px; width: 44px; height: 44px; border-radius: 0 0 10px 10px; background: var(--band); color: #fff; display: grid; place-items: center; font: 700 26px Georgia, serif; text-shadow: 0 1px 2px rgba(0,0,0,.3); }
.card.back { min-height: 210px; border-top-color: #9a9184; background: repeating-linear-gradient(45deg, #efe3cb 0 10px, #e6d7ba 10px 20px); }
.trait { display: grid; grid-template-columns: auto 74px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 46px; border-bottom: 1px dashed rgba(43,26,18,.15); padding: 2px 4px; border-radius: 8px; }
.trait:last-child { border-bottom: 0; }
.tname { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.tval { font-size: 22px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tval small { font-size: 12px; font-weight: 400; color: var(--muted); width: 100%; margin-top: -4px; }
.trait.hidden .tval { color: #b9ab97; }
.trait.private .tval { opacity: .55; }
.trait.chosen { background: rgba(214,164,71,.28); box-shadow: inset 0 0 0 2px var(--gold); }
.trait.chosen .tval { opacity: 1; }
.lock { font-style: normal; font-size: 11px; color: var(--muted); border: 1px solid rgba(43,26,18,.2); padding: 1px 6px; border-radius: 8px; }
.rank { width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; font-size: 12px; }
.trait[data-action] { cursor: pointer; }
.swatch { width: 20px; height: 20px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(0,0,0,.15); display: inline-block; }

.hints { display: flex; gap: 6px; flex-wrap: wrap; }
.h { font-size: 13px; padding: 3px 9px; border-radius: 12px; background: rgba(246,234,212,.08); }
.h.plus.voui { background: rgba(47,143,91,.35); } .h.moins.voui { background: rgba(194,69,61,.4); }
.h.vq { border: 1px dashed var(--line); }

.bid { display: flex; flex-direction: column; gap: 8px; }
.stepper { display: grid; grid-template-columns: 56px 1fr 56px; align-items: center; }
.stepper button { height: 48px; border-radius: 12px; background: rgba(246,234,212,.12); font-size: 26px; }
.stepper output { text-align: center; font: 700 34px Georgia, serif; color: var(--gold2); }
.ok { color: #9be3b8; }
.who { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; }
.who span { padding: 2px 8px; border-radius: 10px; background: rgba(246,234,212,.06); color: #cdbb9f; }
.who span.done { color: #9be3b8; }

.options { display: grid; gap: 6px; }
.option { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; text-align: left; padding: 8px 12px; min-height: 52px; border-radius: 12px; background: rgba(246,234,212,.07); border: 1px solid var(--line); }
.option.on { background: rgba(214,164,71,.25); border-color: var(--gold); }
.oname { font-weight: 700; } .oname small { color: var(--gold2); font-weight: 400; }
.odetail { grid-column: 1; font-size: 13px; color: #d9c8ad; }
.ogain { grid-column: 2; grid-row: 1 / 3; align-self: center; font: 700 22px Georgia, serif; color: var(--gold2); }

.banner { text-align: center; font: 700 26px "Iowan Old Style", Georgia, serif; color: var(--gold2); padding: 6px; animation: hammer .45s ease-out; }
.banner.me { color: #ffb4a8; }
.banner.big { font-size: 28px; }
@keyframes hammer { 0% { transform: scale(1.4) rotate(-4deg); opacity: 0; } 60% { transform: scale(.96); opacity: 1; } 100% { transform: none; } }
.bids { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.bids li { display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: 6px 10px; border-radius: 10px; background: rgba(246,234,212,.06); font-size: 14px; }
.bids li span { color: #d9c8ad; } .bids li em { grid-column: 2; grid-row: 1 / 3; align-self: center; font-style: normal; color: var(--gold2); }
.bids li.to { box-shadow: inset 0 0 0 2px var(--gold); }

.tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); padding-bottom: var(--safe-b); margin: 0 -16px; background: rgba(0,0,0,.18); }
.tabs button { min-height: 48px; font-size: 14px; color: #e3d2b5; }

.sheet { position: absolute; inset: 18% 0 0 0; background: #2d1812; border-radius: 18px 18px 0 0; box-shadow: 0 -10px 30px rgba(0,0,0,.5); display: flex; flex-direction: column; z-index: 5; }
.sheethead { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 6px; }
.sheethead h3 { color: var(--gold2); }
.close { min-height: 44px; padding: 0 12px; color: var(--gold2); }
.sheetbody { overflow-y: auto; padding: 0 16px var(--safe-b); display: flex; flex-direction: column; gap: 10px; }
.rules .sheetbody p, .rules .sheetbody li { color: #eadbc2; }
.rules .sheethead { padding-left: 0; padding-right: 0; }
.rules .sheetbody { padding: 0; }
b.plus { color: #7fe0a6; } b.moins { color: #ff9a8f; }
.pl { background: rgba(246,234,212,.05); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.pl.me { border-color: rgba(214,164,71,.5); }
.plhead { display: flex; gap: 12px; align-items: center; } .plhead b { flex: 1; }
.minis { display: flex; flex-wrap: wrap; gap: 4px; }
.mini { display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; border-radius: 8px; background: var(--paper); color: var(--ink); font-size: 12px; border-left: 5px solid var(--c); }
.mini .dot { display: none; } .mini .dot.q { display: inline-block; width: 8px; height: 8px; border-radius: 50%; border: 1px dashed var(--muted); }
.mini .mcity { color: var(--muted); }
.standing { display: flex; gap: 6px; flex-wrap: wrap; }
.st { font-size: 12px; padding: 1px 8px; border-radius: 8px; background: rgba(246,234,212,.08); }
.st.plus { color: #9be3b8; } .st.moins { color: #ffb0a6; }
.journal { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.journal li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; background: rgba(246,234,212,.05); padding: 6px 8px; border-radius: 10px; font-size: 14px; }
.journal small { width: 100%; color: #cdbb9f; }
.jn { width: 22px; height: 22px; border-radius: 50%; background: rgba(246,234,212,.12); display: grid; place-items: center; font-size: 12px; }
.ouch { color: #ff9a8f; font-style: normal; }

.end { overflow-y: auto; gap: 10px; }
.end h3 { color: var(--gold2); font-size: 18px; margin-top: 4px; }
.hl { margin: 0; padding-left: 18px; color: #eadbc2; display: grid; gap: 4px; }
.ends { display: grid; gap: 8px; }
.er { background: rgba(246,234,212,.06); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; display: grid; gap: 4px; }
.er.win { border-color: var(--gold); background: rgba(214,164,71,.14); }
.erhead { display: flex; gap: 10px; } .erhead b { flex: 1; font-size: 17px; }
.eo { font-size: 14px; } .eo em { font-style: normal; font-weight: 700; }
.eo.plus > b { color: #7fe0a6; } .eo.moins > b { color: #ff9a8f; }
.eo small { color: #cdbb9f; display: block; }
.det { color: #cdbb9f; }

.conn { position: absolute; top: 0; left: 0; right: 0; z-index: 9; background: #7a2e22; color: #fff; text-align: center; font-size: 13px; padding: calc(var(--safe-t) - 4px) 8px 4px; }
.toast { position: absolute; left: 16px; right: 16px; bottom: calc(var(--safe-b) + 60px); z-index: 10; background: var(--paper); color: var(--ink); padding: 12px 14px; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.5); font-weight: 600; text-align: center; }

@media (max-height: 640px) {
  .trait { min-height: 38px; } .tval { font-size: 19px; } .goal { padding: 3px 8px; font-size: 13px; }
  .card.big .band { width: 38px; height: 38px; font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) { .banner { animation: none; } }

/* Card as a strip (bids, award, result) and the docked action button. */
.card.strip { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, .6fr) minmax(0, .6fr) minmax(0, 1.2fr); gap: 4px; background: linear-gradient(180deg, var(--paper), var(--paper2)); color: var(--ink); border-radius: 12px; border-top: 6px solid var(--band); padding: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.4); }
.cell { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 4px 6px; border-radius: 8px; background: rgba(43,26,18,.04); min-width: 0; }
.cell .tname { font-size: 10px; }
.cval { font-size: 19px; font-weight: 700; display: flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.cval .swatch { width: 14px; height: 14px; flex: none; }
.cell small { font-size: 10px; color: var(--muted); }
.cell.hidden .cval { color: #b9ab97; }
.cell.private { opacity: .62; }
.dock { position: sticky; bottom: 0; padding: 8px 0 4px; background: linear-gradient(180deg, rgba(36,18,13,0), rgba(36,18,13,.95) 30%); margin-top: auto; }
.trait { grid-template-columns: 26px 74px minmax(0, 1fr) auto; }
.lk { font-style: normal; font-size: 9px; } .lkn { color: #cdbb9f; font-size: 12px; }
.goal.bounty { background: rgba(214,164,71,.16); } .goal.bounty b { color: var(--gold2); }
.h.bounty { border: 1px solid rgba(214,164,71,.5); } .h.bounty.voui { background: rgba(214,164,71,.35); }
.news { background: linear-gradient(90deg, rgba(214,164,71,.35), rgba(214,164,71,.12)); border: 1px solid var(--gold); border-radius: 12px; padding: 8px 10px; font-size: 14px; animation: hammer .5s ease-out; }
.news b { color: var(--gold2); display: block; font-size: 16px; }
.eo.bounty > b { color: var(--gold2); }
.er.sealed { color: #8f7d68; font-style: italic; }
.rk { min-width: 30px; font-weight: 700; color: var(--gold2); }
.pop { animation: hammer .45s ease-out; }
/* Small phones (320 x 568, CONSTATS E1): card strip in 2 x 2, tighter bid controls, nothing cut. */
@media (max-width: 360px) {
  .screen { padding-left: 12px; padding-right: 12px; }
  .tabs { margin: 0 -12px; }
  .card.strip { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .cval { font-size: 17px; }
  .stepper { grid-template-columns: 44px 1fr 44px; }
  .stepper button { height: 40px; font-size: 22px; }
  .stepper output { font-size: 28px; }
  .chips { flex-wrap: nowrap; gap: 4px; }
  .chips .chip { min-width: 0; flex: 1; padding: 6px 0; }
  .row2 .primary, .row2 .secondary { font-size: 14px; min-height: 44px; }
  .say { font-size: 15px; }
  .goal { font-size: 13px; padding: 4px 8px; }
}
@media (max-height: 600px) {
  .tip { font-size: 13px; padding: 6px 8px; }
  .bid { gap: 6px; }
  .top { min-height: 30px; }
}
