/* JonesBox "board game box" theme: TV lobby, in-game TV screens and phones.
   Layered over style.css; delete the <link> in host.html and play.html to go back to the original look.
   Sizes are in vw so the 1920x1080 design scales to any TV. ES5-era browsers: no gap on flex, no color-mix. */

@font-face { font-family: 'Archivo Black'; font-weight: 400; src: url(fonts/archivo-black-latin-400-normal.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Archivo'; font-weight: 400; src: url(fonts/archivo-latin-400-normal.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Archivo'; font-weight: 600; src: url(fonts/archivo-latin-600-normal.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Archivo'; font-weight: 700; src: url(fonts/archivo-latin-700-normal.woff2) format('woff2'); font-display: swap; }

body.host.in-lobby {
  --wall: #2b2019; --plank: #271d16; --wood: #a0683c; --wood-dark: #6e4425;
  --paper: #f6ecd9; --ink: #2b2019; --tan: #e8c89a; --rule: #6b513d;
  font-family: 'Archivo', system-ui, sans-serif;
  color: #f6ecd9;
  background: #2b2019 repeating-linear-gradient(90deg, #2b2019 0, #2b2019 12.4vw, #271d16 12.4vw, #271d16 12.5vw);
}
body.in-lobby .h-top { display: none; }
body.in-lobby .h-wrap { padding: 2.6vw 4.2vw 2.2vw; }
body.in-lobby .h-main { flex-direction: column; gap: 0; }
body.in-lobby .h-main > * + * { margin-top: 1.4vw; }

/* ---------- top row: stamp logo, name tags, join card ---------- */
.box-top { display: flex; align-items: flex-start; flex-shrink: 0; }
.stamp {
  flex-shrink: 0; font-family: 'Archivo Black', sans-serif; font-size: 3.75vw; line-height: .9; letter-spacing: -.05vw;
  color: #f6ecd9; padding: .85vw 1.35vw .75vw; border: .31vw solid #f6ecd9; border-radius: .52vw;
  -webkit-transform: rotate(-2deg); transform: rotate(-2deg); margin-top: .3vw;
}
.stamp span { display: block; font-family: 'Archivo', sans-serif; font-weight: 700; font-size: 1.04vw; letter-spacing: .03vw; margin-top: .42vw; color: #e8c89a; }

.who { flex: 1; min-width: 0; margin: 0 2.2vw 0 2.6vw; }
.who h2 { font-weight: 600; font-size: 1.46vw; margin: 0 0 .75vw; color: #e8c89a; }
.ntags { display: flex; flex-wrap: wrap; margin: -.45vw; }
.ntag {
  display: block; margin: .45vw; background: #f6ecd9; color: #2b2019; border-radius: .52vw; overflow: hidden;
  min-width: 9.4vw; max-width: 15vw; box-shadow: 0 .31vw 0 rgba(0, 0, 0, .35);
}
.ntag i { display: block; color: #fff; font-style: normal; font-weight: 700; font-size: .78vw; padding: .3vw .73vw; letter-spacing: .02vw; }
.ntag b { display: block; font-family: 'Archivo Black', sans-serif; font-weight: 400; font-size: 1.77vw; padding: .4vw .73vw .5vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ntag.off { opacity: .45; }
/* more people, smaller stickers */
.ntags.many .ntag { min-width: 7vw; margin: .3vw; }
.ntags.many .ntag i { font-size: .62vw; padding: .2vw .55vw; }
.ntags.many .ntag b { font-size: 1.3vw; padding: .25vw .55vw .3vw; }
.ntags.lots .ntag i { display: none; }
.ntags.lots .ntag { border-top: .4vw solid #6b513d; min-width: 0; }
.ntags.lots .ntag b { font-size: 1.1vw; }
.ntag-empty { margin: .45vw; font-size: 1.25vw; color: #e8c89a; }
/* teams mode keeps the original columns, on paper */
body.in-lobby .who .players.teams .teamcol { background: #f6ecd9; color: #2b2019; }
body.in-lobby .who .players.teams .chip { background: transparent; color: #2b2019; }

.joincard {
  flex-shrink: 0; display: flex; align-items: center; background: #f6ecd9; color: #2b2019;
  padding: .95vw; border-radius: .73vw; box-shadow: 0 .42vw 0 rgba(0, 0, 0, .35);
  -webkit-transform: rotate(1.5deg); transform: rotate(1.5deg);
}
.joincard img { width: 9.9vw; height: 9.9vw; display: block; margin-right: 1.15vw; border-radius: .3vw; }
.jc-text { width: 14.6vw; }
.jc-text small { display: block; font-weight: 600; font-size: 1.04vw; }
.jc-text strong { display: block; font-family: 'Archivo Black', sans-serif; font-weight: 400; font-size: 3.65vw; letter-spacing: .3vw; line-height: 1; }
.jc-text p { margin: .42vw 0 0; font-size: .89vw; line-height: 1.35; }
.jc-text p b { white-space: nowrap; }

/* ---------- shelf tabs ---------- */
.shelf-tabs { display: flex; align-items: baseline; flex-shrink: 0; padding-left: 1.5vw; }
.stab {
  background: none; border: 0; color: #e8c89a; font-family: 'Archivo', sans-serif; font-weight: 700; font-size: 1.25vw;
  padding: .3vw .7vw; margin-right: .6vw; border-radius: .4vw; cursor: pointer;
}
.stab.on { color: #f6ecd9; font-family: 'Archivo Black', sans-serif; font-weight: 400; font-size: 1.6vw; }
.stab:focus, .stab:hover { outline: .2vw solid #f6ecd9; outline-offset: .1vw; }
.shelf-sub { margin-left: auto; font-size: 1.04vw; color: #b8987a; }

/* ---------- the shelf of boxes ---------- */
.shelf { position: relative; flex: 1; min-height: 0; }
.gbox-row {
  /* sized to show exactly five boxes: .7vw lead-in + 5 x (16vw box + 1.7vw gap) - .5vw, so no neighbour peeks in */
  position: absolute; left: 50%; width: 88.7vw; margin-left: -44.35vw; top: 0; bottom: 2vw;
  display: flex; align-items: flex-end; overflow: hidden;
  padding: 3vw 0 0 .7vw;   /* room above for the lifted box */
}
.shelf-board {
  position: absolute; left: 0; right: 0; bottom: 0; height: 3vw; border-radius: .2vw;
  background: linear-gradient(#a0683c, #6e4425);
  box-shadow: 0 .95vw 1.6vw rgba(0, 0, 0, .5), inset 0 .21vw 0 rgba(255, 255, 255, .18);
}
/* the row sits behind the board's front edge */
.gbox-row { bottom: 2.4vw; }
.shelf.more-r:after, .shelf.more-l:before {
  position: absolute; bottom: .55vw; z-index: 2; font-weight: 700; font-size: 1.04vw; color: #f6ecd9;
}
.shelf.more-r:after { content: 'more ►'; right: 1.2vw; }
.shelf.more-l:before { content: '◄ more'; left: 1.2vw; }

.gbox {
  position: relative; flex: 0 0 auto; width: 16vw; height: 100%; max-height: 24vw; margin-right: 1.7vw;
  border: 0; border-radius: .42vw .42vw .2vw .2vw; color: #2b2019; text-align: left; cursor: pointer;
  padding: 2.3vw 1.35vw 1.4vw; overflow: hidden;
  display: flex; flex-direction: column;
  font-family: 'Archivo', sans-serif;
  box-shadow: inset 0 -.73vw 0 rgba(0, 0, 0, .14), inset 0 1.15vw 0 rgba(255, 255, 255, .18),
    .52vw 0 0 var(--side, #6b513d), .52vw .52vw 1.6vw rgba(0, 0, 0, .45);
  -webkit-transition: -webkit-transform .18s ease-out, box-shadow .18s ease-out; transition: transform .18s ease-out, box-shadow .18s ease-out;
}
.gbox:last-child { margin-right: 1.1vw; }
/* printed patterns on the box face */
.gbox:before { content: ''; position: absolute; left: 0; top: 0; right: 0; bottom: 0; opacity: .2; pointer-events: none; }
.pat-stripes:before { background: repeating-linear-gradient(45deg, #000 0, #000 .52vw, transparent .52vw, transparent 1.46vw); }
.pat-dots:before { background: radial-gradient(circle, #000 0, #000 .26vw, transparent .31vw) 0 0 / 1.56vw 1.56vw; }
.pat-pins:before { background: repeating-linear-gradient(-45deg, #000 0, #000 .21vw, transparent .21vw, transparent .83vw); }
.pat-bars:before { background: repeating-linear-gradient(0deg, #000 0, #000 .31vw, transparent .31vw, transparent 1.15vw); }
.pat-checks:before { background: linear-gradient(45deg, #000 25%, transparent 25%, transparent 75%, #000 75%) 0 0 / 1.9vw 1.9vw,
  linear-gradient(45deg, #000 25%, transparent 25%, transparent 75%, #000 75%) .95vw .95vw / 1.9vw 1.9vw; }
.gb-lid { position: absolute; left: 0; right: 0; top: 0; height: 1.15vw; border-bottom: .16vw solid rgba(0, 0, 0, .18); }
.gb-badge {
  position: absolute; left: 1.25vw; top: 1.75vw; background: #2b2019; color: #f6ecd9; border-radius: 3vw;
  padding: .3vw .75vw; font-weight: 700; font-size: .7vw; white-space: nowrap;
}
.gb-badge b { font-family: 'Archivo Black', sans-serif; font-weight: 400; font-size: 1.1vw; }
.gb-icon { position: absolute; right: 1vw; top: 1.6vw; font-size: 2.2vw; line-height: 1; }
.gb-name {
  position: relative; display: block; margin-top: 2.8vw; font-family: 'Archivo Black', sans-serif; font-weight: 400;
  font-size: 2.3vw; line-height: .98; letter-spacing: -.03vw;
}
.gb-label {
  position: relative; display: block; margin-top: auto; background: #f6ecd9; border-radius: .31vw; padding: .65vw .8vw .75vw;
}
.gb-tag { display: block; font-weight: 700; font-size: .78vw; color: #8a5a35; margin-bottom: .25vw; }
.gb-text { display: block; font-weight: 600; font-size: .98vw; line-height: 1.3; }

.gbox:focus, .gbox:hover {
  outline: none;
  -webkit-transform: translateY(-2.3vw) rotate(-2.5deg); transform: translateY(-2.3vw) rotate(-2.5deg);
  box-shadow: inset 0 -.73vw 0 rgba(0, 0, 0, .14), inset 0 1.15vw 0 rgba(255, 255, 255, .18),
    .52vw 0 0 var(--side, #6b513d), 0 0 0 .31vw #f6ecd9, .95vw 1.6vw 2.6vw rgba(0, 0, 0, .6);
}
/* boxes that can't be played yet stay on the shelf, faded, with the reason on the label */
.gbox.locked { cursor: default; opacity: .55; -webkit-filter: saturate(.35); filter: saturate(.35); }
.gbox[disabled]:hover { -webkit-transform: none; transform: none; }
.gbox.locked .gb-tag { color: #a8322e; }
.gbox[disabled] { cursor: default; }

/* ---------- footer ---------- */
.box-foot { display: flex; align-items: center; flex-shrink: 0; font-size: 1.25vw; color: #e8c89a; }
.box-foot b { color: #f6ecd9; }
.bf-btns { margin-left: auto; display: flex; }
body.in-lobby .box-foot .btn {
  margin-left: .75vw; background: transparent; color: #f6ecd9; font-family: 'Archivo', sans-serif; font-weight: 700; font-size: 1.04vw;
  padding: .52vw .95vw; border: .1vw solid #6b513d; border-radius: .52vw;
}
body.in-lobby .box-foot .btn:focus, body.in-lobby .box-foot .btn:hover { border-color: #f6ecd9; background: rgba(246, 236, 217, .08); -webkit-transform: none; transform: none; }

/* clear-players view keeps its own layout */
.box-clear { flex: 1; min-height: 0; display: flex; }
.box-clear > * { flex: 1; }

@media (prefers-reduced-motion: reduce) { .gbox { -webkit-transition: none; transition: none; } }

/* =====================================================================
   In-game TV screens and phones: the same closet, game in progress.
   Colours go through style.css's variables, so every game (Party Pack
   included) picks up the warm palette; a few shared pieces become paper.
   ===================================================================== */
body.host, body.play {
  --bg: #2b2019; --panel: #3b2c22; --panel2: #4b3829;
  --text: #f6ecd9; --muted: #c9ab8b; --accent: #d9482f; --gold: #f2c14c;
  --paper: #f6ecd9; --ink: #2b2019;
  font-family: 'Archivo', system-ui, sans-serif;
}
body.host {
  background: #2b2019 repeating-linear-gradient(90deg, #2b2019 0, #2b2019 12.4vw, #271d16 12.4vw, #271d16 12.5vw);
}
body.host h1.big, body.host .big, body.host .timer { font-family: 'Archivo Black', sans-serif; font-weight: 400; letter-spacing: -.02em; }
body.host .timer { color: #f6ecd9; }
body.host .timer.low { color: #ff8a6b; }

/* header: small stamp logo and the room code on a paper tag */
body.host .brand {
  font-family: 'Archivo Black', sans-serif; font-weight: 400; letter-spacing: 0; font-size: 1.9vw; line-height: 1;
  padding: .45vw .8vw .4vw; border: .21vw solid #f6ecd9; border-radius: .35vw; color: #f6ecd9;
  -webkit-transform: rotate(-2deg); transform: rotate(-2deg);
}
body.host .brand b { color: inherit; }
body.host .h-code {
  background: #f6ecd9; color: #2b2019; padding: .45vw 1vw; border-radius: .42vw; font-weight: 600; font-size: 1.1vw;
  box-shadow: 0 .26vw 0 rgba(0, 0, 0, .35); -webkit-transform: rotate(1.5deg); transform: rotate(1.5deg);
}
body.host .h-code b { color: #2b2019; font-family: 'Archivo Black', sans-serif; font-weight: 400; font-size: 1.6vw; letter-spacing: .12em; }

/* step pills (Write, Vote, Results) */
body.host .dd-step span { background: rgba(246, 236, 217, .1); color: #f6ecd9; font-family: 'Archivo', sans-serif; }
body.host .dd-step span.on { background: #f6ecd9; color: #2b2019; }

/* paper: prompts, answer cards and scoreboard rows */
body.host .q-text { background: #f6ecd9; color: #2b2019; font-weight: 600; box-shadow: 0 .31vw 0 rgba(0, 0, 0, .3); }
body.host .cb-card {
  background: #f6ecd9; color: #2b2019; border-radius: .5vw; box-shadow: 0 .42vw 0 rgba(0, 0, 0, .35);
}
body.host .cb-answers .cb-card:nth-child(3n+1) { -webkit-transform: rotate(-1deg); transform: rotate(-1deg); }
body.host .cb-answers .cb-card:nth-child(3n+2) { -webkit-transform: rotate(.8deg); transform: rotate(.8deg); }
body.host .cb-answers .cb-card:nth-child(3n) { -webkit-transform: rotate(-.5deg); transform: rotate(-.5deg); }
body.host .cb-text { font-family: 'Archivo Black', sans-serif; font-weight: 400 !important; }
body.host .cb-sym { color: #8a5a35; font-family: 'Archivo Black', sans-serif; font-weight: 400; }
body.host .cb-card.won { outline: .35vw solid #f2c14c; }
body.host .cb-flag { background: #d9482f; color: #fff; font-family: 'Archivo Black', sans-serif; font-weight: 400; }
body.host .cb-flag.win { background: #f2c14c; color: #2b2019; }
body.host .cb-by .pts { color: #b5651d; }
body.host .row { background: #f6ecd9; color: #2b2019; border-radius: .42vw; box-shadow: 0 .26vw 0 rgba(0, 0, 0, .3); }
body.host .row .pts { font-family: 'Archivo Black', sans-serif; font-weight: 400; }
body.host .row.done { outline-color: #4caf6e; }
body.host .dd-row, body.host .dd-chip { background: rgba(246, 236, 217, .1); }
body.host .panel { background: #3b2c22; box-shadow: 0 .42vw 0 rgba(0, 0, 0, .35); }
/* player chips become mini name tags */
body.host:not(.in-lobby) .chip { background: #f6ecd9; color: #2b2019; border-radius: .42vw; box-shadow: 0 .21vw 0 rgba(0, 0, 0, .3); }
body.host:not(.in-lobby) .chip.off { opacity: .4; }
/* buttons */
body.host:not(.in-lobby) .btn { background: transparent; border: .1vw solid #6b513d; color: #f6ecd9; font-weight: 700; }
body.host:not(.in-lobby) .btn.primary { background: #d9482f; border-color: #d9482f; }
body.host:not(.in-lobby) .btn:focus, body.host:not(.in-lobby) .btn:hover { border-color: #f6ecd9; }
body.host .spinner { border-color: #4b3829; border-top-color: #f6ecd9; }

/* ---------- phones ---------- */
body.play { background: #2b2019; }
body.play .p-head .brand {
  font-family: 'Archivo Black', sans-serif; font-weight: 400; letter-spacing: 0; font-size: 17px; line-height: 1;
  padding: 5px 9px 4px; border: 3px solid #f6ecd9; border-radius: 5px; -webkit-transform: rotate(-2deg); transform: rotate(-2deg);
}
body.play .p-head .brand b { color: inherit; }
body.play h1, body.play h2, body.play .pprompt { font-family: 'Archivo Black', sans-serif; font-weight: 400; }
body.play .card { background: #f6ecd9; color: #2b2019; border-radius: 10px; box-shadow: 0 5px 0 rgba(0, 0, 0, .35); }
body.play .card .muted { color: #7a5a40; }
body.play .card .pprompt { color: #2b2019; }
body.play textarea.pin, body.play input.pin, body.play input[type=text], body.play input[type=search] {
  background: #fffaf0; color: #2b2019; border: 2px solid #d8c3a3; border-radius: 8px;
}
body.play input:focus, body.play textarea:focus { border-color: #d9482f; }
body.play .pbtn { border-radius: 10px; background: #4b3829; color: #f6ecd9; font-family: 'Archivo', sans-serif; font-weight: 700; }
body.play .card .pbtn { background: #e5d6bd; color: #2b2019; }
body.play .pbtn.primary { background: #d9482f; color: #fff; box-shadow: 0 4px 0 #9e2f1d; }
body.play .pbtn.primary:active { -webkit-transform: translateY(3px); transform: translateY(3px); box-shadow: 0 1px 0 #9e2f1d; }
body.play .pvote { background: #f6ecd9; color: #2b2019; border-radius: 10px; box-shadow: 0 4px 0 rgba(0, 0, 0, .35); font-family: 'Archivo', sans-serif; font-weight: 700; }
body.play .pvote:active { -webkit-transform: translateY(3px); transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, .35); }
body.play .pvote.bg0, body.play .pvote.bg1 { color: #fff; }
/* quiet text sitting on paper needs a darker tone */
body.host .cb-card .muted, body.host .cb-card .hint, body.host .row .muted, body.host .row .hint, body.host .q-text .muted { color: #8a6a50; }
