/* Basic mode: a medieval board-game table. Parchment cards on a dark wood frame, crimson and gold accents. */

#basic, #bmodal, .flyer {
  --wood: #3b2a1a;
  --wood2: #5a3f26;
  --parch: #f1e4c3;
  --parch2: #e3d0a3;
  --ink: #2a1d12;
  --muted: #7a6446;
  --crimson: #8b1e1e;
  --gold: #c99a1e;
  --good: #2f6b2f;
  --bad: #9b1c14;
  --serif: 'Crimson Text', Georgia, serif;
  --display: 'Cinzel', Georgia, serif;
}
#basic {
  display: none;
  height: 100%;
  position: relative;
  font-family: var(--serif);
  font-size: 15px;
  color: var(--ink);
  background: var(--wood) repeating-linear-gradient(92deg, rgba(255, 255, 255, .025) 0 3px, rgba(0, 0, 0, .04) 3px 7px);
}
body.basic-mode #app { display: none; }
body.basic-mode #basic { display: grid; grid-template-columns: minmax(0, 1fr) 312px; grid-template-rows: minmax(0, 1fr) auto; }
#basic .ico { vertical-align: -3px; flex: none; }
#basic h1, #basic h2, #basic h3, #basic h4 { font-family: var(--display); font-weight: 700; letter-spacing: .5px; }
#basic small { color: var(--muted); }
#basic a { color: var(--crimson); cursor: pointer; }
#basic .good { color: var(--good); }
#basic .bad { color: var(--bad); }
#basic .hint, #bmodal .hint { color: var(--muted); font-style: italic; font-size: 14px; }
.center { text-align: center; justify-content: center; }

#basic .card { display: block; text-align: left; box-shadow: 0 3px 0 var(--wood), 0 8px 18px rgba(0, 0, 0, .35); }
.parchment {
  background: var(--parch) radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, .45), transparent 60%);
  border: 2px solid var(--wood);
  border-radius: 6px;
  box-shadow: 0 3px 0 var(--wood), 0 8px 18px rgba(0, 0, 0, .35);
  color: var(--ink);
}

/* Buttons */
.bbtn {
  font-family: var(--display); font-weight: 700; font-size: 13px; letter-spacing: .3px;
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; cursor: pointer;
  color: var(--ink); background: linear-gradient(#f8ecca, #dcc38c); border: 2px solid var(--wood); border-radius: 7px;
  box-shadow: 0 3px 0 var(--wood); transition: transform .05s, filter .1s;
}
.bbtn:hover:not(:disabled) { filter: brightness(1.06); }
.bbtn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--wood); }
.bbtn:disabled { opacity: .5; cursor: default; filter: grayscale(.5); }
.bbtn.primary { color: #fbe9b7; background: linear-gradient(#b23a2a, #7d1a17); border-color: #3b0d0b; box-shadow: 0 3px 0 #3b0d0b; text-shadow: 0 1px 0 #3b0d0b; }
.bbtn.big { font-size: 16px; padding: 10px 20px; }
.bbtn.small { font-size: 12px; padding: 3px 9px; box-shadow: 0 2px 0 var(--wood); }
.bbtn.icon { padding: 6px 8px; }
.bbtn.pulse { animation: pulse 1.4s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 3px 0 #3b0d0b, 0 0 0 0 rgba(232, 185, 35, .7); } 50% { box-shadow: 0 3px 0 #3b0d0b, 0 0 0 10px rgba(232, 185, 35, 0); } }
.btns { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; align-items: center; }
.seg { display: inline-flex; border: 2px solid var(--wood); border-radius: 7px; overflow: hidden; box-shadow: 0 2px 0 var(--wood); }
.seg button { font-family: var(--display); font-weight: 700; background: #f3e4bd; border: none; border-right: 1px solid var(--wood2); padding: 5px 13px; cursor: pointer; color: var(--ink); display: inline-flex; align-items: center; gap: 5px; }
.seg button:last-child { border-right: none; }
.seg button.on { background: var(--crimson); color: #fbe9b7; }
.seg.small button { padding: 3px 9px; font-size: 12px; }
.seg.wide { display: flex; flex-wrap: wrap; }
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--wood); border-radius: 6px; background: #fbf3dc; overflow: hidden; }
.stepper button { border: none; background: #e6d3a5; width: 24px; height: 24px; font-weight: bold; cursor: pointer; color: var(--ink); }
.stepper b { min-width: 24px; text-align: center; font-family: var(--display); }
.stepper.mini button { width: 18px; height: 18px; font-size: 12px; }
.stepper.mini b { min-width: 16px; font-size: 12px; }

/* Heraldry */
.shield {
  --c: #777;
  display: inline-grid; place-items: center; flex: none; width: 30px; height: 34px; color: #fff;
  font: 900 15px var(--display); text-shadow: 0 1px 1px rgba(0, 0, 0, .6);
  background: linear-gradient(135deg, rgba(255, 255, 255, .25), transparent 50%), var(--c);
  clip-path: path('M15 0 L30 5 L30 17 C30 26 23 31 15 34 C7 31 0 26 0 17 L0 5 Z');
  vertical-align: middle;
}
.shield.sm { width: 20px; height: 23px; font-size: 11px; clip-path: path('M10 0 L20 3.4 L20 11.5 C20 17.6 15.3 21 10 23 C4.7 21 0 17.6 0 11.5 L0 3.4 Z'); }
.shield.huge { width: 90px; height: 102px; font-size: 44px; clip-path: path('M45 0 L90 15 L90 51 C90 78 69 93 45 102 C21 93 0 78 0 51 L0 15 Z'); }
.pname { color: color-mix(in srgb, var(--c) 75%, #000); }
.rchip { --c: #777; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--c); border: 2px solid #fff6dc; box-shadow: 0 2px 4px rgba(0, 0, 0, .4); vertical-align: middle; }
.rchip.back { background: #6b4a2b; }
.amt { white-space: nowrap; font-weight: 600; }

/* Board stage and overlays */
.b-stage { grid-column: 1; grid-row: 1; position: relative; overflow: hidden; min-width: 0; min-height: 0; border: 3px solid var(--wood2); border-bottom: none; border-right: none; }
.b-stage canvas { position: absolute; inset: 0; display: block; }
.b-turn { position: absolute; left: 12px; top: 12px; z-index: 3; }
.plaque { display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 10px; font-family: var(--display); font-size: 16px; color: #fbe9b7; background: linear-gradient(#5a3f26, #3b2a1a); border: 2px solid #c99a1e; border-radius: 8px; box-shadow: 0 4px 10px rgba(0, 0, 0, .45); }
.plaque small { color: #d9c08a; font-size: 11px; margin-right: 4px; }
.thinking { display: inline-flex; gap: 3px; margin-left: 4px; }
.thinking i { width: 5px; height: 5px; border-radius: 50%; background: #fbe9b7; animation: think 1s infinite; }
.thinking i:nth-child(2) { animation-delay: .15s; } .thinking i:nth-child(3) { animation-delay: .3s; }
@keyframes think { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }
.b-wars { position: absolute; left: 12px; top: 62px; z-index: 3; width: 280px; display: flex; flex-direction: column; gap: 5px; max-height: calc(100% - 200px); overflow-y: auto; }
.wars-title { align-self: flex-start; padding: 1px 8px; font: 700 12px var(--display); color: #fbe9b7; background: rgba(42, 29, 18, .85); border: 1px solid #c99a1e; border-radius: 6px; }
.war { padding: 5px 8px; font-size: 12px; color: var(--ink); background: rgba(246, 234, 205, .94); border: 2px solid #8a6a3a; border-radius: 8px; box-shadow: 0 3px 8px rgba(0, 0, 0, .35); }
.war.mine { border-color: var(--bad); cursor: pointer; }
.war-head { display: flex; align-items: center; gap: 4px; font: 700 12px var(--display); }
.war-head span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.war-head span:last-of-type { text-align: right; }
.war-bar { display: flex; height: 7px; margin: 4px 0 3px; border: 1px solid #2a1d12; border-radius: 4px; overflow: hidden; }
.war-bar i { display: block; height: 100%; }
.war-bar i:last-child { flex: 1; }
.war-foot { display: flex; justify-content: space-between; gap: 4px; font-size: 11px; font-weight: 700; }
.war small { color: var(--muted); font-size: 10.5px; }
.odds.good { color: #2f7d2f; } .odds.even { color: #a06b00; } .odds.bad { color: var(--bad); }
.oddrow { margin: 4px 0; line-height: 1.3; }
.b-prompt { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 3; }
.scrollbar { display: flex; align-items: center; gap: 10px; white-space: nowrap; padding: 7px 22px; font: 700 16px var(--display); color: var(--ink); background: var(--parch); border: 2px solid var(--wood); border-radius: 4px; box-shadow: 0 4px 12px rgba(0, 0, 0, .4), inset 0 0 0 3px var(--parch2); }
.b-corner { position: absolute; right: 12px; top: 12px; z-index: 3; display: flex; gap: 6px; }
.b-corner .bbtn { text-transform: capitalize; }
.b-offer { position: absolute; left: 50%; top: 62px; transform: translateX(-50%); z-index: 4; max-width: 92%; }
.b-offer .card { padding: 8px 14px; }
.offer-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 16px; }
.offer-line .for { font-style: italic; color: var(--muted); }
.resps { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.resp { display: flex; align-items: center; gap: 4px; padding: 2px 6px; background: rgba(255, 255, 255, .45); border-radius: 5px; }
.resp .yes { color: var(--good); font-weight: bold; } .resp .no { color: var(--bad); font-weight: bold; } .resp .wait { color: var(--muted); }
.b-notices { position: absolute; right: 12px; top: 60px; z-index: 4; display: flex; flex-direction: column; gap: 6px; width: 320px; pointer-events: none; }
.notice { pointer-events: auto; padding: 7px 12px; font-size: 14px; color: #fbe9b7; background: rgba(42, 29, 18, .92); border-left: 4px solid var(--gold); border-radius: 4px; box-shadow: 0 4px 10px rgba(0, 0, 0, .35); }
.notice .pname { color: color-mix(in srgb, var(--c) 45%, #fff); }
.notice small { color: #cbb68b; }
.notice a { color: #f2c75c; }
#basic .notice.good { color: #fbe9b7; border-left-color: #6fbf4a; } #basic .notice.bad { color: #fbe9b7; border-left-color: #e0503c; }
.notice .rchip { width: 22px; height: 22px; }
.b-float { position: absolute; left: 12px; bottom: 12px; z-index: 4; max-width: 300px; }
.b-float .card, .b-deals .card { padding: 9px 12px; font-size: 14px; }
.b-float .row { display: flex; align-items: center; gap: 6px; margin: 6px 0; }
.hintcard { font-style: italic; color: var(--muted); }
.b-deals { position: absolute; right: 12px; bottom: 84px; z-index: 4; display: flex; flex-direction: column; gap: 8px; max-width: 320px; }
.b-deals .row { margin: 3px 0; }
.b-tip { position: absolute; display: none; z-index: 6; pointer-events: none; max-width: 250px; padding: 6px 10px; font-size: 13.5px; background: var(--parch); border: 2px solid var(--wood); border-radius: 5px; box-shadow: 0 4px 10px rgba(0, 0, 0, .35); }
.b-banner { position: absolute; left: 50%; top: 34%; transform: translateX(-50%); z-index: 5; pointer-events: none; opacity: 0; }
.ribbon { --c: #8b1e1e; display: inline-block; white-space: nowrap; padding: 10px 46px; font: 900 28px var(--display); color: #fff6dc; letter-spacing: 1px; text-shadow: 0 2px 2px rgba(0, 0, 0, .5);
  background: linear-gradient(rgba(255, 255, 255, .18), rgba(0, 0, 0, .18)), var(--c);
  clip-path: polygon(0 0, 100% 0, 96% 50%, 100% 100%, 0 100%, 4% 50%); filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .5)); }

/* Dice */
.b-dice { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 5; display: none; align-items: center; gap: 14px; pointer-events: none; }
.b-dice.show { display: flex; }
.die { width: 62px; height: 62px; padding: 9px; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 2px; background: linear-gradient(145deg, #fffaf0, #e6d6b0); border: 2px solid var(--wood); border-radius: 12px; box-shadow: 0 6px 0 #8a7350, 0 12px 20px rgba(0, 0, 0, .45); }
.die i { border-radius: 50%; }
.die i.on { background: radial-gradient(circle at 35% 35%, #6b1612, #2a0a08); }
.die.sm { width: 30px; height: 30px; padding: 4px; border-radius: 6px; gap: 1px; box-shadow: 0 3px 0 #8a7350; }
.die.blank { opacity: .4; }
.dsum { min-width: 58px; height: 58px; display: grid; place-items: center; font: 900 30px var(--display); color: #fbe9b7; background: radial-gradient(circle at 35% 30%, #5a3f26, #2a1d12); border: 3px solid var(--gold); border-radius: 50%; box-shadow: 0 6px 16px rgba(0, 0, 0, .5); }
.dsum.seven { background: radial-gradient(circle at 35% 30%, #b23a2a, #5a0f0c); }
.flyer { position: fixed; z-index: 80; pointer-events: none; }

/* Right column: players and chronicle */
.b-side { grid-column: 2; grid-row: 1 / span 2; display: flex; flex-direction: column; min-height: 0; padding: 8px; gap: 8px; background: linear-gradient(#4a3420, #33241a); border-left: 3px solid var(--wood2); }
.b-players { display: flex; flex-direction: column; gap: 7px; }
.pp { --c: #777; position: relative; padding: 6px 9px 6px 10px; cursor: pointer; background: var(--parch); border: 2px solid var(--wood); border-left: 6px solid var(--c); border-radius: 6px; box-shadow: 0 2px 0 var(--wood); transition: transform .15s; }
.pp:hover { transform: translateX(-2px); }
.pp.me { background: #fbf0d0; }
.pp.cur { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold), 0 0 14px rgba(232, 185, 35, .6); }
.pp.cur::before { content: '▶'; position: absolute; left: -16px; top: 12px; color: var(--gold); font-size: 13px; }
.pp-head { display: flex; align-items: center; gap: 8px; }
.pp-name { flex: 1; font: 700 15px var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-name small { font: italic 12px var(--serif); }
.pp-vp { font: 900 24px var(--display); line-height: 1; }
.pp-vp small { font-size: 12px; }
.pp.close .pp-vp { color: var(--crimson); }
.pp-bar { display: grid; grid-auto-flow: column; gap: 2px; margin: 5px 0 4px; }
.pp-bar i { height: 5px; background: rgba(0, 0, 0, .12); border-radius: 2px; }
.pp-bar i.on { background: var(--c); }
.pp-stats { display: flex; justify-content: space-between; font-size: 13.5px; font-weight: 600; }
.pp-stats span { display: inline-flex; align-items: center; gap: 2px; }
.pp-stats sup { font-size: 9px; color: var(--muted); }
.pp-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tag { display: inline-flex; align-items: center; gap: 3px; padding: 0 6px; font: 700 11px var(--display); border-radius: 9px; }
.tag.gold { background: #f2d47a; color: #4a3104; border: 1px solid #a07a12; }
.tag.war { background: #f3c7bf; color: var(--bad); border: 1px solid var(--bad); }
.b-bank { display: flex; align-items: center; gap: 5px; padding: 5px 8px; background: rgba(241, 228, 195, .96); border: 2px solid var(--wood); border-radius: 6px; }
.bk-title { font: 700 12px var(--display); margin-right: 2px; cursor: help; }
.bk { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; cursor: help; }
.bk .rchip { width: 24px; height: 24px; }
.bk b { font: 900 14px var(--display); line-height: 1; }
.bk i { width: 100%; height: 3px; background: rgba(0, 0, 0, .12); border-radius: 2px; overflow: hidden; }
.bk i u { display: block; height: 100%; }
.bk.low b { color: var(--bad); }
.b-logwrap { flex: 1; min-height: 120px; display: flex; flex-direction: column; background: rgba(241, 228, 195, .96); border: 2px solid var(--wood); border-radius: 6px; overflow: hidden; }
.b-logbar { display: flex; align-items: center; gap: 4px; padding: 4px 8px; border-bottom: 1px solid var(--parch2); font-family: var(--display); }
.b-logbar b { flex: 1; font-size: 13px; }
.b-logbar button { font: 700 11px var(--display); padding: 1px 7px; border: 1px solid var(--wood2); border-radius: 9px; background: transparent; cursor: pointer; color: var(--ink); }
.b-logbar button.on { background: var(--wood2); color: var(--parch); }
.b-log { flex: 1; overflow-y: auto; padding: 4px 8px; font-size: 13px; line-height: 1.35; }
.le { padding: 3px 0; border-bottom: 1px dotted rgba(90, 63, 38, .25); }
.le[data-b] { cursor: pointer; }
.le.mine { font-weight: 600; }
.le.round { color: var(--muted); font-family: var(--display); font-size: 11px; text-align: center; border: none; }

/* Bottom: hand, actions, dice tray */
.b-bottom { grid-column: 1; grid-row: 2; display: flex; align-items: center; gap: 12px; padding: 7px 10px 9px; background: linear-gradient(#5a3f26, #3b2a1a); border-top: 3px solid #2a1d12; flex-wrap: wrap; }
.b-hand { display: flex; gap: 6px; }
.rcard { --c: #777; position: relative; width: 50px; height: 70px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; color: #fff;
  background: linear-gradient(160deg, rgba(255, 255, 255, .28), transparent 45%), var(--c); border: 3px solid #f6e7c1; border-radius: 7px; box-shadow: 0 3px 0 #1e140b, 0 5px 10px rgba(0, 0, 0, .4); }
.rcard b { font: 900 20px var(--display); line-height: 1; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
.rcard small { color: #fff6dc; font: 700 9px var(--display); letter-spacing: .4px; text-transform: uppercase; }
.rcard.empty { filter: saturate(.25) brightness(.8); opacity: .65; }
.rcard.gold { margin-left: 6px; }
.dcard { position: relative; width: 44px; height: 70px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; color: #fff; cursor: default;
  background: linear-gradient(160deg, rgba(255, 255, 255, .22), transparent 45%), #4a2f6b; border: 3px solid #d8c7f0; border-radius: 7px; box-shadow: 0 3px 0 #1e140b, 0 5px 10px rgba(0, 0, 0, .4); opacity: .7; }
.rcard.gold + .dcard { margin-left: 6px; }
.dcard b { font: 900 18px var(--display); line-height: 1; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
.dcard small { color: #f1e8ff; font: 700 8px var(--display); text-transform: uppercase; text-align: center; line-height: 1.05; }
.dcard em { position: absolute; top: -7px; right: -7px; padding: 0 4px; font: 900 9px var(--display); font-style: normal; color: #2a1d12; background: #ffd75e; border: 2px solid #1e140b; border-radius: 8px; }
.dcard.ready { opacity: 1; cursor: pointer; border-color: #ffd75e; }
.dcard.ready:hover { transform: translateY(-2px); filter: brightness(1.1); }
.b-actions { flex: 1; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.b-actions .group { display: flex; gap: 6px; padding: 4px; background: rgba(0, 0, 0, .25); border-radius: 9px; }
.act { position: relative; width: 66px; height: 70px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; cursor: pointer; color: var(--ink);
  background: linear-gradient(#f8ecca, #d8bf88); border: 2px solid #1e140b; border-radius: 8px; box-shadow: 0 3px 0 #1e140b; font-family: var(--display); }
.act span { font-size: 10px; font-weight: 700; white-space: nowrap; }
.act:hover:not(:disabled) { filter: brightness(1.07); transform: translateY(-1px); }
.act:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 #1e140b; }
.act:disabled { opacity: .45; cursor: default; filter: grayscale(.6); }
.act.on { background: linear-gradient(#b23a2a, #7d1a17); color: #fbe9b7; }
.act .cost { display: flex; gap: 2px; font-style: normal; }
.act .cost i { --c: #777; width: 8px; height: 8px; border-radius: 50%; background: var(--c); border: 1px solid #1e140b; }
.act .gcost { font: 700 11px var(--display); font-style: normal; display: inline-flex; align-items: center; gap: 1px; }
.act .badge { position: absolute; top: -7px; right: -7px; min-width: 20px; height: 20px; display: grid; place-items: center; font: 900 12px var(--display); font-style: normal; color: #2a1d12; background: #ffd75e; border: 2px solid #1e140b; border-radius: 10px; }
.act .lim { position: absolute; top: 2px; right: 4px; font-size: 9px; color: var(--muted); }
.act.on .lim, .act.on .gcost { color: #fbe9b7; }
.act-wrap { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.act-wrap .act { height: 48px; gap: 0; }
.b-tray { position: absolute; right: 12px; bottom: 12px; z-index: 4; display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: rgba(42, 29, 18, .85); border: 2px solid var(--gold); border-radius: 10px; box-shadow: 0 6px 14px rgba(0, 0, 0, .45); }
.minidice { display: flex; gap: 5px; }

/* Trade cards on offers and proposals */
.offer { min-width: 300px; }
.offer-head { display: flex; align-items: center; gap: 6px; font: 700 15px var(--display); }
.offer-body { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 8px 0 4px; }
.offer-body .side { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.offer-body .side small { font: 700 11px var(--display); text-transform: uppercase; letter-spacing: .5px; }
.offer-body .swap { color: var(--muted); }
.tcards { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.tcard { --c: #6b4a2b; position: relative; width: 58px; height: 80px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #fff;
  background: linear-gradient(160deg, rgba(255, 255, 255, .28), transparent 45%), var(--c); border: 3px solid #f6e7c1; border-radius: 7px; box-shadow: 0 3px 0 #1e140b, 0 5px 10px rgba(0, 0, 0, .35); }
.tcard b { position: absolute; top: -9px; right: -9px; min-width: 24px; height: 24px; display: grid; place-items: center; font: 900 14px var(--display); color: var(--ink); background: #fff6dc; border: 2px solid var(--wood); border-radius: 12px; }
#basic .tcard small, #basic .rcard small { color: #fff6dc; font: 700 9px var(--display); text-transform: uppercase; text-align: center; line-height: 1.1; }
.tcard.hexc { width: 74px; }
.b-deals .tcard { width: 48px; height: 66px; }
.b-deals .tcard .ico { width: 26px; height: 26px; }

/* Hover tips */
.b-hover { position: fixed; z-index: 90; display: none; max-width: 290px; padding: 9px 12px; pointer-events: none; font: 14px var(--serif); color: var(--ink); background: var(--parch); border: 2px solid var(--wood); border-radius: 7px; box-shadow: 0 6px 16px rgba(0, 0, 0, .45); }
.b-hover h4 { margin: 0 0 6px; font: 700 15px var(--display); display: flex; align-items: center; gap: 6px; }
.b-hover p { margin: 6px 0 2px; line-height: 1.3; }
.needs { display: flex; flex-wrap: wrap; gap: 6px; }
.need { display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px 2px 2px; border-radius: 14px; font: 700 13px var(--display); }
.need.ok { background: #d8e8c4; color: var(--good); }
.need.miss { background: #f3cfc8; color: var(--bad); }
.need .rchip { width: 24px; height: 24px; }
.tipt { margin-top: 4px; font-size: 13px; }
.tipt td { padding: 1px 6px 1px 0; }
.tipt .rchip { width: 20px; height: 20px; }

/* Chat */
.b-chat { flex: 0 0 auto; height: 30%; min-height: 130px; display: flex; flex-direction: column; background: rgba(241, 228, 195, .96); border: 2px solid var(--wood); border-radius: 6px; overflow: hidden; }
.b-chatlog { flex: 1; overflow-y: auto; padding: 4px 8px; font-size: 13.5px; }
.cl { padding: 2px 0; line-height: 1.3; }
.cl.empty { color: var(--muted); font-style: italic; }
.b-chatform { display: flex; gap: 4px; padding: 4px; border-top: 1px solid var(--parch2); }
.b-chatform input { flex: 1; min-width: 0; font: 14px var(--serif); padding: 3px 7px; border: 1.5px solid var(--wood2); border-radius: 5px; background: #fffaf0; }

/* Setup */
.b-setup { display: none; position: absolute; right: 0; top: 0; bottom: 0; width: 400px; z-index: 6; overflow-y: auto; padding: 16px 20px; background: var(--parch); border-left: 4px solid var(--wood); }
#basic.setting-up .b-setup { display: block; }
#basic.setting-up .b-side, #basic.setting-up .b-bottom { visibility: hidden; }
.b-setup h1 { font-size: 36px; margin: 2px 0 6px; color: var(--crimson); }
.b-setup h3 { font-size: 15px; border-bottom: 1px solid var(--parch2); margin: 14px 0 8px; }
.b-setup .lede { font-size: 15.5px; }
.seat { display: flex; align-items: center; gap: 8px; margin: 7px 0; }
.seat input { flex: 1; min-width: 0; font: 600 15px var(--serif); padding: 4px 7px; border: 1.5px solid var(--wood2); border-radius: 5px; background: #fffaf0; }

/* Dialogs */
#bmodal { position: fixed; inset: 0; z-index: 50; display: none; align-items: center; justify-content: center; background: rgba(20, 12, 5, .55); }
#bmodal.show { display: flex; }
#bmodal .box { width: 92%; max-width: 520px; max-height: 88vh; overflow-y: auto; padding: 16px 22px; font: 15px var(--serif); }
#bmodal .box.wide { max-width: 720px; }
#bmodal h2 { font: 700 22px 'Cinzel', Georgia, serif; margin: 2px 0 8px; display: flex; align-items: center; gap: 8px; }
#bmodal h4 { font: 700 13px 'Cinzel', Georgia, serif; color: #7a6446; margin: 6px 0; }
#bmodal table { width: 100%; border-collapse: collapse; }
#bmodal td, #bmodal th { padding: 4px 6px; border-bottom: 1px dotted rgba(90, 63, 38, .3); text-align: left; }
#bmodal th { font: 700 12px 'Cinzel', Georgia, serif; color: #7a6446; }
#bmodal .deal { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
#bmodal .deal label { display: flex; align-items: center; gap: 6px; margin: 4px 0; }
#bmodal .deal input[type=number] { margin-left: auto; width: 56px; padding: 2px 4px; border: 1.5px solid #5a3f26; border-radius: 4px; background: #fffaf0; font: inherit; }
#bmodal .checks label { display: flex; justify-content: flex-start; gap: 6px; font-size: 14px; }
#bmodal .bad { color: #9b1c14; } #bmodal .good { color: #2f6b2f; }
#bmodal .rules li { margin: 6px 0; }
#bmodal .victory { text-align: center; }
#bmodal .victory h2 { justify-content: center; font-size: 28px; color: #8b1e1e; }
#bmodal .bbattle canvas { width: 100%; border: 2px solid #3b2a1a; border-radius: 4px; cursor: pointer; display: block; }
#bmodal .ico { vertical-align: -3px; }
#bmodal .seg { margin-bottom: 8px; }

/* Home page */
#home { background: #3b2a1a repeating-linear-gradient(92deg, rgba(255, 255, 255, .025) 0 3px, rgba(0, 0, 0, .04) 3px 7px); }
#home h1 { font-family: 'Cinzel', Georgia, serif; font-weight: 900; color: #f2d47a; text-shadow: 0 3px 0 #1e140b; }
#home .sub { color: #d9c08a; font-family: 'Cinzel', Georgia, serif; }
#home .mode { background: #f1e4c3; border: 3px solid #1e140b; border-radius: 8px; box-shadow: 0 5px 0 #1e140b, 0 12px 24px rgba(0, 0, 0, .4); font-family: 'Crimson Text', Georgia, serif; font-size: 16px; }
#home .mode h2 { font-family: 'Cinzel', Georgia, serif; color: #8b1e1e; }

/* Phones */
@media (max-width: 900px) {
  body.basic-mode #basic { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; height: 100dvh; }
  .b-side { grid-column: 1; grid-row: 1; flex-direction: row; padding: 4px; border-left: none; min-width: 0; }
  .b-players { flex-direction: row; overflow-x: auto; gap: 5px; }
  .pp { min-width: 150px; padding: 3px 6px; }
  .pp.cur::before { display: none; }
  .pp-stats { font-size: 11.5px; gap: 4px; }
  .pp-tags, .b-logwrap, .b-chat, .b-bank { display: none; }
  .b-stage { grid-row: 2; border-left: none; }
  .b-bottom { grid-row: 3; gap: 6px; padding: 5px; flex-wrap: nowrap; overflow-x: auto; min-width: 0; }
  .b-actions { flex-wrap: nowrap; }
  .b-actions .group { gap: 3px; padding: 2px; }
  .rcard { width: 40px; height: 54px; }
  .rcard small { display: none; }
  .act { width: 54px; height: 58px; }
  .b-tray { padding: 4px 6px; }
  .b-tray .minidice { display: none; }
  .act span { font-size: 9px; }
  .b-notices { width: 220px; }
  .b-setup { left: 0; top: auto; width: auto; height: 60dvh; border-left: none; border-top: 4px solid var(--wood); }
  .scrollbar { font-size: 13px; padding: 5px 12px; white-space: normal; }
  .b-prompt { top: 52px; width: 90%; display: flex; justify-content: center; }
}

/* Accounts and lobby */
#home .lbar { display: flex; align-items: center; gap: 8px; max-width: 900px; margin: -20px auto 0; color: #f1e4c3; font-family: 'Cinzel', Georgia, serif; }
#home .lbar small { color: #c9b083; }
#home .grow { flex: 1; }
#home .lcard { background: #f1e4c3; border: 3px solid #1e140b; border-radius: 8px; box-shadow: 0 5px 0 #1e140b; padding: 14px 18px; font-family: 'Crimson Text', Georgia, serif; font-size: 16px; }
#home .lcard.narrow { max-width: 440px; margin: 24px auto; }
#home .lcard h2 { font-family: 'Cinzel', Georgia, serif; color: #8b1e1e; margin: 0 0 8px; font-size: 20px; }
#home .lcard label { display: block; margin: 8px 0 4px; }
#home .lcard input:not([type=color]), #home .lcard select { width: 100%; box-sizing: border-box; padding: 6px 8px; font: inherit; border: 2px solid #6b5132; border-radius: 4px; background: #fffaf0; }
#home .lcard .lseat select { width: auto; }
#home .lgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; max-width: 900px; margin: 0 auto 30px; }
#home .lgame, #home .lseat, #home .lplayer { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid rgba(60, 40, 20, .2); }
#home .lgame > div { flex: 1; min-width: 0; }
#home .lseats { font-size: 14px; color: #4a3a26; }
#home .lerr { color: #a4262c; min-height: 1.2em; margin: 6px 0; }
#home .swatches { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
#home .sw { width: 28px; height: 28px; border-radius: 50%; border: 3px solid #f1e4c3; outline: 2px solid #6b5132; padding: 0; cursor: pointer; }
#home .sw.on { outline: 3px solid #1e140b; transform: scale(1.12); }
#home input[type=color] { width: 40px; height: 32px; border: none; background: none; padding: 0; cursor: pointer; }
#home .dot { width: 9px; height: 9px; border-radius: 50%; background: #9a8a70; }
#home .dot.on { background: #3c9a4a; box-shadow: 0 0 4px #3c9a4a; }
#home .lstats { width: 100%; border-collapse: collapse; }
#home .lstats td, #home .lstats th { padding: 4px 6px; border-bottom: 1px solid rgba(60, 40, 20, .2); text-align: left; }
#home .hint { color: #5a4a36; font-size: 14px; }
#home .chip { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 1px solid #1e140b; vertical-align: -1px; margin-right: 3px; }
#home .chip.big { width: 18px; height: 18px; }

/* Scenarios */
.scenarios { display: grid; gap: 10px; margin: 6px 0 14px; }
.scenario { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px 14px; text-align: left; cursor: pointer; font: inherit; color: var(--ink);
  background: linear-gradient(#f6eacd, #ead8ae); border: 2px solid #8a6a3a; border-radius: 10px; box-shadow: 0 3px 0 #5a3d22; }
.scenario:hover { filter: brightness(1.05); transform: translateY(-1px); }
.scenario b { font: 700 18px var(--display); }
.scenario span { font-size: 13px; line-height: 1.35; }
.scenario.space { color: #e8ecf5; background: radial-gradient(circle at 80% 20%, rgba(120, 70, 160, .5), transparent 60%), linear-gradient(#1a2140, #070912); border-color: #6f86b8; box-shadow: 0 3px 0 #2c3555; }
.sc-factions { display: flex; gap: 4px; margin-top: 4px; }
.seat select { padding: 3px 4px; font: inherit; font-size: 12px; border: 1px solid #8a6a3a; border-radius: 5px; background: #fbf3df; max-width: 9em; }
.pp.out { opacity: .55; filter: grayscale(.7); }
