[hidden] { display: none !important; }
:root {
  --ink: #3a2414; --ink2: #6a4a2e; --paper: #f7e8c8; --paper2: #ecd5a6; --wood: #7a4a24; --woodD: #4e2c12;
  --red: #c43c32; --redD: #8a2a22; --orange: #e8742c; --orangeD: #a8481a; --gold: #f2c14a; --green: #3a8a4a;
  --px: 4px;
  --title: 'Press Start 2P', 'Courier New', monospace;
  --body: 'Pixelify Sans', 'Trebuchet MS', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--body); color: var(--ink); background: #ff9a63; overflow-x: hidden; -webkit-tap-highlight-color: transparent; }
#bg { position: fixed; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; z-index: 0; }
#app { position: relative; z-index: 1; min-height: 100%; overflow-x: hidden; }
canvas { image-rendering: pixelated; image-rendering: crisp-edges; }
button { font-family: inherit; }

/* ---------- pixel scroll panel ---------- */
.scroll {
  position: relative; background: var(--paper); padding: 22px 20px;
  box-shadow: 0 calc(-1*var(--px)) 0 0 var(--ink), 0 var(--px) 0 0 var(--ink), calc(-1*var(--px)) 0 0 0 var(--ink), var(--px) 0 0 0 var(--ink),
    inset 0 calc(-1*var(--px)) 0 0 var(--paper2), inset var(--px) 0 0 0 #fff4dc;
  margin: 18px 14px;
  background-image: radial-gradient(rgba(122,74,36,.07) 1px, transparent 1px); background-size: 6px 6px;
}
.scroll::before, .scroll::after {
  content: ''; position: absolute; left: -14px; right: -14px; height: 10px; background: var(--wood);
  box-shadow: 0 -4px 0 0 var(--woodD), 0 4px 0 0 var(--woodD), -4px 0 0 0 var(--woodD), 4px 0 0 0 var(--woodD), inset 0 3px 0 0 #a8683a;
}
.scroll::before { top: -14px; } .scroll::after { bottom: -14px; }
.scroll.small { max-width: 320px; margin: 0 auto; text-align: center; }

/* ---------- buttons ---------- */
.btn {
  --b: var(--orange); --bd: var(--orangeD);
  border: 0; cursor: pointer; font-family: var(--title); font-size: 11px; line-height: 1.4; color: #fff; text-shadow: 2px 2px 0 rgba(0,0,0,.35);
  background: var(--b); padding: 12px 16px; position: relative; margin: 4px;
  box-shadow: 0 -4px 0 0 var(--ink), 0 4px 0 0 var(--ink), -4px 0 0 0 var(--ink), 4px 0 0 0 var(--ink), inset 0 -4px 0 0 var(--bd), inset 0 4px 0 0 rgba(255,255,255,.3);
  transition: transform .05s;
}
.btn:hover:not(:disabled) { filter: brightness(1.08); }
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 -4px 0 0 var(--ink), 0 4px 0 0 var(--ink), -4px 0 0 0 var(--ink), 4px 0 0 0 var(--ink), inset 0 4px 0 0 var(--bd); }
.btn:disabled { filter: grayscale(.6) brightness(.9); cursor: not-allowed; opacity: .75; }
.btn.primary { --b: var(--red); --bd: var(--redD); }
.btn.big { font-size: 13px; padding: 16px 22px; width: calc(100% - 8px); }
.btn.small { font-size: 9px; padding: 8px 10px; }
.btn.ghost { --b: var(--paper2); --bd: #c9a86e; color: var(--ink); text-shadow: none; }
.btn.icon { --b: var(--wood); --bd: var(--woodD); padding: 8px 12px; font-family: var(--body); font-size: 14px; }
.btn.google { --b: #fff; --bd: #d8d0c0; color: #3a3a3a; text-shadow: none; font-size: 11px; display: inline-flex; align-items: center; gap: 12px; padding: 14px 18px; }
.gicon { width: 18px; height: 18px; flex: none; background:
  conic-gradient(from -45deg, #ea4335 0 25%, #4285f4 0 50%, #34a853 0 75%, #fbbc05 0 100%); border-radius: 50%;
  -webkit-mask: radial-gradient(circle, transparent 4px, #000 4.5px); mask: radial-gradient(circle, transparent 4px, #000 4.5px); }

/* ---------- layout ---------- */
.screen { min-height: 100vh; min-height: 100dvh; padding: 16px; padding-top: max(16px, env(safe-area-inset-top)); }
.screen.center { display: grid; place-items: center; }
.bar { display: flex; align-items: center; justify-content: space-between; max-width: 1040px; margin: 0 auto 6px; }
.bar h2 { font-family: var(--title); font-size: 16px; color: #fff; text-shadow: 3px 3px 0 var(--ink), -1px -1px 0 var(--ink), 1px -1px 0 var(--ink), -1px 1px 0 var(--ink); margin: 6px 0; }
.spinner { width: 24px; height: 24px; margin: 6px auto 10px; background: var(--red); animation: spin 1s steps(8) infinite; box-shadow: 0 0 0 4px var(--ink); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- title ---------- */
.title { display: flex; flex-direction: column; align-items: center; justify-content: space-between; text-align: center; }
.logo { margin-top: 6vh; }
.logo-kanji { font-size: 44px; width: 76px; height: 76px; line-height: 76px; margin: 0 auto 14px; background: var(--red); color: #fff; font-weight: 700;
  box-shadow: 0 -4px 0 0 var(--ink), 0 4px 0 0 var(--ink), -4px 0 0 0 var(--ink), 4px 0 0 0 var(--ink), inset 0 -6px 0 0 var(--redD); }
.logo h1 { font-family: var(--title); font-size: clamp(26px, 7vw, 56px); margin: 0; color: #fff4dc; letter-spacing: 2px;
  text-shadow: 4px 4px 0 var(--red), 8px 8px 0 var(--ink), -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink); line-height: 1.25; }
.logo h1 span { display: block; font-size: .62em; color: var(--gold); letter-spacing: 8px; margin-top: 10px; text-shadow: 3px 3px 0 var(--ink), -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink); }
.tag { font-size: 18px; color: #fff; text-shadow: 2px 2px 0 var(--ink); margin: 16px 0 0; }
.title-card { width: min(380px, calc(100vw - 56px)); text-align: center; margin-bottom: 4vh; }
.fine { font-size: 14px; color: var(--ink2); margin: 12px 0 0; }
.credits { font-family: var(--title); font-size: 10px; color: #fff; text-shadow: 2px 2px 0 var(--ink); margin-bottom: 8px; }
.credits a { color: #fff4dc; }

/* ---------- creator ---------- */
.creator-grid { display: grid; grid-template-columns: 340px 1fr; gap: 26px; max-width: 1040px; margin: 0 auto; align-items: start; }
.preview { text-align: center; position: sticky; top: 30px; }
.stage { background: linear-gradient(#bfe3f2 0 62%, #7cc06a 62% 64%, #5aa64c 64%); margin: 0 auto 12px; width: 100%; max-width: 288px;
  box-shadow: 0 0 0 4px var(--ink), inset 0 -8px 0 0 #4a8a3e; }
.stage canvas { display: block; width: 100%; height: auto; }
.stage.sm { width: 140px; flex: none; margin: 0; }
.turn { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 16px; margin-bottom: 6px; }
.options { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.lbl { font-family: var(--title); font-size: 10px; color: var(--wood); }
input { font-family: var(--body); font-size: 20px; padding: 10px 12px; border: 0; background: #fffaf0; color: var(--ink);
  box-shadow: 0 0 0 4px var(--ink), inset 4px 4px 0 0 var(--paper2); outline: none; margin: 4px; }
input:focus { box-shadow: 0 0 0 4px var(--red), inset 4px 4px 0 0 var(--paper2); }
input:disabled { opacity: .7; }
.hint { font-size: 15px; color: var(--ink2); margin-left: 4px; } .hint.good { color: var(--green); } .hint.bad { color: var(--red); }
.villages { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.village { background: #fffaf0; border: 0; cursor: pointer; padding: 12px 8px; text-align: center; color: var(--ink); margin: 4px;
  box-shadow: 0 0 0 4px var(--ink2); display: flex; flex-direction: column; align-items: center; gap: 6px; transition: transform .08s; }
.village b { font-size: 17px; color: var(--vd); } .village small { font-size: 13px; color: var(--ink2); line-height: 1.25; }
.village:hover:not(:disabled) { transform: translateY(-2px); }
.village.on { background: color-mix(in srgb, var(--vc) 18%, #fffaf0); box-shadow: 0 0 0 4px var(--vc), 0 0 0 8px var(--ink); }
.village:disabled:not(.on) { opacity: .45; cursor: not-allowed; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; padding: 4px; }
.swatches.mt { margin-top: 2px; }
.sw { width: 34px; height: 34px; border: 0; cursor: pointer; box-shadow: 0 0 0 3px var(--ink), inset 0 -5px 0 0 rgba(0,0,0,.2); }
.sw.on { box-shadow: 0 0 0 3px #fff, 0 0 0 7px var(--red), inset 0 -5px 0 0 rgba(0,0,0,.2); transform: translateY(-2px); }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper .val { min-width: 110px; text-align: center; font-size: 19px; font-weight: 700; background: #fffaf0; padding: 6px 10px; box-shadow: 0 0 0 3px var(--ink2); }

/* ---------- profile ---------- */
.profile .card { max-width: 560px; margin: 26px auto; }
.card-top { display: flex; gap: 20px; align-items: center; }
.who { flex: 1; min-width: 0; }
.who h3 { font-family: var(--title); font-size: 18px; margin: 8px 0; word-break: break-word; color: var(--ink); }
.vrow { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--vc); font-size: 17px; }
.vrow .em canvas { display: block; }
.rank { font-size: 18px; margin-bottom: 8px; }
.xp { height: 14px; background: #fffaf0; box-shadow: 0 0 0 3px var(--ink); margin: 3px 3px 6px; }
.xp div { height: 100%; background: var(--gold); box-shadow: inset 0 -4px 0 #c99a22; }
.who small { font-size: 15px; color: var(--ink2); }
.styles { margin: 20px 0 8px; display: grid; gap: 10px; }
.st { display: grid; grid-template-columns: 110px 1fr 30px; align-items: center; gap: 10px; font-size: 17px; }
.pips { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; }
.pips i { height: 14px; background: #e6d2a8; box-shadow: 0 0 0 2px var(--ink2); }
.st b { text-align: right; }
.actions { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 18px; }
.soon { font-size: 15px; color: var(--ink2); }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50; max-width: 90vw;
  background: var(--paper); padding: 12px 16px; font-size: 17px; box-shadow: 0 0 0 4px var(--ink); animation: pop .2s steps(3); }
.toast.err { box-shadow: 0 0 0 4px var(--red), 0 0 0 8px var(--ink); }
@keyframes pop { from { transform: translate(-50%, 20px); opacity: 0; } }

/* ---------- phones ---------- */
@media (max-width: 760px) {
  .screen { padding: 12px; }
  .creator-grid { grid-template-columns: 1fr; gap: 18px; }
  .preview { position: static; }
  .stage { max-width: 200px; }
  .villages { grid-template-columns: 1fr; }
  .village { flex-direction: row; text-align: left; gap: 12px; }
  .village > div:first-child { flex: none; }
  .village b { display: block; }
  .village { display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto; column-gap: 12px; }
  .village .em { grid-row: span 2; }
  .bar h2 { font-size: 13px; }
  .swatches { gap: 7px; }
  .sw { width: 30px; height: 30px; }
  .scroll { padding: 20px 14px; }
  .card-top { flex-direction: column; text-align: center; }
  .vrow { justify-content: center; }
  .st { grid-template-columns: 96px 1fr 26px; font-size: 15px; }
}

/* ---------- world ---------- */
body.in-world { overflow: hidden; background: #2a3a1e; touch-action: none; }
.world { position: fixed; inset: 0; user-select: none; -webkit-user-select: none; }
.world #view { position: absolute; inset: 0; display: block; }
.hud-top { position: absolute; top: max(10px, env(safe-area-inset-top)); left: 10px; right: 10px; display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; }
.hud-top > * { pointer-events: auto; }
.plate { display: flex; align-items: center; gap: 10px; background: var(--paper); padding: 6px 12px 6px 6px; box-shadow: 0 0 0 4px var(--ink), inset 0 -4px 0 var(--paper2); margin: 4px; }
.plate .face { width: 36px; height: 36px; background: #bfe3f2; box-shadow: 0 0 0 2px var(--ink2); }
.plate b { display: block; font-size: 17px; line-height: 1.1; } .plate small { font-size: 14px; color: var(--ink2); }
.hud-right { display: flex; align-items: center; gap: 8px; }
.online { background: rgba(36,22,14,.72); color: #fff4dc; padding: 6px 10px; font-size: 15px; box-shadow: 0 0 0 3px var(--ink); }
.vname { position: absolute; top: max(70px, calc(env(safe-area-inset-top) + 60px)); left: 50%; transform: translateX(-50%); font-family: var(--title); font-size: 10px; color: #fff4dc;
  text-shadow: 2px 2px 0 var(--ink); display: flex; align-items: center; gap: 8px; pointer-events: none; opacity: .9; white-space: nowrap; }
.vname .em canvas { display: block; }
.prompt { position: absolute; left: 50%; bottom: 120px; border: 0; cursor: pointer; font-family: var(--body); color: var(--ink); transform: translateX(-50%); background: var(--paper); padding: 8px 14px; font-size: 17px; font-weight: 700; box-shadow: 0 0 0 4px var(--ink); white-space: nowrap; animation: pop .15s steps(2); }
.chat { position: absolute; left: 14px; bottom: 14px; width: min(380px, calc(100vw - 28px)); background: rgba(247,232,200,.94); box-shadow: 0 0 0 4px var(--ink); display: flex; flex-direction: column; }
.chat-tabs { display: flex; gap: 2px; background: var(--wood); padding: 4px 4px 0; }
.chat-tabs button { font-family: var(--body); font-size: 15px; font-weight: 700; border: 0; padding: 4px 12px; background: #a8683a; color: #fff4dc; cursor: pointer; }
.chat-tabs button.on { background: var(--paper); color: var(--ink); }
.chat-tabs .chat-close { margin-left: auto; display: none; background: transparent; }
.chat-log { height: 150px; overflow-y: auto; padding: 6px 10px; font-size: 15px; line-height: 1.3; }
.chat-log p { margin: 0 0 3px; word-wrap: break-word; } .chat-log .sys { color: var(--ink2); font-style: italic; }
.chat-form { display: flex; gap: 4px; padding: 6px; align-items: center; }
.chat-form input { flex: 1; min-width: 0; font-size: 16px; padding: 6px 8px; margin: 3px; box-shadow: 0 0 0 3px var(--ink); }
.chat-toggle { display: none; position: absolute; right: 14px; bottom: 150px; font-size: 20px; }
.chat-toggle i { position: absolute; top: -4px; right: -4px; width: 12px; height: 12px; background: var(--red); box-shadow: 0 0 0 2px var(--ink); }
.stick { position: absolute; left: 22px; bottom: calc(26px + env(safe-area-inset-bottom)); width: 128px; height: 128px; background: rgba(247,232,200,.28); box-shadow: 0 0 0 4px rgba(36,22,14,.55); border-radius: 50%; touch-action: none; }
.stick .knob { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; background: var(--paper); border-radius: 50%; box-shadow: 0 0 0 4px var(--ink), inset 0 -5px 0 var(--paper2); pointer-events: none; }
.act { position: absolute; right: 26px; bottom: calc(46px + env(safe-area-inset-bottom)); width: 76px; height: 76px; border-radius: 0; font-size: 20px; }
.menu { position: absolute; top: 76px; right: 18px; display: flex; flex-direction: column; gap: 6px; padding: 18px 14px; min-width: 180px; z-index: 5; }
.modal-wrap { position: absolute; inset: 0; background: rgba(20,12,6,.45); display: grid; place-items: center; z-index: 10; padding: 20px; }
.modal { max-width: 420px; width: 100%; text-align: center; font-size: 18px; }
.modal h3 { font-family: var(--title); font-size: 14px; margin: 4px 0 12px; }
.modal p { margin: 0 0 14px; line-height: 1.35; }
.pcard { display: flex; gap: 16px; align-items: center; text-align: left; margin-bottom: 8px; }
.pcard canvas { width: 64px; height: 80px; background: #bfe3f2; box-shadow: 0 0 0 3px var(--ink); flex: none; }
.pcard p { margin: 0 0 4px; }
@media (pointer: coarse), (max-width: 760px) {
  .chat { display: none; left: 10px; right: 10px; width: auto; bottom: auto; top: 76px; }
  .chat.open { display: flex; z-index: 6; }
  .chat-tabs .chat-close { display: block; }
  .chat-toggle { display: block; }
  .chat-log { height: 32vh; }
  .prompt { bottom: 90px; }
  .vname { top: auto; bottom: calc(24px + env(safe-area-inset-bottom)); }
  .plate b { font-size: 15px; } .plate small { font-size: 12px; }
  .online { font-size: 13px; padding: 5px 8px; }
}

/* ---------- overlays: board / training / battle ---------- */
.ov { position: absolute; inset: 0; z-index: 20; }
.board-wrap { background: rgba(20,12,6,.5); display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.board { width: min(560px, 100%); max-height: calc(100dvh - 60px); overflow-y: auto; text-align: center; }
.board h3 { font-family: var(--title); font-size: 15px; margin: 2px 0 6px; }
.board .sub { margin: 0 0 12px; font-size: 16px; color: var(--ink2); }
.mlist { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; text-align: left; }
.mcard { display: flex; gap: 12px; align-items: flex-start; background: #fffaf0; border: 0; padding: 10px 12px; cursor: pointer; font-family: var(--body); color: var(--ink);
  box-shadow: 0 0 0 3px var(--ink2); margin: 3px; text-align: left; transition: transform .08s; }
.mcard:hover:not(:disabled) { transform: translateX(3px); box-shadow: 0 0 0 3px var(--red); }
.mcard.locked { opacity: .55; cursor: not-allowed; }
.grade { flex: none; width: 30px; height: 30px; display: grid; place-items: center; color: #fff; font-family: var(--title); font-size: 12px; box-shadow: 0 0 0 3px var(--ink); }
.mtxt b { display: block; font-size: 18px; } .mtxt small { display: block; font-size: 14px; color: var(--ink2); line-height: 1.25; margin: 2px 0 4px; } .mtxt em { font-style: normal; font-size: 14px; font-weight: 700; color: var(--wood); }
.train .xp { margin: 4px 6px 8px; }
.pts { background: #fffaf0; padding: 8px; margin: 0 4px 12px; box-shadow: 0 0 0 3px var(--ink2); font-size: 17px; }
.pts.has { box-shadow: 0 0 0 3px var(--gold), 0 0 0 6px var(--ink); animation: glow 1s steps(2) infinite; }
@keyframes glow { 50% { background: #fff1b8; } }
.tstyles { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; text-align: left; }
.tst { display: flex; align-items: center; gap: 10px; background: #fffaf0; padding: 8px; box-shadow: 0 0 0 3px var(--ink2); margin: 3px; }
.tic { width: 38px; height: 38px; flex: none; display: grid; place-items: center; font-size: 20px; box-shadow: 0 0 0 3px var(--ink); }
.tinfo { flex: 1; min-width: 0; } .tinfo b { font-size: 18px; } .tinfo b span { font-family: var(--title); font-size: 13px; margin-left: 6px; }
.tinfo small { display: block; font-size: 13px; color: var(--ink2); line-height: 1.2; } .tinfo .nx { color: var(--wood); margin-top: 2px; }
.train-btn { position: relative; }
.train-btn i { position: absolute; top: -6px; right: -6px; width: 12px; height: 12px; background: var(--gold); box-shadow: 0 0 0 2px var(--ink); animation: glow 1s steps(2) infinite; }

.battle { background: #24160e; display: flex; flex-direction: column; padding-inline: max(0px, calc((100vw - 860px) / 2)); }
.b-top { display: flex; align-items: center; gap: 10px; padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top)); background: var(--wood); color: #fff4dc; font-size: 18px; }
.b-top .turn { margin-left: auto; font-family: var(--title); font-size: 10px; }
.b-arena { position: relative; flex: 1 1 auto; min-height: 0; background: #9fd1ec; overflow: hidden; }
.b-arena canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.hpbox { position: absolute; background: var(--paper); padding: 6px 10px; min-width: 170px; box-shadow: 0 0 0 4px var(--ink); font-size: 15px; }
.hpbox b { font-size: 16px; } .hpbox small { margin-left: 6px; color: var(--ink2); }
.hpbox.e { top: 12px; left: 12px; } .hpbox.p { right: 12px; bottom: 12px; }
.gbar { height: 10px; background: #e6d2a8; box-shadow: 0 0 0 2px var(--ink); margin: 5px 2px 2px; }
.gbar i { display: block; height: 100%; background: #4cbf4c; transition: width .35s steps(6); }
.gbar.hp.low i { background: #e04a3a; } .gbar.ch i { background: #4aa3e8; }
.hpbox .num { font-size: 13px; color: var(--ink2); display: block; text-align: right; }
.b-log { background: var(--paper); padding: 10px 14px; font-size: 18px; min-height: 46px; box-shadow: inset 0 4px 0 var(--ink), inset 0 -4px 0 var(--ink); }
.b-tabs { display: flex; background: var(--wood); padding: 4px 4px 0; gap: 3px; }
.b-tabs button { flex: 1; border: 0; padding: 8px 4px; font-family: var(--body); font-weight: 700; font-size: 15px; background: #a8683a; color: #fff4dc; cursor: pointer; box-shadow: inset 0 -4px 0 var(--c); }
.b-tabs button.on { background: var(--paper); color: var(--ink); }
.b-moves { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px; background: var(--paper); }
.mv { border: 0; background: #fffaf0; padding: 9px 10px; text-align: left; cursor: pointer; font-family: var(--body); color: var(--ink); box-shadow: 0 0 0 3px var(--ink), inset 6px 0 0 var(--c); padding-left: 16px; margin: 3px; }
.mv b { display: block; font-size: 17px; } .mv small { font-size: 13px; color: var(--ink2); }
.mv:hover:not(:disabled) { background: #fff1b8; } .mv:disabled { opacity: .5; cursor: not-allowed; } .mv.locked { filter: grayscale(1); }
.b-extra { display: flex; justify-content: center; gap: 10px; padding: 4px 10px 10px; padding-bottom: max(10px, env(safe-area-inset-bottom)); background: var(--paper); }
.b-result { position: absolute; inset: 0; background: rgba(20,12,6,.55); display: grid; place-items: center; padding: 16px; }
.b-result .scroll { width: min(420px, 100%); text-align: center; font-size: 18px; }
.b-result h3 { font-family: var(--title); font-size: 16px; margin: 4px 0 12px; } .b-result h3.win { color: var(--green); } .b-result h3.lose { color: var(--red); }
.b-result .big { font-family: var(--title); font-size: 13px; color: var(--wood); }
.b-result .lvl { background: #fff1b8; padding: 8px; box-shadow: 0 0 0 3px var(--gold); font-weight: 700; }
.b-result .cap { font-size: 15px; color: var(--ink2); }
.b-result .row { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
@media (max-width: 760px) {
  .b-arena { flex: none; aspect-ratio: 4 / 3; max-height: 46vh; width: 100%; }
  .hpbox { min-width: 0; width: calc(50% - 16px); font-size: 12px; padding: 4px 7px; box-shadow: 0 0 0 3px var(--ink); } .hpbox.e { top: 6px; left: 6px; } .hpbox.p { right: 6px; top: 6px; bottom: auto; }
  .hpbox b { font-size: 13px; } .hpbox .num { font-size: 11px; } .gbar { height: 7px; margin: 3px 1px 1px; }
  .mv { padding: 12px 10px 12px 16px; } .b-extra .btn { font-size: 10px; padding: 12px 12px; }
  .b-tabs button span { display: none; } .b-tabs button { font-size: 20px; }
  .b-log { font-size: 16px; }
  .mv b { font-size: 15px; } .b-moves { gap: 6px; padding: 8px; }
  .battle { overflow-y: auto; }
}
.tinfo em { font-style: normal; font-size: 13px; color: var(--ink2); margin-left: 4px; }
.mini { height: 8px; background: #e6d2a8; box-shadow: 0 0 0 2px var(--ink2); margin: 5px 2px 2px; }
.mini i { display: block; height: 100%; }
.pools { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 16px; font-size: 16px; margin-bottom: 10px; }
.energy { background: #fffaf0; box-shadow: 0 0 0 3px var(--ink2); padding: 8px 10px; margin: 0 4px 12px; text-align: left; }
.energy b { font-size: 17px; } .energy small { font-size: 14px; color: var(--ink2); }
.ebar { height: 12px; background: #e6d2a8; box-shadow: 0 0 0 2px var(--ink); margin: 6px 2px; } .ebar i { display: block; height: 100%; background: var(--gold); box-shadow: inset 0 -3px 0 #c99a22; transition: width .3s; }
.ttabs { display: flex; gap: 4px; margin: 0 4px 10px; } .ttabs button { flex: 1; border: 0; padding: 8px; font-family: var(--body); font-weight: 700; font-size: 16px; background: #e6d2a8; color: var(--ink2); cursor: pointer; box-shadow: 0 0 0 3px var(--ink2); margin: 3px; }
.ttabs button.on { background: var(--red); color: #fff; box-shadow: 0 0 0 3px var(--ink); }
.train h4 { margin: 8px 4px 0; font-size: 17px; text-align: left; } .train h4 small { font-size: 13px; color: var(--ink2); font-weight: 400; }
.tst.jt.locked { opacity: .55; }
.tst .btn small { font-family: var(--body); font-size: 11px; }
.gbar.sta i { background: #e8a42c; }
.mv .jl { font-family: var(--title); font-size: 10px; color: var(--wood); vertical-align: middle; }
.toast.ok { box-shadow: 0 0 0 4px var(--green), 0 0 0 8px var(--ink); }
.tbtns { display: flex; flex-direction: column; gap: 2px; flex: none; }
.tbtns .btn { margin: 4px; min-width: 64px; }
.exreq { background: #fffaf0; padding: 10px; margin: 3px; box-shadow: 0 0 0 3px var(--ink2); font-size: 17px; }
.exreq.ok { box-shadow: 0 0 0 3px var(--green); } .exreq span { color: var(--ink2); font-size: 15px; }
.b-top .rnd { font-size: 14px; background: rgba(0,0,0,.25); padding: 2px 8px; }
.promo { font-size: 56px; color: var(--gold); text-shadow: 3px 3px 0 var(--ink); animation: pop .4s steps(4); line-height: 1; }

/* ---------- hex tactical battle ---------- */
.hexb { overflow-y: auto; }
.hx-arena { position: relative; background: #2a3a20; display: flex; justify-content: center; }
.hx-arena canvas { width: 100%; max-width: 860px; max-height: 50vh; aspect-ratio: 320 / 200; object-fit: contain; image-rendering: pixelated; display: block; cursor: pointer; touch-action: manipulation; }
.hx-banner { position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%); font-family: var(--title); font-size: 16px; color: #fff4dc; background: rgba(36,22,14,.85);
  padding: 10px 18px; box-shadow: 0 0 0 3px #ffe07a; pointer-events: none; animation: bnr .9s steps(6) both; }
.hx-banner.b { box-shadow: 0 0 0 3px #ff8f7a; }
@keyframes bnr { 0% { opacity: 0; transform: translate(-50%, -30%); } 20%, 80% { opacity: 1; transform: translate(-50%, -50%); } 100% { opacity: 0; } }
.hx-cards { display: grid; grid-template-columns: 1.3fr 1fr; gap: 6px; padding: 6px; background: var(--wood); }
.hx-card { background: var(--paper); box-shadow: 0 0 0 3px var(--ink); padding: 5px 7px; min-width: 0; }
.hx-card .nm { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; font-size: 15px; } .hx-card .nm small { color: var(--ink2); }
.hx-card .gbar { position: relative; height: 13px; margin: 4px 1px 2px; }
.hx-card .gbar span { position: absolute; inset: 0; font-size: 10px; font-weight: 700; line-height: 13px; padding-left: 4px; color: #24160e; text-shadow: 0 0 2px #fff; white-space: nowrap; }
.elc { display: inline-block; font-size: 12px; font-weight: 700; padding: 0 5px; background: color-mix(in srgb, var(--c) 25%, #fff); box-shadow: 0 0 0 2px var(--c); color: var(--ink); white-space: nowrap; }
.aprow { display: flex; align-items: center; gap: 3px; margin-top: 4px; min-height: 14px; }
.aprow i { width: 10px; height: 10px; background: #d8c49a; box-shadow: 0 0 0 2px var(--ink); transform: rotate(45deg); margin: 0 2px; }
.aprow i.on { background: #ffd23a; } .aprow b { font-family: var(--title); font-size: 10px; margin-left: 6px; } .aprow .wait { margin: 0; color: var(--red); }
.sts { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; min-height: 4px; }
.sti { font-size: 13px; background: #fff1b8; padding: 0 3px; box-shadow: 0 0 0 2px var(--gold); } .sti.bad { background: #f4d0e8; box-shadow: 0 0 0 2px #9a5ad0; }
.sti small { font-size: 11px; font-weight: 700; margin-left: 1px; }
.hx-info { background: #fff4dc; color: var(--ink); padding: 7px 12px; font-size: 15px; min-height: 52px; box-shadow: inset 0 -3px 0 #d8c49a; }
.hx-info .good { color: var(--green); font-weight: 700; } .hx-info .bad { color: var(--red); font-weight: 700; } .hx-info small { color: var(--ink2); }
.hx-moves { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; padding: 8px; background: var(--paper); flex: 1; align-content: start; }
.mv.hx { margin: 0; } .mv.hx.sel { background: #fff1b8; box-shadow: 0 0 0 3px var(--ink), 0 0 0 6px #ffd23a, inset 6px 0 0 var(--c); }
.mv .ap { font-style: normal; font-weight: 700; color: var(--wood); }
.hx-bar { display: flex; gap: 6px; padding: 8px; padding-bottom: max(8px, env(safe-area-inset-bottom)); background: var(--wood); }
.hx-bar .btn { flex: 1; font-size: 11px; } .hx-bar [data-flee] { flex: 0 0 auto; } .hx-bar .btn small { display: block; font-size: 10px; opacity: .8; } .hx-bar .btn.sel { box-shadow: 0 0 0 3px #ffd23a; }
.blood { background: linear-gradient(#fbe3f0, #fff4dc); box-shadow: 0 0 0 3px #c43c8a; padding: 8px; margin: 8px 0; }
.blood.none { background: #f3ead6; box-shadow: 0 0 0 3px #8a7a5a; } .blood h4 { margin: 2px 0 4px; font-size: 17px; } .blood p { font-size: 15px; margin: 0; }
.bico { font-size: 40px; animation: pop 1s steps(5) infinite alternate; } @keyframes pop { to { transform: scale(1.15); } }
.elbox { background: #fff8e6; box-shadow: 0 0 0 3px var(--gold); padding: 8px; margin: 6px 2px 10px; display: flex; flex-direction: column; gap: 4px; }
.elbox small { color: var(--ink2); } .elbox .bl { color: #8a2a6a; } .el2b { display: flex; flex-wrap: wrap; gap: 5px; margin: 4px 0; } .el2b .btn small { font-size: 10px; }
@media (max-width: 760px) {
  .hx-arena canvas { max-height: none; }
  .hx-cards { grid-template-columns: 1.2fr 1fr; gap: 5px; padding: 5px; } .hx-card .nm { font-size: 13px; } .elc { font-size: 10px; }
  .hx-info { font-size: 13px; padding: 5px 9px; min-height: 46px; }
  .hx-moves { grid-template-columns: 1fr 1fr; gap: 5px; padding: 6px; } .mv.hx { padding: 8px 6px 8px 13px; } .mv.hx b { font-size: 13px; } .mv.hx small { font-size: 11px; }
  .hx-bar .btn { font-size: 10px; padding: 10px 6px; }
}
.elbox .elc { width: fit-content; }
@media (max-width: 760px) { .hexb .b-top { font-size: 14px; gap: 6px; } .hexb .b-top .rnd { font-size: 11px; } }
.elrow { margin: 3px 0; display: flex; gap: 6px; flex-wrap: wrap; }
.hx-bar { padding-bottom: max(56px, env(safe-area-inset-bottom)); } /* keep buttons clear of the host's corner badge */
.duel-pop { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(20,12,6,.45); padding: 16px; }
.duel-pop .scroll { width: min(380px, 100%); text-align: center; font-size: 17px; }
.duel-pop h3 { font-family: var(--title); font-size: 13px; margin: 6px 0 10px; color: var(--red); }
.duel-pop .row { display: flex; gap: 8px; justify-content: center; margin-top: 8px; }
.dp-ico { font-size: 40px; animation: pop 0.8s steps(4) infinite alternate; }
.b-top .tmr { font-family: var(--title); font-size: 11px; background: #24160e; padding: 4px 8px; box-shadow: 0 0 0 2px #ffe07a; margin-left: auto; }
.b-top .tmr.them { box-shadow: 0 0 0 2px #ff8f7a; opacity: .85; } .b-top .tmr.low { background: var(--red); animation: pop .5s steps(2) infinite alternate; }
.b-top .tmr:not([hidden]) + .turn { margin-left: 8px; }
.pcard + [data-duel] { width: 100%; margin: 6px 0; }
.board.arena { max-width: 560px; }
.ar-bonus { background: #fff8e6; box-shadow: 0 0 0 3px var(--gold); padding: 8px 10px; margin: 4px 2px 10px; font-size: 15px; }
.ar-bonus small { display: block; color: var(--ink2); margin-top: 4px; }
.ar-tiers { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 2px; } .ar-tiers span { background: #24160e; color: #ffe07a; padding: 2px 8px; font-size: 13px; }
.ar-mybonus { background: #e2f6d8; box-shadow: 0 0 0 3px var(--green); padding: 8px 10px; margin: 4px 2px 10px; font-size: 15px; }
.ar-ranks { display: flex; gap: 4px; margin: 6px 0; } .ar-ranks button { flex: 1; border: 0; padding: 7px; font-family: var(--body); font-weight: 700; background: #e6d2a8; cursor: pointer; color: var(--ink); }
.ar-ranks button.on { background: #24160e; color: #ffe07a; }
.ar-list { display: flex; flex-direction: column; gap: 4px; margin: 6px 0; min-height: 80px; }
.ar-row { display: grid; grid-template-columns: 34px 22px 1fr auto auto; align-items: center; gap: 8px; background: #fffaf0; box-shadow: 0 0 0 2px #d8c49a; padding: 4px 8px; }
.ar-row.bz { box-shadow: 0 0 0 2px var(--gold); } .ar-row.me { background: #fff1b8; box-shadow: 0 0 0 3px var(--red); }
.ar-row .pl { font-family: var(--title); font-size: 11px; text-align: center; } .ar-row .pl:not(:empty) { line-height: 1; } .ar-row.top .pl { font-size: 20px; } .ar-row canvas { width: 24px; height: 30px; image-rendering: pixelated; }
.ar-row .nm { display: flex; flex-direction: column; align-items: flex-start; text-align: left; min-width: 0; } .ar-row .nm b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .ar-row .nm small { font-size: 12px; }
.ar-row .arp { font-family: var(--title); font-size: 11px; color: var(--wood); } .ar-row .bt { font-size: 11px; font-weight: 700; background: #24160e; color: #ffe07a; padding: 1px 5px; }
.ar-cut { text-align: center; font-size: 12px; color: var(--ink2); border-top: 2px dashed #c9a86a; padding-top: 3px; margin-top: 4px; }
.ar-me { text-align: center; font-size: 15px; margin: 4px 0; } .ar-how { text-align: center; margin-top: 8px; } .ar-empty { text-align: center; padding: 16px 0; }
.ebonus { display: block; color: var(--green); font-weight: 700; margin-top: 3px; }
.ar-mybonus.acad { background: #e6eefc; box-shadow: 0 0 0 3px #2f7fc4; }
/* ---------- world map ---------- */
.wmap { background: #24160e; display: flex; flex-direction: column; overflow-y: auto; padding-inline: max(0px, calc((100vw - 900px) / 2)); }
.wm-top { display: flex; align-items: center; gap: 8px; padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top)); background: var(--wood); color: #fff4dc; font-size: 17px; }
.wm-top b { margin-right: auto; }
.wm-stage { position: relative; width: 100%; aspect-ratio: 320 / 200; max-height: 62vh; margin: 0 auto; }
.wm-stage canvas { width: 100%; height: 100%; image-rendering: pixelated; display: block; }
.wm-pins { position: absolute; inset: 0; }
.wm-pin { position: absolute; transform: translate(-50%, -60%); border: 0; background: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; padding: 0; font-family: var(--body); }
.wm-pin .ic { font-size: clamp(16px, 3.4vw, 28px); filter: drop-shadow(0 2px 0 rgba(0,0,0,.45)); line-height: 1; }
.wm-pin .lb { font-size: clamp(9px, 1.6vw, 13px); font-weight: 700; color: #fff4dc; background: rgba(36,22,14,.75); padding: 0 4px; white-space: nowrap; margin-top: 1px; }
.wm-pin.home .lb { color: #ffe07a; } .wm-pin.sel .lb { background: #c43c32; }
.wm-pin.active .ic { animation: pinpulse 1s steps(3) infinite alternate; } .wm-pin.active .lb::after { content: ' !'; color: #ffe07a; }
.wm-pin.k-lair .lb { background: rgba(90,20,20,.85); } .wm-pin.k-lair.open .lb::after { content: ''; display: inline-block; width: 1.1em; height: 1.1em; margin-left: 3px; vertical-align: -0.2em; background: var(--px-swords) center / contain no-repeat; image-rendering: pixelated; }
@keyframes pinpulse { to { transform: translateY(-4px) scale(1.12); } }
.wm-panel { background: var(--paper); padding: 10px 14px 14px; flex: 1; font-size: 16px; }
.wm-panel h3 { font-family: var(--title); font-size: 13px; margin: 4px 0 6px; }
.wm-step, .wm-q, .wm-boss { background: #fffaf0; box-shadow: 0 0 0 3px var(--ink); padding: 8px 10px; margin: 10px 3px; display: flex; flex-direction: column; gap: 4px; }
.wm-step p { margin: 2px 0 6px; } .wm-step small, .wm-q small { color: var(--ink2); }
.wm-step .btn, .wm-q .btn { align-self: flex-start; } .wm-q.locked { opacity: .6; } .wm-q.done { box-shadow: 0 0 0 3px var(--green); }
.wm-boss { box-shadow: 0 0 0 3px #8a2a2a; background: #fbe8e0; }
.wm-step .mini i { background: #7a4a2a; }
/* ---------- boss lair + team fights ---------- */
.board.lair .row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 8px 0; }
.board.lair h4 { margin: 12px 2px 6px; }
.lmembers { display: flex; flex-direction: column; gap: 6px; }
.lm { background: #fffaf0; box-shadow: 0 0 0 3px var(--ink); padding: 6px 10px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.lm small { width: 100%; color: var(--ink2); } .lm.empty { box-shadow: 0 0 0 2px #c9a86a; color: var(--ink2); font-style: italic; }
.lm .ldr { font-size: 12px; color: var(--wood); font-weight: 700; }
.lteam { display: flex; align-items: center; gap: 8px; background: #fffaf0; box-shadow: 0 0 0 3px var(--ink); padding: 6px 10px; margin: 6px 2px; }
.lteam > div { flex: 1; display: flex; flex-direction: column; } .lteam small { color: var(--ink2); }
.hx-allies { display: flex; gap: 6px; padding: 0 6px 6px; background: var(--wood); }
.hx-allies .ally { flex: 1; background: var(--paper); box-shadow: 0 0 0 3px var(--ink); padding: 4px 7px; font-size: 13px; min-width: 0; }
.hx-allies .ally.now { box-shadow: 0 0 0 3px #ffe07a; } .hx-allies .ally.down { opacity: .55; }
.hx-allies .ally small { color: var(--wood); font-weight: 700; } .hx-allies .gbar { position: relative; height: 12px; margin: 3px 1px 1px; }
.hx-allies .gbar span { position: absolute; inset: 0; font-size: 10px; font-weight: 700; line-height: 12px; padding-left: 4px; }
.enr { color: var(--red); font-weight: 700; } .ttl { color: var(--wood); font-weight: 700; font-size: 14px; margin: 2px 0; }

/* ---------- piece 7: Kage Tower, village wars ---------- */
.board.kage, .board.warcamp { text-align: left; }
.board.kage h3, .board.warcamp h3 { text-align: center; }
.board h4 { font-family: var(--title); font-size: 10px; margin: 14px 2px 6px; color: var(--ink2); }
.kg-board { display: flex; flex-direction: column; gap: 6px; margin: 6px 3px; }
.kg-v { display: grid; grid-template-columns: 30px 18px 1fr auto auto; gap: 8px; align-items: center; background: #fffaf0; box-shadow: 0 0 0 3px var(--vd); border-left: 8px solid var(--vc); padding: 8px 10px; }
.kg-v.me { background: #fff1b8; }
.kg-v .pl { font-size: 22px; text-align: center; } .kg-v .em canvas, .kg-all i canvas { display: block; }
.kg-v .nm { display: flex; flex-direction: column; min-width: 0; } .kg-v .nm b { font-size: 17px; } .kg-v .nm small, .kg-v .vp small, .kg-v .tr small { font-size: 12px; color: var(--ink2); }
.kg-v .vp, .kg-v .tr { display: flex; flex-direction: column; align-items: flex-end; } .kg-v .vp b { font-family: var(--title); font-size: 12px; color: var(--vd); }
.kg-v .tr { font-size: 14px; min-width: 52px; }
.kg-mine { text-align: center; margin: 10px 0 6px; }
.kg-pts, .kg-rules { background: #fff8e6; box-shadow: 0 0 0 3px var(--gold); padding: 8px 10px; margin: 8px 3px; display: flex; flex-wrap: wrap; gap: 5px; font-size: 14px; }
.kg-pts b:first-child, .kg-rules > b { width: 100%; font-size: 15px; }
.kg-pts span { background: #24160e; color: #fff4dc; padding: 2px 7px; } .kg-pts span b { color: #ffe07a; } .kg-pts span.hot { background: var(--red); }
.kg-rules { flex-direction: column; gap: 3px; }
.kg-all { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; } .kg-all span { display: flex; align-items: center; gap: 5px; background: #fffaf0; box-shadow: 0 0 0 2px #d8c49a; padding: 3px 8px; }
.kg-seat { background: #fffaf0; box-shadow: 0 0 0 3px var(--ink); padding: 10px; margin: 6px 3px 12px; text-align: center; }
.kg-seat .btn { margin-top: 6px; }
.kg-kage { display: flex; gap: 12px; align-items: center; justify-content: center; text-align: left; }
.kg-kage canvas { width: 48px; height: 60px; } .kg-kage h4 { margin: 0; font-size: 12px; color: var(--ink); } .kg-kage p { margin: 2px 0; }
.kg-kage .on { color: var(--green); font-weight: 700; } .kg-kage .off { color: var(--ink2); }
.kg-you { font-size: 16px; }
.kg-tre { display: flex; justify-content: space-between; align-items: center; background: #24160e; color: #fff4dc; padding: 8px 12px; margin: 6px 3px; font-size: 16px; }
.kg-tre b { font-family: var(--title); font-size: 14px; color: #ffe07a; }
.kg-ups, .kg-terr { display: flex; flex-direction: column; gap: 6px; margin: 6px 3px; }
.kg-up, .kg-t { display: grid; grid-template-columns: 30px 1fr auto auto; gap: 8px; align-items: center; background: #fffaf0; box-shadow: 0 0 0 2px #d8c49a; padding: 6px 8px; }
.kg-t { grid-template-columns: 30px 1fr auto; }
.kg-up .ic, .kg-t .ic { font-size: 22px; text-align: center; }
.kg-up .nm, .kg-t .nm { display: flex; flex-direction: column; min-width: 0; } .kg-up small, .kg-t small { font-size: 13px; color: var(--ink2); }
.kg-up .lv { display: flex; gap: 2px; } .kg-up .lv i { width: 8px; height: 14px; background: #e6d2a8; box-shadow: 0 0 0 1px var(--ink2); } .kg-up .lv i.on { background: var(--gold); }
.kg-up .max { font-family: var(--title); font-size: 10px; color: var(--green); } .kg-up .cost { font-size: 12px; color: var(--ink2); white-space: nowrap; }
.kg-t .war { font-size: 13px; color: var(--red); font-weight: 700; } .kg-t .cd { font-size: 13px; color: #2f7fc4; } .kg-t .open { font-size: 13px; color: var(--green); }
.kg-top { display: flex; flex-direction: column; gap: 3px; margin: 4px 3px; }
.kg-top div { display: grid; grid-template-columns: 26px 1fr auto; background: #fffaf0; padding: 3px 8px; box-shadow: 0 0 0 1px #d8c49a; }
.kg-top span { font-family: var(--title); font-size: 10px; color: var(--ink2); align-self: center; } .kg-top em { font-style: normal; font-weight: 700; color: var(--wood); }
.kg-recent { font-size: 14px; display: flex; flex-direction: column; gap: 3px; margin: 4px 3px; }
@media (max-width: 480px) {
  .kg-v { grid-template-columns: 26px 16px 1fr auto; } .kg-v .tr { display: none; }
  .kg-up { grid-template-columns: 26px 1fr auto; } .kg-up .lv { grid-column: 2; grid-row: 2; }
  .kg-t { grid-template-columns: 26px 1fr; } .kg-t .btn { grid-column: 1 / -1; }
}
/* war camp */
.wc-score { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: stretch; margin: 6px 3px; }
.wc-side { display: flex; flex-direction: column; align-items: center; background: #fffaf0; box-shadow: 0 0 0 3px var(--vc); border-top: 8px solid var(--vc); padding: 6px; }
.wc-side small { font-size: 12px; color: var(--ink2); } .wc-side b { font-size: 17px; } .wc-side em { font-style: normal; font-family: var(--title); font-size: 20px; margin-top: 4px; }
.wc-mid { display: flex; flex-direction: column; align-items: center; justify-content: center; } .wc-mid b { font-family: var(--title); font-size: 14px; } .wc-mid small { font-size: 12px; color: var(--ink2); white-space: nowrap; }
.wc-bar { display: flex; height: 10px; margin: 8px 3px; box-shadow: 0 0 0 2px var(--ink); } .wc-bar i { display: block; height: 100%; }
.wc-note { background: #fff8e6; box-shadow: 0 0 0 3px var(--gold); padding: 8px 10px; margin: 10px 3px; } .wc-note.hold { background: #e2f6d8; box-shadow: 0 0 0 3px var(--green); }
.wc-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .wc-cols h4 { margin-top: 6px; }
.wc-p { display: grid; grid-template-columns: 22px 1fr auto; gap: 6px; align-items: center; background: #fffaf0; box-shadow: 0 0 0 2px #d8c49a; padding: 4px 6px; margin: 4px 2px; }
.wc-p.me { background: #fff1b8; } .wc-p canvas { width: 18px; height: 26px; } .wc-p .nm { display: flex; flex-direction: column; min-width: 0; } .wc-p .nm b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .wc-p small { font-size: 12px; }
@media (max-width: 480px) { .wc-cols { grid-template-columns: 1fr; } }
/* territories on the world map */
.wm-pin .ic { position: relative; } .wm-pin .flag { position: absolute; right: -6px; top: -4px; width: 9px; height: 7px; box-shadow: 0 0 0 1px #24160e; }
.wm-pin.war .lb { background: #c43c32; } .wm-pin.war .ic { animation: pinpulse 1s steps(3) infinite alternate; }
.wm-terr { background: #fffaf0; box-shadow: 0 0 0 3px var(--ink); border-left: 8px solid var(--vc); padding: 8px 10px; margin: 10px 3px; display: flex; flex-direction: column; gap: 4px; }
.wm-terr small { color: var(--ink2); } .wm-terr .wm-war { color: var(--red); } .wm-terr .btn { align-self: flex-start; }

.board.kage > [data-x], .board.warcamp > [data-x] { display: block; margin: 12px auto 0; }

/* sleep */
.sleep-bar { position: absolute; left: 50%; top: 64px; transform: translateX(-50%); z-index: 6; display: flex; align-items: center; gap: 10px; background: #1e2a4a; color: #e8eeff; padding: 8px 12px; box-shadow: 0 0 0 3px #0e1426; max-width: min(640px, calc(100vw - 20px)); font-size: 15px; }
.sleep-bar[hidden] { display: none; }
.world.asleep #view { filter: brightness(.72) saturate(.7) hue-rotate(-10deg); }
@media (max-width: 600px) { .sleep-bar { top: 58px; font-size: 13px; } }
/* war battlefield */
.wfield { background: #24160e; display: flex; flex-direction: column; }
.wf-top { display: flex; align-items: center; gap: 8px; padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top)); background: var(--wood); color: #fff4dc; font-size: 16px; flex-wrap: wrap; }
.wf-top > b { margin-right: auto; }
.wf-score { display: flex; align-items: center; gap: 6px; font-weight: 700; } .wf-score i { font-style: normal; color: #fff; padding: 2px 8px; box-shadow: 0 0 0 2px #24160e; } .wf-score em { font-style: normal; font-size: 13px; opacity: .85; }
.wf-stage { flex: 1; min-height: 0; display: grid; place-items: center; padding: 6px; }
.wf-stage canvas { image-rendering: pixelated; box-shadow: 0 0 0 3px #4e2c12; touch-action: none; cursor: pointer; }
.wf-hint { background: var(--paper); padding: 8px 12px; padding-bottom: max(8px, env(safe-area-inset-bottom)); font-size: 15px; text-align: center; }
.wf-card { position: absolute; left: 50%; bottom: 64px; transform: translateX(-50%); display: flex; gap: 10px; align-items: center; background: var(--paper); box-shadow: 0 0 0 3px var(--ink), 0 6px 0 rgba(0,0,0,.3); padding: 10px 34px 10px 12px; min-width: 240px; }
.wf-card[hidden] { display: none; }
.wf-card canvas { width: 36px; height: 52px; } .wf-card div { display: flex; flex-direction: column; gap: 3px; } .wf-card small { font-size: 13px; } .wf-card .sub { margin: 4px 0 0; font-size: 14px; }
.wf-card .btn { margin-top: 4px; align-self: flex-start; }
.wf-cx { position: absolute; right: 6px; top: 6px; border: 0; background: none; font-size: 16px; cursor: pointer; color: var(--ink); }
.sleep-bar .btn { white-space: nowrap; }
/* loadout */
.loadout-wrap { z-index: 40; }
.board.loadout { text-align: left; width: min(640px, 100%); }
.board.loadout h3 { text-align: center; }
.board.loadout h4 { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; } .board.loadout h4 b { color: var(--red); } .board.loadout h4 small { font-family: var(--body); font-size: 12px; color: var(--ink2); }
.lo-timer { position: relative; height: 22px; background: #e6d2a8; box-shadow: 0 0 0 2px var(--ink); margin: 6px 3px 4px; }
.lo-timer i { position: absolute; inset: 0 auto 0 0; background: var(--gold); transition: width .5s linear; } .lo-timer span { position: relative; display: block; text-align: center; font-weight: 700; line-height: 22px; }
.lo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; margin: 4px 3px; }
.lo-j { text-align: left; border: 0; background: #fffaf0; box-shadow: 0 0 0 2px #d8c49a; border-left: 6px solid var(--c, #7a4a2a); padding: 6px 8px; cursor: pointer; font-family: var(--body); color: var(--ink); display: flex; flex-direction: column; gap: 2px; opacity: .72; }
.lo-j b { font-size: 14px; } .lo-j small { font-size: 12px; color: var(--ink2); } .lo-j em { font-style: normal; color: var(--wood); }
.lo-j.on { opacity: 1; background: #fff1b8; box-shadow: 0 0 0 3px var(--ink); } .lo-j.on b::after { content: ' ✓'; color: var(--green); }
.lo-j.it { border-left-color: #2f7fc4; } .lo-j:disabled { opacity: .4; cursor: default; }
.lo-lock { background: #2b1d3a; color: #e6dcff; padding: 6px 8px; display: flex; flex-direction: column; gap: 2px; font-size: 14px; } .lo-lock small { font-size: 12px; opacity: .8; }
.lo-status { text-align: center; margin: 10px 0 4px; }
.lo-go { display: block; margin: 10px auto 2px; }
/* items in the fight bar */
.hx-items { display: inline-flex; gap: 4px; } .hx-it b { font-size: 12px; margin-left: 2px; }
/* shop */
.board.shop { text-align: left; } .board.shop h3, .board.shop > [data-x] { text-align: center; } .board.shop > [data-x] { display: block; margin: 12px auto 0; }
.sh-ryo { text-align: center; background: #24160e; color: #ffe07a; padding: 6px; margin: 6px 3px 10px; font-size: 16px; }
.sh-list { display: flex; flex-direction: column; gap: 6px; margin: 4px 3px; }
.sh-it { display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; align-items: center; background: #fffaf0; box-shadow: 0 0 0 2px #d8c49a; padding: 8px; }
.sh-it .ic { font-size: 26px; text-align: center; } .sh-it .nm { display: flex; flex-direction: column; gap: 2px; } .sh-it small { font-size: 13px; color: var(--ink2); }
.sh-it .buy { display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 480px) { .sh-it { grid-template-columns: 30px 1fr; } .sh-it .buy { grid-column: 1 / -1; flex-direction: row; } .lo-grid { grid-template-columns: 1fr 1fr; } }
/* shop tabs, gear, ANBU */
.sh-it.lock { opacity: .6; } .sh-it.worn { background: #fff1b8; box-shadow: 0 0 0 3px var(--green); }
.tag { font-style: normal; font-size: 11px; font-weight: 700; padding: 0 5px; background: #e6d2a8; color: var(--ink); margin-left: 2px; }
.tag.adv { background: #2f7fc4; color: #fff; } .tag.anbu { background: #2b1d3a; color: #e6dcff; } .tag.on { background: var(--green); color: #fff; } .tag.own { background: #fff; box-shadow: 0 0 0 1px #c9a86a; }
.board.shop h4 small, .board.gear h4 small { font-family: var(--body); font-size: 12px; color: var(--ink2); }
.sh-anbu-lock { text-align: center; background: #2b1d3a; color: #e6dcff; padding: 16px; margin: 6px 3px; } .sh-anbu-lock .ic { font-size: 36px; } .sh-anbu-lock h4 { color: #fff; }
.board.gear { text-align: left; } .board.gear h3, .board.gear > [data-x] { text-align: center; } .board.gear > [data-x] { display: block; margin: 12px auto 0; }
.ge-doll { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 6px 0 10px; }
.ge-mid { display: flex; align-items: center; gap: 10px; } .ge-mid canvas { width: 72px; height: 90px; image-rendering: pixelated; }
.ge-slot { width: 130px; min-height: 64px; border: 0; background: #fffaf0; box-shadow: 0 0 0 3px #c9a86a; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px; cursor: pointer; font-family: var(--body); color: var(--ink); }
.ge-slot small { font-size: 11px; color: var(--ink2); text-transform: uppercase; letter-spacing: .05em; } .ge-slot .ic { font-size: 22px; } .ge-slot .ic.empty { color: #c9a86a; } .ge-slot b { font-size: 13px; text-align: center; }
.ge-slot.full { box-shadow: 0 0 0 3px var(--ink); } .ge-slot.sel { background: #fff1b8; box-shadow: 0 0 0 3px var(--red); }
.ge-stats { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; margin: 4px 3px 8px; } .ge-stats span { background: #24160e; color: #fff4dc; padding: 3px 8px; font-size: 13px; } .ge-stats b { color: #ffe07a; } .ge-stats .set { background: var(--green); }
.ge-shop { display: block; margin: 10px auto 0; }
@media (max-width: 420px) { .ge-slot { width: 104px; } }
.an-list { display: flex; flex-direction: column; gap: 10px; margin: 6px 3px; }
.an-sq { background: #f3edf8; box-shadow: 0 0 0 3px #2b1d3a; padding: 8px 10px; } .an-sq.mine { box-shadow: 0 0 0 3px #2b1d3a, 0 0 0 6px var(--gold); }
.an-hd { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; } .an-hd b { margin-right: auto; font-size: 16px; } .an-hd small { color: var(--ink2); }
.an-m { display: flex; align-items: center; gap: 8px; background: #fff; padding: 4px 8px; margin: 3px 0; box-shadow: 0 0 0 1px #d0c4e0; } .an-m canvas { width: 24px; height: 30px; } .an-m span { display: flex; flex-direction: column; margin-right: auto; } .an-m small { font-size: 12px; color: var(--ink2); }
.an-new { background: #fffaf0; box-shadow: 0 0 0 3px var(--ink); padding: 10px; margin: 8px 3px; display: flex; flex-direction: column; gap: 6px; }
.an-new input, .an-new select { font-family: var(--body); font-size: 16px; padding: 6px; border: 2px solid var(--ink); background: #fff; }
.tag { text-shadow: none; line-height: 1.35; display: inline-block; vertical-align: middle; }
.wm-drops { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.wm-drops span { background: #fff4d8; box-shadow: 0 0 0 2px #8a2a2a; padding: 1px 5px; font-size: 0.92em; white-space: nowrap; }
.cdb { background: #3a2a4a; color: #ffe07a; padding: 0 4px; font-size: 11px; margin-left: 2px; }
.hx .cdb + * {}
.hx-ctr { display: contents; }
.hx-bar .ctr { border-color: #6a4aa0; }
.lib-note { background: #2b1d3a; color: #e6dcff; padding: 8px 10px; margin: 6px 3px 10px; font-size: 14px; }
.online.net-bad { background: #b02a2a; color: #fff; white-space: nowrap; animation: netpulse 1.2s infinite; }
@keyframes netpulse { 50% { opacity: .6; } }
.daily { background: #fff4d8; box-shadow: 0 0 0 2px #c9a46a; padding: 4px 8px; margin: 6px 3px; font-size: 14px; text-align: center; }
.daily.over { background: #fbe8e0; box-shadow: 0 0 0 2px #8a2a2a; }
.mk-filter { display: flex; gap: 6px; margin: 4px 3px 8px; flex-wrap: wrap; }
.mk-filter .chip { border: 0; background: #f3e3c0; box-shadow: 0 0 0 2px #8a6a3a; padding: 4px 10px; font: inherit; cursor: pointer; }
.mk-filter .chip.on { background: #8a2a2a; color: #fff; }
.mk-meta { color: #7a5a2a; }
.mk-empty { text-align: center; color: #7a5a2a; padding: 10px; }
.market .tag.boss, .tag.boss { background: #6a2a8a; color: #fff; }
.mk-sell { display: flex; flex-direction: column; gap: 8px; }
.mk-sell label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mk-sell input { width: 120px; font: inherit; padding: 4px 6px; border: 2px solid #8a6a3a; background: #fffaf0; }
.mk-get { background: #fff4d8; box-shadow: 0 0 0 2px #c9a46a; padding: 6px 8px; margin: 0; }
.mk-sell .row { display: flex; gap: 8px; }
.injured { border: 0; background: #b02a2a; color: #fff; font: inherit; padding: 4px 8px; cursor: pointer; box-shadow: 0 0 0 2px #5a1010; white-space: nowrap; }
.injured[hidden] { display: none; }
.hp-card { text-align: center; background: #eaf6e4; box-shadow: 0 0 0 2px #4a8a3a; padding: 10px; margin: 4px 3px 10px; }
.hp-card.hurt { background: #fbe8e0; box-shadow: 0 0 0 2px #8a2a2a; }
.hp-card .hp-ic { font-size: 34px; }
.hp-card p { margin: 6px 0; font-size: 14px; }
.hp-timer { font-size: 18px; }
.hp-heal { display: block; width: 100%; margin: 6px 0; }
@media (max-width: 480px) { .injured { padding: 2px 5px; font-size: 13px; } }

/* ---------- first-session guide ---------- */
.guide { position: absolute; left: 14px; top: max(84px, calc(env(safe-area-inset-top) + 74px)); width: min(320px, calc(100vw - 28px)); background: var(--paper); box-shadow: 0 0 0 4px var(--ink), inset 0 -4px 0 var(--paper2); padding: 8px 12px 10px; z-index: 6; animation: pop .2s steps(2); }
.guide[hidden] { display: none; }
.guide.min { width: auto; padding: 0; background: transparent; box-shadow: none; }
.guide .g-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 700; color: var(--ink2); text-transform: uppercase; letter-spacing: .04em; }
.guide .g-min { border: 0; background: var(--paper2); font: inherit; font-size: 18px; line-height: 1; width: 26px; height: 22px; cursor: pointer; color: var(--ink); }
.guide .g-title { display: block; font-size: 18px; margin: 4px 0 2px; }
.guide p { margin: 4px 0 8px; font-size: 15px; line-height: 1.3; }
.guide .g-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.guide-chip { border: 0; font: inherit; font-weight: 700; font-size: 15px; background: var(--gold); color: var(--ink); padding: 6px 12px; box-shadow: 0 0 0 3px var(--ink); cursor: pointer; animation: glow 1.4s steps(2) infinite; }
.guide-glow { animation: guideGlow 1s steps(2) infinite; }
@keyframes guideGlow { 0%, 100% { box-shadow: 0 0 0 3px var(--ink), 0 0 0 7px #ffd23a; } 50% { box-shadow: 0 0 0 3px var(--ink), 0 0 0 3px #ffd23a; } }
.hb-btn { font-size: 18px; padding-left: 10px; padding-right: 10px; }
@media (pointer: coarse), (max-width: 760px) {
  .guide { left: 10px; right: 10px; width: auto; top: max(100px, calc(env(safe-area-inset-top) + 92px)); }
  .guide.min { right: auto; }
  .guide p { font-size: 14px; }
}

/* ---------- handbook ---------- */
.board.hb { width: min(760px, 100%); min-width: 0; }
.hb-grid > * { min-width: 0; }
.hb-grid { display: grid; grid-template-columns: 200px 1fr; gap: 12px; margin: 6px 0 10px; min-height: 0; }
.hb-nav { display: flex; flex-direction: column; gap: 4px; }
.hb-nav button { border: 0; font: inherit; font-size: 15px; text-align: left; background: var(--paper2); color: var(--ink); padding: 6px 8px; cursor: pointer; }
.hb-nav button.on { background: var(--ink); color: #fff4dc; }
.hb-page { text-align: left; background: #fffaf0; box-shadow: inset 0 0 0 2px var(--paper2); padding: 8px 14px; max-height: min(60vh, 520px); overflow-y: auto; font-size: 15px; line-height: 1.4; }
.hb-page h4 { margin: 4px 0 8px; font-size: 20px; text-align: center; }
.hb-page ul, .hb-page ol { padding-left: 22px; }
.hb-page p, .hb-page ul, .hb-page ol { margin: 0 0 8px; } .hb-page li { margin-bottom: 3px; }
.hb-tip { background: #2b1d3a; color: #e6dcff; padding: 6px 10px; }
.hb-wheel { text-align: center; font-weight: 700; background: var(--paper2); padding: 6px; }
.hb-t { border-collapse: collapse; width: 100%; margin-bottom: 8px; font-size: 14px; } .hb-t th, .hb-t td { border: 2px solid var(--paper2); padding: 3px 6px; text-align: left; }
@media (max-width: 760px) {
  .hb-grid { grid-template-columns: 1fr; }
  .hb-nav { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .hb-nav button { white-space: nowrap; flex: none; }
  .hb-nav button span { display: none; } .hb-nav button.on span { display: inline; }
  .hb-page { max-height: 58vh; }
}
@media (max-width: 480px) { .hud-right .hb-btn { display: none; } }

/* ---------- title pitch + creator explainers ---------- */
.pitch { list-style: none; margin: 0 0 12px; padding: 0; text-align: left; font-size: 15px; line-height: 1.3; }
.pitch li { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 6px; }
.pitch li i { font-style: normal; font-size: 18px; line-height: 1.1; flex: none; }
.vhint { display: block; margin-top: 6px; line-height: 1.3; }
.born { background: #fffaf0; box-shadow: inset 0 0 0 2px var(--paper2); padding: 8px 10px; font-size: 15px; line-height: 1.35; margin: 10px 0; text-align: left; }
@media (max-width: 760px) { .pitch { font-size: 14px; } .pitch li { margin-bottom: 4px; } }

/* pixel-art item icons */
.pxi { image-rendering: pixelated; image-rendering: crisp-edges; display: inline-block; vertical-align: middle; }
.ge-slot .ic .pxi, .sh-it .ic .pxi { display: block; margin: 0 auto; }
.wm-drops .pxi { margin-right: 2px; }
.hx-it { display: inline-flex; align-items: center; gap: 2px; } .hx-it .pxi { margin: -3px 0; }
.lo-j b .pxi { margin: -3px 2px -3px 0; }

/* pixel-art emoji (swapped in by pixemoji.js) */
.pxe { display: inline-block; width: 1.15em; height: 1.15em; vertical-align: -0.22em; image-rendering: pixelated; image-rendering: crisp-edges; pointer-events: none; }

/* battle: status chips, element matchup, hit preview, log */
.hx-card .sts { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; }
.stc { font-size: 12px; padding: 1px 5px; background: #f0e2c4; box-shadow: inset 0 0 0 1px #c9a86a; white-space: nowrap; }
.stc.good { background: #e2f4dc; box-shadow: inset 0 0 0 1px #7cbf6a; } .stc.bad { background: #f8dcd6; box-shadow: inset 0 0 0 1px #d8846a; }
.stc b { font-size: 11px; margin-left: 1px; } .sts .none { color: var(--ink2); font-size: 12px; }
.mus { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
.mu { font-size: 12px; padding: 1px 6px; background: #f0e2c4; white-space: nowrap; } .mu.good { background: #d8f0cc; color: #245c30; } .mu.bad { background: #f8d4cc; color: #8a2a22; }
.pv { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin: 4px 0; padding: 4px 8px; background: #2b1d14; color: #fff4dc; font-size: 13px; }
.pv .pvd { color: #ffe07a; font-weight: 700; } .pv .good { color: #9fe0a0; } .pv .bad { color: #ffa08a; } .pv .ko { background: #c43c32; color: #fff; padding: 0 5px; }
.pv.far { opacity: .8; }
.hx-logbox { background: #fffaf0; box-shadow: inset 0 0 0 2px #e2cfa8; margin: 0 6px 4px; font-size: 13px; }
.hx-logbox summary { cursor: pointer; padding: 3px 8px; font-weight: 700; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hx-logbox summary .hx-last { font-weight: 400; color: var(--ink); }
.hx-logbox[open] summary .hx-last { display: none; }
.hx-log { list-style: none; margin: 0; padding: 0 8px 6px; max-height: 132px; overflow-y: auto; }
.hx-log li { padding: 2px 0 2px 8px; border-left: 3px solid #c9a86a; margin: 2px 0; line-height: 1.3; }
.hx-log li.me { border-color: #5aa64c; } .hx-log li.foe { border-color: #c43c32; }
.hx-log li.turn { border: 0; padding: 2px 0; color: var(--ink2); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.hx-log .dmg { color: #c43c32; } .hx-log .crit { color: #b8862a; }
.hexb > :not(.hx-arena) { flex-shrink: 0; }

/* Pixel logo: always a whole-number multiple of its 53x59 art grid */
.logo img { display: block; margin: 0 auto; image-rendering: pixelated; width: 212px; height: 236px; filter: drop-shadow(4px 4px 0 rgba(0,0,0,.35)); }
.logo h1 img { margin: 0 auto; }
@media (min-width: 720px) { .logo img { width: 265px; height: 295px; } }
@media (max-height: 640px) { .logo img { width: 159px; height: 177px; } }

/* links styled as menu buttons */
.menu a.btn { text-decoration: none; color: inherit; text-align: center; }

/* chat moderation + account deletion */
.chat-log .who { cursor: pointer; }
.chat-log .who:hover { text-decoration: underline; }
.btn.danger { --b: #8a2a22; --bd: #5a1a14; color: #fff4dc; }
.menu .danger-text { color: #a8321f; }
.modal .col { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.modal .q { font-style: italic; color: var(--ink2); word-wrap: break-word; }
.modal label.lbl { display: block; margin: 12px 0; }
.modal label.lbl input { display: block; width: 100%; box-sizing: border-box; margin-top: 6px; padding: 8px 10px; font: 16px var(--body, inherit); border: 3px solid var(--wood); background: #fffaf0; }
.modal .err { color: #a8321f; margin: 8px 0 0; }

/* ---- legibility pass ---- */
/* pixel fonts have no real italic: use colour for emphasis instead of a fake slant */
.chat-log .sys, .lm.empty, .modal .q { font-style: normal; }
.chat-log .sys { color: #6a4a2e; }
/* keep short labels on one line */
.plate small, .lo-j b { white-space: nowrap; }
.lo-j b { overflow: hidden; text-overflow: ellipsis; }
.lo-j.on b::after { content: '✓'; margin-left: 4px; }
/* nothing in the pixel heading font smaller than 10px */
.btn.small, .tst .btn small { font-size: 10px; }
.tinfo b { white-space: nowrap; }
/* battle info chips may wrap rather than run off the card */
.mu { white-space: normal; overflow-wrap: anywhere; }

/* ---- combat numbers: easy to tell 3, 6 and 8 apart ----
   In this pixel font the only difference between 3, 6 and 8 is a one-pixel gap. Bold fills that gap in
   and a soft glow smudges it, so numbers in battle use the regular weight, a bigger size, no glow,
   and a little space between digits. Emphasis comes from colour instead of bold. */
.hx-card .gbar, .hx-allies .gbar { height: 19px; }
.hx-card .gbar span, .hx-allies .gbar span { font-size: 15px; font-weight: 400; line-height: 19px; letter-spacing: 1px; text-shadow: none; color: #1a0f08; padding-left: 6px; }
.hexb b, .hexb strong, .hx-info .good, .hx-info .bad, .pv .pvd, .hx-allies .ally small { font-weight: 400; }
.pv { font-size: 15px; letter-spacing: .5px; }
.hx-logbox, .hx-info { letter-spacing: .3px; }

/* numbers in the heading font (battle screen) */
em.n { font-style: normal; font-family: var(--title); font-weight: 400; letter-spacing: 0; }
.hx-allies .ally .alv { margin: 0 4px; color: var(--wood); }

/* ---- player profile ---- */
.board.pf { max-width: 620px; }
.pf-loading { text-align: center; padding: 40px 0; }
.pf-head { display: flex; gap: 18px; align-items: flex-start; margin: 6px 0 14px; }
.pf-av-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 0 0 auto; }
.pf-av { width: 128px; height: 128px; background: var(--vc, #3a8a4a); box-shadow: 0 0 0 4px var(--ink), 0 0 0 8px #e8c06a, 0 0 0 12px var(--ink); margin: 12px; overflow: hidden; }
.pf-av img { display: block; width: 128px; height: 128px; object-fit: cover; }
.pf-av canvas { display: block; width: 128px; height: 128px; image-rendering: pixelated; background: linear-gradient(#a8d8ef, #f2e2b8); }
.pf-av-btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.pf-note { display: block; max-width: 160px; text-align: center; color: #a8321f; }
.pf-report { background: none; border: 0; color: #a8321f; font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; }
.pf-id { min-width: 0; padding-top: 10px; }
.pf-id h2 { margin: 0 0 6px; font-family: var(--title); font-size: 18px; line-height: 1.3; word-break: break-word; }
.pf-id p { margin: 4px 0; }
.pf-id .ttl { color: #9a6a10; }
.pf-rank { font-size: 17px; }
.pf-tags .tag { display: inline-block; margin: 4px 6px 0 0; padding: 2px 8px; background: #efe0bf; box-shadow: 0 0 0 2px var(--ink); font-size: 14px; }
.pf-tags .tag.gold { background: #f2c14a; }
.pf-info, .pf-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 8px 0; }
.pf-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pf-info > div, .pf-stats > div { background: #fffaf0; box-shadow: 0 0 0 2px #c9a978; padding: 6px 8px; min-width: 0; }
.pf-info small, .pf-stats small { display: block; color: var(--ink2); font-size: 13px; }
.pf-info b, .pf-stats b { display: block; font-size: 16px; font-weight: 400; overflow-wrap: anywhere; }
.pf-bh { margin: 16px 0 8px; font-family: var(--title); font-size: 13px; }
.pf-bh small { font-family: var(--body); font-size: 15px; color: var(--ink2); margin-left: 6px; }
.pf-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 14px; }
.bdg { display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 8px; background: #fffaf0; box-shadow: 0 0 0 2px #c9a978; min-width: 0; }
.bdg .bi { grid-row: span 2; font-size: 30px; line-height: 1; text-align: center; }
.bdg .bi .pxe { width: 32px; height: 32px; }
.bdg b { font-size: 14px; font-weight: 400; line-height: 1.2; }
.bdg small { font-size: 12px; color: var(--ink2); line-height: 1.25; }
.bdg.got { background: #fff3c4; box-shadow: 0 0 0 2px #c99a2c, 0 0 0 4px #fff3c4; }
.bdg.got b { color: #6a4a10; }
.bdg.locked { opacity: .72; }
.bdg.locked .bi > .pxe, .bdg.locked .bi > img { filter: grayscale(1) brightness(1.1); opacity: .45; }
.plate { transition: transform .1s; } .plate:hover { transform: translateY(-1px); }
@media (max-width: 520px) {
  .pf-head { flex-direction: column; align-items: center; text-align: center; gap: 4px; }
  .pf-info { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pf-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pf-badges { grid-template-columns: 1fr; }
}
.board.pf { width: min(640px, 100%); text-align: left; }
.board.pf > h3 { text-align: center; }
.board.pf > [data-x] { display: block; margin: 0 auto; }
.bdg .bi { position: relative; }
.bdg .bi .lk { position: absolute; right: -2px; bottom: -4px; font-style: normal; font-size: 14px; filter: none; }
.bdg .bi .lk .pxe { width: 16px; height: 16px; }
.board.pf { overflow-x: hidden; }

/* test server markers */
.test-badge { position: fixed; left: 50%; bottom: 4px; transform: translateX(-50%); z-index: 9999; pointer-events: none; font-family: var(--title); font-size: 10px; letter-spacing: 1px; color: #fff; background: #7a2fd0; padding: 4px 8px; box-shadow: 0 0 0 2px #2a0f4a; opacity: .9; }
.test-note { background: #efe2ff; box-shadow: 0 0 0 2px #7a2fd0; padding: 8px 10px; color: #2a0f4a; }

/* phones: the top bar must fit on a 320px-wide screen (Menu was pushed off the edge) */
.plate { min-width: 0; flex: 0 1 auto; } .plate > div { min-width: 0; } .hud-right { flex: none; }
@media (max-width: 480px) {
  .hud-top { left: 6px; right: 6px; }
  .hud-right { gap: 6px; }
  .online .ow, #menuBtn .ml { display: none; }
  .plate { gap: 6px; padding-right: 8px; }
  .plate b, .plate small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hud-right .btn.small { padding-left: 9px; padding-right: 9px; }
}
@media (max-width: 400px) {
  .hud-right .train-btn { font-size: 8px; padding-left: 7px; padding-right: 7px; }
  .plate .face { width: 30px; height: 30px; }
  .plate { padding: 5px 7px 5px 5px; }
}

/* reassurance under the Google button */
.safe-note { display: grid; gap: 4px; text-align: left; margin: 12px 0 0; padding: 10px 12px; background: #e9f5e3; box-shadow: 0 0 0 2px #3d7a35; color: var(--ink); font-size: 15px; line-height: 1.35; }
.safe-note > b { color: #24521f; }
.safe-note a { color: #24521f; font-weight: 700; }

/* Google's own sign-in button */
.gsi { display: flex; justify-content: center; min-height: 44px; margin: 4px auto 0; }
.gsi.busy { opacity: .5; pointer-events: none; }

/* Discord sign-in button (Discord's blurple) */
.btn.discord { --b: #5865f2; --bd: #3c45a5; color: #fff; text-shadow: none; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; gap: 12px; padding: 14px 18px; margin-top: 10px; min-width: 260px; }
.dicon { width: 20px; height: 16px; flex: none; background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 127.14 96.36'%3E%3Cpath fill='%23fff' d='M107.7 8.07A105.15 105.15 0 0 0 81.47 0a72.06 72.06 0 0 0-3.36 6.83 97.68 97.68 0 0 0-29.11 0A72.37 72.37 0 0 0 45.64 0a105.89 105.89 0 0 0-26.25 8.09C2.79 32.65-1.71 56.6.54 80.21a105.73 105.73 0 0 0 32.17 16.15 77.7 77.7 0 0 0 6.89-11.11 68.42 68.42 0 0 1-10.85-5.18c.91-.66 1.8-1.34 2.66-2a75.57 75.57 0 0 0 64.32 0c.87.71 1.76 1.39 2.66 2a68.68 68.68 0 0 1-10.87 5.19 77 77 0 0 0 6.89 11.1 105.25 105.25 0 0 0 32.19-16.14c2.64-27.38-4.51-51.11-18.9-72.15ZM42.45 65.69C36.18 65.69 31 60 31 53s5-12.74 11.43-12.74S54 46 53.89 53s-5.05 12.69-11.44 12.69Zm42.24 0C78.41 65.69 73.25 60 73.25 53s5-12.74 11.44-12.74S96.23 46 96.12 53s-5.04 12.69-11.43 12.69Z'/%3E%3C/svg%3E"); }

/* email sign-in */
.linkbtn { background: none; border: 0; padding: 6px 4px; color: var(--ink2); font: inherit; font-size: 15px; text-decoration: underline; cursor: pointer; }
.linkbtn:hover { color: var(--ink); }
.em-open { display: block; margin: 10px auto 0; }
.em-box { margin: 8px 0 0; padding: 12px; background: rgba(255,255,255,.35); box-shadow: 0 0 0 2px var(--ink2); text-align: left; }
.em-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px; }
.em-tabs button { font: inherit; font-size: 15px; padding: 8px; border: 0; cursor: pointer; background: var(--paper2); color: var(--ink2); box-shadow: 0 0 0 2px var(--ink2); }
.em-tabs button.on { background: var(--ink); color: #fff4dc; box-shadow: 0 0 0 2px var(--ink); font-weight: 700; }
.em-form { display: grid; gap: 8px; }
.em-form label { display: grid; gap: 3px; font-size: 15px; font-weight: 700; color: var(--ink); }
.em-form input[type=email], .em-form input[type=password] { font: inherit; font-size: 16px; font-weight: 400; padding: 9px 10px; border: 0; background: #fffaf0; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink2); width: 100%; box-sizing: border-box; }
.em-form input:focus { outline: 3px solid var(--gold); outline-offset: 1px; }
.em-check { grid-template-columns: auto 1fr !important; align-items: start; gap: 8px !important; font-weight: 400 !important; }
.em-check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--ink); }
.em-hint, .em-fine { margin: 0; font-size: 13px; color: var(--ink2); }
.em-fine a { color: var(--ink); }
.em-err { margin: 0; padding: 6px 8px; background: #fbe1dc; box-shadow: 0 0 0 2px #b02a2a; color: #7a1a12; font-size: 14px; }
.em-go { width: 100%; margin-top: 2px; }
.em-sent { display: grid; gap: 6px; text-align: center; justify-items: center; }
.em-sent p { margin: 0; font-size: 15px; }
.em-mail { font-size: 34px; }
.em-newpw { max-width: 420px; }
.em-newpw h3 { font-family: var(--title); font-size: 14px; margin: 0 0 10px; text-align: center; }
.ts { display: flex; justify-content: center; margin-top: 8px; }
.ts:empty { display: none; }

.ts.need { flex-direction: column; align-items: center; gap: 6px; padding: 8px; background: #fff3c4; box-shadow: 0 0 0 3px var(--gold); }
.ts.need::before { content: attr(data-need); font-size: 15px; font-weight: 700; color: var(--ink); }
