/* Crusader Tactics: the look of the game screen. Written new to match the old
   game's final look (Nightfall gothic skin with Tiny Swords panels). Pictures
   come from assets/ui. */
:root { --gold: #e8bf5e; --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px); }
html, body { height: 100%; margin: 0; overflow: hidden; }
body {
  background: #0c0507; color: #f6e6c4;
  font: 600 17px/1.2 'EB Garamond', Garamond, Georgia, 'Times New Roman', serif;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
}
button { touch-action: manipulation; font-family: inherit; cursor: pointer; }
[hidden] { display: none !important; }
#map { position: fixed; inset: 0; display: block; touch-action: none; }

/* ---------- buttons ---------- */
.b {
  border: 14px solid transparent; border-image: url(../assets/ui/btnn.png) 64 fill / 14px stretch;
  background: none; color: #fff1d6; text-shadow: 0 2px 0 #2a0408, 0 0 4px #000;
  padding: 0 6px; min-height: 46px; font: 700 15px 'EB Garamond', Garamond, Georgia, serif; letter-spacing: .06em;
}
.b:active { border-image-source: url(../assets/ui/btnnp.png); }
.b.on { border-image-source: url(../assets/ui/btng.png); color: #2a1606; text-shadow: 0 1px 0 #ffe6a8; }
.b:disabled { filter: grayscale(.85) brightness(.75); opacity: .6; }
.b.red, .redb {
  border: 14px solid transparent; border-image: url(../assets/ui/btna.png) 64 fill / 14px stretch; background: none;
  color: #fff1d6; text-shadow: 0 2px 0 #2a0408, 0 0 4px #000;
  font-family: 'Grenze Gotisch', 'UnifrakturCook', Georgia, serif; letter-spacing: .05em; font-weight: 800;
}
.redb { min-width: 230px; min-height: 62px; font-size: 28px; letter-spacing: .1em; }

/* ---------- floating panels ---------- */
.panel {
  position: fixed; z-index: 4;
  background: linear-gradient(180deg, rgba(28,10,14,.96), rgba(10,4,6,.96)); border: 1px solid #c9a24a;
  box-shadow: 0 0 0 2px #120608, 0 0 0 3px #6a4a1a, 0 10px 24px rgba(0,0,0,.7);
  color: #efe3c8; font-family: 'EB Garamond', Garamond, Georgia, serif;
}
#chip {
  right: 8px; top: calc(8px + var(--safe-t)); z-index: 50; display: flex; align-items: center; gap: 6px;
  padding: 4px 6px 4px 12px; font: 600 13px 'EB Garamond', Georgia, serif; letter-spacing: .12em; text-transform: uppercase;
}
.ib { background: none; border: 1px solid #6a4a1a; color: #f2c14e; font-size: 18px; width: 36px; height: 34px; line-height: 1; padding: 0; }

/* the message line under the chip */
#toast {
  position: fixed; left: 50%; transform: translateX(-50%); top: calc(var(--safe-t) + 74px); z-index: 8;
  max-width: 86vw; pointer-events: none; text-align: center;
}
#log {
  display: inline-block; background: rgba(10,4,6,.78); border: 1px solid rgba(201,162,74,.5); padding: 5px 12px;
  font: 500 13px 'EB Garamond', Georgia, serif; color: #e8dcc0;
}
#log:empty { display: none; }
#log { transition: opacity .4s; }
#log.gone { opacity: 0; }

#endTurn { position: fixed; right: 10px; bottom: calc(14px + var(--safe-b)); z-index: 4; min-height: 44px; padding: 0 18px; font-size: 15px; }
#endTurn.pulse { animation: endpulse 1.2s ease-in-out infinite; }
@keyframes endpulse { 0%, 100% { filter: none; transform: scale(1); } 50% { filter: brightness(1.35) drop-shadow(0 0 10px #f2c14e); transform: scale(1.05); } }

#mini {
  position: fixed; right: 8px; top: calc(54px + var(--safe-t)); z-index: 4; border-radius: 8px;
  box-shadow: 0 2px 12px #000c; border: 1.5px solid var(--gold); touch-action: none; cursor: pointer;
}

/* ---------- title ---------- */
#title { position: fixed; inset: 0; z-index: 20; background: #05030a; overflow: hidden; }
#titleArt { position: absolute; inset: 0; background: #05030a url(../assets/title/background.webp) center top / cover no-repeat; image-rendering: pixelated; z-index: 0; }
#titleFx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.titlePanel {
  position: absolute; left: 0; right: 0; bottom: calc(14vh + var(--safe-b)); z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
}
#loading p { color: #e8bf5e; font-size: 18px; text-shadow: 0 2px 0 #000; }
#version {
  position: fixed; left: calc(env(safe-area-inset-left, 0px) + 10px); bottom: calc(var(--safe-b) + 4px); z-index: 25;
  font: 600 12px/1 'EB Garamond', Georgia, serif; color: rgba(217,194,122,.75); pointer-events: none; text-shadow: 0 1px 2px #000;
}

/* ---------- battle panels ---------- */
#menu, #sub {
  right: 10px; top: 40%; min-width: 150px; max-width: 220px; padding: 2px 0; z-index: 7;
  border: 13px solid transparent; border-image: url(../assets/ui/wood.png) 64 fill / 13px stretch; background: none; box-shadow: none;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.55));
}
#menu .row, #sub .row {
  display: block; width: 100%; height: 34px; padding: 0 8px 0 19px; border: 0; background: none; text-align: left;
  font: 600 14px 'EB Garamond', Georgia, serif; color: #fff1d6; text-shadow: 0 2px 0 #2a0e04; white-space: nowrap;
}
#menu .row:active, #menu .row.on, #sub .row:active { border: 7px solid transparent; border-image: url(../assets/ui/btnt.png) 48 fill / 7px stretch; color: #2a1606; text-shadow: 0 1px 0 #ffe6a8; }
#menu .row:disabled, #sub .row:disabled { opacity: .45; }
#menu b.weak, #sub b.weak { color: #f2c14e; font-weight: 800; }
#forecast, #aimPanel {
  left: 8px; right: 8px; bottom: calc(var(--safe-b) + 8px); padding: 8px 10px; z-index: 5; font-size: 14px; line-height: 19px;
}
#forecast.red { border-color: #d0343e; background: linear-gradient(180deg, rgba(40,8,12,.96), rgba(14,3,5,.96)); }
#forecast.green { border-color: #4cd97b; }
#forecast .fh, #aimPanel .fh { font: 700 13px 'EB Garamond', Georgia, serif; letter-spacing: .1em; text-transform: uppercase; color: #ff9a8a; border-bottom: 1px solid rgba(208,52,62,.45); padding-bottom: 3px; margin-bottom: 3px; }
#forecast.green .fh { color: #8ff0b0; }
#forecast .fd { color: #ffd77a; }
#forecast .fs, #aimPanel .fs { font-size: 12px; color: #c9b89a; line-height: 15px; margin-top: 2px; }
#forecast .fr, #aimPanel .fr { display: flex; gap: 6px; margin-top: 6px; }
#forecast .fr .b, #aimPanel .fr .b { flex: 1; min-height: 46px; }

#prepare { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + var(--safe-b)); z-index: 4; display: flex; flex-direction: column; align-items: center; gap: 8px; }
#prepBtns { display: flex; gap: 8px; white-space: nowrap; }
#forms { display: flex; gap: 6px; }
.fb { width: 42px; height: 36px; padding: 0; font: 700 16px 'EB Garamond', Georgia, serif; color: rgba(233, 207, 138, .45); background: rgba(12, 5, 7, .45); border: 1px solid rgba(233, 207, 138, .35); border-radius: 6px; }
.fb.on { color: #ffe6a8; background: #3a2c14; border-color: #e9cf8a; }
#prepare .b { min-height: 52px; padding: 0 22px; font-size: 18px; }
#formAsk { position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 14; }
.cover { position: fixed; inset: 0; z-index: 12; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; }
/* Hero sheets open below the clock and battery. The floor bar hides while one
   is open, and comes back when it closes (owner, 2026-10-17). */
#gearWin, #shopWin, #skillsWin, #settingsWin, #slotsWin, #floorsWin {
  z-index: 60; box-sizing: border-box; align-items: flex-start;
  padding: calc(var(--safe-t) + 10px) 8px calc(var(--safe-b) + 10px);
}
body:has(#gearWin:not([hidden])) #chip,
body:has(#shopWin:not([hidden])) #chip,
body:has(#skillsWin:not([hidden])) #chip,
body:has(#settingsWin:not([hidden])) #chip,
body:has(#slotsWin:not([hidden])) #chip,
body:has(#floorsWin:not([hidden])) #chip { display: none !important; }
#gearWin .box, #shopWin .box, #skillsWin .box, #settingsWin .box, #slotsWin .box, #floorsWin .box { max-height: 100%; }
.xclose {
  position: sticky; top: 0; float: right; z-index: 3; margin: 0 0 6px 8px;
  width: 44px; height: 44px; padding: 0; font-size: 22px; line-height: 1; color: #f2c14e;
  background: rgba(14,5,8,.95); border: 1px solid #c9a24a; border-radius: 50%; box-shadow: 0 2px 8px rgba(0,0,0,.6);
}
.box { position: relative; width: min(340px, 90vw); max-height: 86vh; overflow: auto; padding: 14px 16px; font-size: 15px; line-height: 20px; text-align: center; }
#decision { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 12; }
.box .ttl { font: 700 18px 'Grenze Gotisch', 'EB Garamond', Georgia, serif; letter-spacing: .08em; color: #f2c14e; text-transform: uppercase; margin-bottom: 6px; }
.box p { margin: 6px 0; }
.box .b { margin-top: 8px; min-width: 160px; }

/* ---------- team picker (the old "Choose 5 heroes" screen) ---------- */
.picker {
  position: relative; width: min(560px, 96vw); max-height: 92vh; display: flex; flex-direction: column; padding: 10px;
  border: 20px solid transparent; border-image: url(../assets/ui/spec.png) 64 fill / 20px stretch; background: none; box-shadow: 0 8px 22px rgba(0,0,0,.6);
}
.picker h3 { margin: 0; text-align: center; font: 800 32px 'Grenze Gotisch', Georgia, serif; letter-spacing: .05em; color: #e8bf5e; text-shadow: 0 2px 0 #000; }
#teamCount { color: #ffd45a; text-align: center; font-size: 20px; margin: 4px 0 8px; }
#teamGrid {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; align-content: start; padding: 2px;
}
.card {
  font: inherit; color: #fff; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center;
  border: 14px solid transparent; border-image: url(../assets/ui/spec.png) 64 fill / 14px stretch; background: none; padding: 2px;
}
.card.on { border: 22px solid transparent; border-image: url(../assets/ui/wood.png) 128 fill / 22px stretch; }
.card img { height: 54px; max-width: 100%; object-fit: contain; image-rendering: pixelated; }
.card b { font-size: 17px; }
.card small { color: #d9b8c0; font-size: 12px; }
.card .weap { color: #ffd45a; }
.card .abil { color: #8fc8ff; }
.pickRow { display: flex; gap: 10px; justify-content: center; align-items: center; padding-top: 8px; }
.pickRow .redb { min-width: 160px; min-height: 56px; font-size: 24px; }
.pickRow .redb:disabled { filter: grayscale(.85) brightness(.75); opacity: .6; }

#skip { position: fixed; right: 10px; bottom: calc(14px + var(--safe-b)); z-index: 6; min-height: 44px; padding: 0 16px; }

/* ---------- system menu, settings, floor list, saves, gear sheet ---------- */
#sys { right: 8px; top: calc(56px + var(--safe-t)); width: min(240px, calc(100vw - 16px)); max-height: calc(100vh - 70px); overflow: auto; z-index: 51; padding: 8px 0 10px; }
.sysh { padding: 2px 14px 6px; font-size: 13px; color: #c9b89a; border-bottom: 1px solid rgba(201,162,74,.35); margin-bottom: 4px; }
.sysh img { width: 18px; height: 18px; vertical-align: -4px; }
#sys .row { display: block; width: 100%; border: 0; background: none; text-align: left; padding: 9px 16px 9px 26px; font: 600 15px 'EB Garamond', Georgia, serif; letter-spacing: .08em; text-transform: uppercase; color: #efe3c8; text-shadow: 0 1px 2px #000; }
#sys .row:active { background: linear-gradient(90deg, rgba(201,162,74,.34), rgba(201,162,74,0)); }
#sEnd { color: #ff9a8a !important; }
.lbl { font: 600 10px 'EB Garamond', Georgia, serif; letter-spacing: .2em; text-transform: uppercase; color: #b89a6a; padding: 8px 14px 2px; }
.mrow { display: flex; align-items: center; gap: 12px; padding: 8px 14px; font: 500 15px 'EB Garamond', Georgia, serif; color: #efe3c8; }
.mrow > span { flex: 1; }
.mrow small { font-size: 12px; color: #c9b89a; }
.mrow input[type=range] { flex: 1; }
.sw { flex: none; width: 48px; height: 27px; border-radius: 14px; background: #2a1014; border: 1px solid #6a4a1a; position: relative; padding: 0; }
.sw i { position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: #a89a82; transition: left .15s; }
.sw.on { background: linear-gradient(#a4202c, #5a0c14); border-color: #e2c26a; }
.sw.on i { left: 24px; background: #ffe9b0; }
.seg { display: flex; border: 1px solid #6a4a1a; flex: none; }
.seg button { background: none; border: none; color: #d8ccb0; font: 600 12px 'EB Garamond', Georgia, serif; letter-spacing: .1em; text-transform: uppercase; padding: 7px 10px; min-height: 34px; }
.seg button.on { background: linear-gradient(#a4202c, #5a0c14); color: #fff3d0; }
.mbtns { display: flex; gap: 8px; padding: 8px 14px 4px; }
.mb { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; background: linear-gradient(180deg, rgba(40,12,16,.95), rgba(14,5,8,.95)); border: 1px solid #c9a24a; color: #e9cf8a; font: 600 11px 'EB Garamond', Georgia, serif; letter-spacing: .14em; text-transform: uppercase; }
.b.wide { display: block; width: calc(100% - 28px); margin: 2px 14px; }
.box.wide { width: min(520px, 94vw); text-align: left; }
.box h4 { font: 700 12px 'EB Garamond', Georgia, serif; letter-spacing: .2em; text-transform: uppercase; color: #b89a6a; margin: 12px 0 4px; }
.btns { display: flex; flex-wrap: wrap; gap: 6px; }
.box > .b { display: block; margin: 10px auto 0; }
.srow { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.srow .b { min-height: 40px; }
.afx { color: #9fd8ff; }
.list { max-height: 60vh; overflow: auto; }
.fl { display: block; width: 100%; background: none; border: none; border-bottom: 1px solid rgba(201,162,74,.18); color: #efe3c8; padding: 8px 6px; text-align: left; font: 15px 'EB Garamond', Georgia, serif; }
.fl.cur { background: rgba(201,162,74,.12); }
.fl span { display: block; }
.fl i { font: 700 10px system-ui, sans-serif; font-style: normal; padding: 1px 6px; border-radius: 8px; margin: 3px 4px 0 0; display: inline-block; background: #2a1014; border: 1px solid #6a4a1a; }
.t-ok { color: #8ff0b0; } .t-b { color: #ff9a8a; } .t-ch { color: #f2c14e; } .t-c { color: #8fc8ff; } .t-top { color: #fff; } .t-s { color: #d8ccb0; } .t-e { color: #ffb36a; }
.gold img { width: 20px; height: 20px; vertical-align: -4px; }
.box .tabs, .sheet .tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.box .tabs button, .sheet .tabs button { background: rgba(40,10,14,.65); border: 1px solid rgba(201,162,74,.45); color: #efe3c8; font: 600 13px 'EB Garamond', Georgia, serif; padding: 6px 10px; border-radius: 4px; }
.box .tabs button.on, .sheet .tabs button.on { background: linear-gradient(#6a1a22, #3a0c12); border-color: #d9c27a; color: #ffe6a8; }
.sheet .who { display: flex; gap: 10px; align-items: center; }
.sheet .who img { height: 64px; image-rendering: pixelated; }
.sheet .weap { color: #ffd45a; }
.pick { display: block; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.pick input { transform: scale(1.3); margin-right: 8px; }

#aimPanel .fh { color: #ffd77a; }
#menu .abl { color: #ffd77a; }
#menu, #sub { min-width: 112px; max-width: 190px; }
/* monster info and terrain boxes, top left [old einfo, terr] */
#einfo { left: 8px; top: calc(52px + var(--safe-t)); width: min(270px, 64vw); padding: 8px 10px; font-size: 13px; line-height: 17px; }
.ei-top { display: flex; gap: 8px; }
.ei-por { width: 52px; height: 52px; flex: none; border: 1px solid #6a4a1a; background: #14070a center / contain no-repeat; image-rendering: pixelated; }
.ei-mid { flex: 1; min-width: 0; }
.ei-nm { font: 700 14px 'EB Garamond', Georgia, serif; letter-spacing: .06em; color: #ff9a8a; text-transform: uppercase; }
.ei-hb { height: 7px; background: #2a0a0e; border: 1px solid #6a4a1a; margin: 4px 0; }
.ei-hb i { display: block; height: 100%; }
.ei-wk { font-size: 12px; color: #ffb36a; margin-top: 4px; }
.ei-sk { font-size: 11px; color: #c9b89a; margin-top: 4px; }
.pills { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.pill { font: 700 10px system-ui, sans-serif; padding: 2px 6px; border-radius: 9px; border: 1px solid rgba(255,255,255,.3); }
.pill.d { background: #5a1018; color: #ffd0d0; } .pill.b { background: #10305a; color: #cfe4ff; }
#terr { left: 8px; top: calc(52px + var(--safe-t)); padding: 5px 10px; font-size: 12px; line-height: 15px; }
#terr .tn { font: 700 12px 'EB Garamond', Georgia, serif; letter-spacing: .14em; text-transform: uppercase; color: #e9cf8a; }
#forecast .af { color: #ff8a7a; } #forecast .dim { color: #b89a8a; } #forecast b { color: #fff3dc; }
#forecast .fd, #forecast b.fd { color: #ffd77a; } #forecast .weak { color: #f2c14e; } #forecast .resist { color: #9aa6c8; }
#forecast .ko { color: #fff; background: #a4202c; padding: 0 4px; font-size: 10px; border-radius: 3px; }
#forecast .you { font-size: 11px; color: #8fc8ff; margin-top: 1px; }
#forecast .skills { display: flex; gap: 6px; overflow-x: auto; margin: 6px 0; scrollbar-width: none; }
#forecast .skills::-webkit-scrollbar { display: none; }
#forecast .skills button { flex: 0 0 auto; min-height: 40px; padding: 4px 12px; border: 1px solid rgba(201,162,74,.45); background: rgba(40,10,14,.65); color: #efe3c8; font: 600 14px 'EB Garamond', Georgia, serif; border-radius: 4px; }
#forecast .skills button.on { background: linear-gradient(#6a1a22, #3a0c12); border-color: #d9c27a; color: #ffe6a8; }
#forecast .fr .b { flex: 1 1 0; }
#forecast .fr .go { flex: 2.2 1 0; }
.srow .ic { width: 36px; height: 36px; flex: none; image-rendering: pixelated; }
.srow > span:not(.btns) { flex: 1; }
.cmp .up { color: #8ff0b0; } .cmp .dn { color: #ff8a8a; } .cmp span { margin-right: 6px; } .cmp { color: #c9b89a; }
.why { color: #ff8a8a; }
.capt { display: inline-block; margin-left: 6px; font: 700 11px system-ui, sans-serif; color: #1a0a06; background: #ffb36a; padding: 2px 8px; border-radius: 8px; }
.srow > span:not(.btns) { min-width: 0; }
.srow .btns { flex: none; display: flex; flex-direction: column; gap: 4px; width: 104px; }
.srow .btns .b, .srow > .b { min-height: 38px; padding: 0 4px; font-size: 13px; border-width: 10px; border-image-width: 10px; }
.srow > .b { flex: none; width: 104px; }
.srow .btns .b, .srow > .b { box-sizing: border-box; width: 100%; }
.srow > .b { width: 104px; }

/* The import window: file picker and paste box fill the panel. */
#slotsWin textarea, #slotsWin input[type=file] { display: block; width: 100%; box-sizing: border-box; margin: 6px 0; font: 12px ui-monospace, Menlo, monospace; color: #e8dcc0; }
#slotsWin textarea { background: #1a0d10; border: 1px solid #6a4a1a; border-radius: 6px; padding: 6px; }

/* Map controls stay off the battlefield until the eye in the top left is tapped. */
#mapEye {
  position: fixed; z-index: 6;
  left: calc(6px + env(safe-area-inset-left, 0px));
  top: calc(8px + var(--safe-t));
  width: 40px; height: 40px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; border-radius: 8px;
  color: rgba(233, 207, 138, .72);
}
#mapEye.on { color: #ffe6a8; background: rgba(12, 5, 7, .35); }
#mapEye:active { color: #fff; }
#mapbar {
  position: fixed; z-index: 5;
  left: calc(6px + env(safe-area-inset-left, 0px));
  top: calc(52px + var(--safe-t));
  display: flex; flex-direction: column; gap: 4px;
}
#mapbar .mb2 {
  width: 40px; height: 40px; padding: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(12, 5, 7, .82); border: 1px solid #6a4a1a; border-radius: 6px;
  color: #e9cf8a; font: 700 13px 'EB Garamond', Georgia, serif;
}
#mapbar .mb2.on { border-color: #e8bf5e; background: rgba(90, 16, 22, .92); color: #ffe6a8; }
#mapbar .mb2:active { background: rgba(201, 162, 74, .28); }
#mapbar svg { color: inherit; }
.mrow svg { color: #e9cf8a; }
.mrow .zb { flex: none; background: none; border: 1px solid #6a4a1a; border-radius: 4px; width: 38px; height: 34px; padding: 0; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.mrow .zb:active { background: rgba(201,162,74,.18); }
.b.wide svg { vertical-align: -3px; }

/* First-time tips [old #tipw]. */
#tipw { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(118px + env(safe-area-inset-bottom, 0px)); z-index: 30; width: min(340px, 90vw); padding: 10px 12px; font-size: 14px; line-height: 19px; text-align: center; }
#tipw .tip-h { font: 700 11px 'EB Garamond', Georgia, serif; letter-spacing: .2em; text-transform: uppercase; color: #f2c14e; margin-bottom: 3px; }
#tipw .b { margin-top: 8px; min-height: 36px; min-width: 120px; }

/* Settings tabs and the report box. */
.sets .tabs { flex-wrap: wrap; }
.sets h4 { margin: 12px 0 4px; }
.sets p { font-size: 14px; line-height: 19px; }
.sets ul { margin: 4px 0 4px 18px; padding: 0; font-size: 14px; }
.sets a { color: #ffd77a; }
#settingsWin textarea { display: block; width: 100%; box-sizing: border-box; margin: 6px 0; font: 12px ui-monospace, Menlo, monospace; color: #e8dcc0; background: #1a0d10; border: 1px solid #6a4a1a; border-radius: 6px; padding: 6px; }

/* The level-cap notice [old #capw, .cap-box]. */
#capw { position: fixed; inset: 0; z-index: 32; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; }
#capw[hidden] { display: none; }
.cap-box { position: relative; width: min(340px, 90vw); padding: 14px 16px; font-size: 15px; line-height: 20px; text-align: center; }
.cap-t { font: 700 18px 'Grenze Gotisch', 'EB Garamond', Georgia, serif; letter-spacing: .08em; color: #f2c14e; text-transform: uppercase; margin-bottom: 6px; }
.cap-box p { margin: 6px 0; }
.cap-box .b { margin-top: 8px; min-width: 160px; }

/* The target's counterattack in the forecast (Phase 9). */
#forecast .ctr { font-size: 12px; color: #ffb0a0; margin-top: 2px; }
#forecast .ctr.dim { color: #c9b89a; }

/* The attack window (owner's design B, 2026-10-12): menu-sized, a crimson
   wooden frame (green for heals and buffs), floating beside the hero. */
#forecast.atk { left: auto; right: auto; bottom: auto; width: 196px; box-sizing: border-box; padding: 15px 15px 13px 18px; border: none; background: none; box-shadow: none;
  font: 600 13px 'EB Garamond', Georgia, serif; line-height: 18px; color: #fff1d6; text-shadow: 0 2px 0 #2a0e04; filter: drop-shadow(0 6px 10px rgba(0,0,0,.55)); }
#forecast.atk .frame { position: absolute; inset: 0; z-index: -1; border: 13px solid transparent; border-image: url(../assets/ui/wood.png) 64 fill / 13px stretch;
  filter: saturate(1.6) hue-rotate(-22deg) brightness(.55) contrast(1.15); }
#forecast.atk.green .frame { filter: saturate(1.4) hue-rotate(70deg) brightness(.5) contrast(1.1); }
#forecast.atk .fh { font-size: 12px; color: #ffc2b4; border-bottom: 1px solid rgba(255,190,170,.35); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#forecast.atk.green .fh { color: #b8ffd0; }
#forecast.atk .hpbar { height: 7px; background: #2a0c10; border: 1px solid #000; margin: 3px 0 1px; position: relative; }
#forecast.atk .hpbar i { position: absolute; left: 0; top: 0; bottom: 0; background: #e5484d; }
#forecast.atk .hpbar b { position: absolute; top: 0; bottom: 0; background: #ffd77a; opacity: .9; }
#forecast.atk .ctr { font-size: 12px; line-height: 16px; color: #ffc9bd; }
#forecast.atk .pills { margin-top: 3px; }
#forecast.atk .sk { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; height: 30px; border: 1px solid rgba(255,215,122,.6); border-radius: 4px; background: rgba(30,6,8,.75); }
#forecast.atk .sk span { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#forecast.atk .sk button, #forecast.atk .icons button { background: none; border: 0; color: #ffd77a; font-size: 14px; padding: 0 8px; height: 100%; }
#forecast.atk .icons { display: flex; justify-content: space-between; margin-top: 5px; }
#forecast.atk .icons button { width: 34px; height: 30px; border: 1px solid rgba(255,200,160,.45); border-radius: 4px; background: rgba(60,10,14,.6); color: #fff1d6; padding: 0; }
#forecast.atk button:disabled { opacity: .35; }
#forecast.atk .cap { text-align: center; font-size: 10px; color: #e8cfc0; margin-top: 1px; }
#forecast.atk .go { display: block; width: 100%; margin-top: 4px; min-height: 0; height: 30px; padding: 0; border: 7px solid transparent; border-image: url(../assets/ui/btnt.png) 48 fill / 7px stretch; background: none; color: #2a1606; text-shadow: 0 1px 0 #ffe6a8; font: 700 13px 'EB Garamond', Georgia, serif; line-height: 14px; }

/* ---------- the Skills window (owner, 2026-10-16) ---------- */
.skw h4 { margin: 12px 0 4px; }
.skc { text-align: left; padding: 8px 10px; margin: 6px 0; border: 1px solid rgba(201,162,74,.35); border-radius: 6px; background: rgba(40,10,14,.45); }
.skc.ult { border-color: rgba(242,193,78,.7); }
.skc.ult .skn b { color: #f2c14e; }
.skc[data-pick] { cursor: pointer; }
.skc.on { border-color: #6ee7a0; background: rgba(10,50,28,.55); }
.skc .skn { display: flex; align-items: center; gap: 8px; }
.skc .skn b { flex: 1; }
.skc .tick { width: 24px; height: 24px; border: 1px solid #c9a24a; border-radius: 4px; text-align: center; line-height: 22px; color: #6ee7a0; font-weight: 700; }
.skc .chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.skc .chips i { font: 600 11px ui-monospace, Menlo, monospace; font-style: normal; color: #cfe3ff; background: rgba(3,18,58,.7); border: 1px solid rgba(106,184,255,.35); border-radius: 4px; padding: 1px 6px; }
.skc small { display: block; color: #e6d8b8; line-height: 17px; }
.skc .wait { font: 600 11px system-ui, sans-serif; color: #ffb36a; }
.skc .rdy { font: 600 11px system-ui, sans-serif; color: #6ee7a0; }
.skw .btns { display: flex; gap: 8px; justify-content: center; }
.skw .btns .b { min-width: 120px; }

/* what the chosen skill does, in the attack window (owner, 2026-10-16) */
#forecast.atk .does { margin: 2px 0 4px; padding: 4px 6px; font-size: 12px; line-height: 15px; color: #f3dccf; background: rgba(0,0,0,.28); border: 1px solid rgba(255,190,170,.25); border-radius: 4px; text-align: left; }
#forecast.atk .does .tags { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 3px; }
#forecast.atk .does i { font: 700 10px ui-monospace, Menlo, monospace; font-style: normal; padding: 0 5px; border-radius: 3px; background: rgba(255,255,255,.1); color: #ffe6a8; }
#forecast.atk .does .el-fire { color: #ff8a5e; } #forecast.atk .does .el-ice { color: #9fe0ff; } #forecast.atk .does .el-elec { color: #f7ea6a; }
#forecast.atk .does .el-light { color: #fff6c8; } #forecast.atk .does .el-dark { color: #c4a4ff; }

/* ---------- versus: picker, hand-over, clocks (owner signed off, 2026-10-16) ---------- */
#vsMenu .dim { opacity: .6; }
#vsPick { z-index: 30; }
.vsp { position: relative; width: min(560px, 96vw); max-height: 92vh; display: flex; flex-direction: column; padding: 12px; }
.vsP { font: 700 14px 'EB Garamond', Georgia, serif; letter-spacing: .14em; text-align: center; }
.vsp h3 { margin: 0; text-align: center; font: 800 30px 'Grenze Gotisch', Georgia, serif; color: #e8bf5e; }
.vsCount { text-align: center; color: #ffd45a; font-size: 15px; margin: 2px 0 8px; }
.vsGrid { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; align-content: start; padding: 2px; }
.vsGrid .card img { height: 64px; image-rendering: pixelated; }
.vsp .asc { display: flex; gap: 3px; margin-top: 6px; flex-wrap: wrap; }
.vsp .asc i { flex: 1 1 30%; font: 600 11px 'EB Garamond', Georgia, serif; font-style: normal; padding: 5px 2px; border: 1px solid rgba(201,162,74,.5); border-radius: 4px; color: #efe3c8; background: rgba(30,6,8,.6); text-align: center; }
.vsp .asc i.on { background: linear-gradient(#8a6a1a, #4a3008); border-color: #ffe6a8; color: #ffe6a8; }
.vsp .pas { display: block; font-size: 11px; line-height: 13px; color: #ffd77a; margin-top: 4px; }
.vsp .pas em { display: block; color: #c9b89a; font-style: normal; }
.vsp .btns { display: flex; gap: 8px; justify-content: center; margin-top: 8px; }
.vsHand { z-index: 40; flex-direction: column; gap: 12px; background: radial-gradient(circle at 50% 40%, #3a0c14, #05030a 70%) !important; text-align: center; padding: 24px; color: #efe3c8; }
.vsHand .vsWho { font: 700 15px system-ui, sans-serif; letter-spacing: .2em; }
.vsHand .vsBig { font: 800 42px 'Grenze Gotisch', Georgia, serif; color: #e8bf5e; line-height: 1.05; }
.vsHand .vsTxt { font-size: 18px; max-width: 340px; }
.vsHand .vsBank { font: 700 26px ui-monospace, Menlo, monospace; }
.vsHand .vsSmall { font-size: 14px; color: #c9b89a; }
.vsHand .b { min-width: 240px; min-height: 56px; font-size: 19px; }
#vsClock { position: fixed; z-index: 9; left: 56px; top: calc(8px + var(--safe-t)); display: flex; gap: 5px; pointer-events: none; }
#vsClock .vsc { flex: 1; min-width: 0; padding: 3px 7px; border: 2px solid rgba(255,255,255,.15); background: rgba(10,4,6,.9); border-radius: 6px; opacity: .6; }
#vsClock .vsc.on { border-color: var(--c); box-shadow: 0 0 10px var(--c); opacity: 1; }
#vsClock .who { font: 700 10px system-ui, sans-serif; letter-spacing: .12em; color: var(--c); }
#vsClock .t { font: 700 18px ui-monospace, Menlo, monospace; color: #fff; line-height: 20px; }
#vsClock .tb { height: 4px; background: #333; border-radius: 3px; margin-top: 2px; }
#vsClock .tb i { display: block; height: 100%; background: var(--c); border-radius: 3px; }
#vsClock .tt { font: 600 10px system-ui, sans-serif; color: #ddd; }

/* ---------- online rooms (owner, 2026-10-16) ---------- */
.olw { z-index: 32; }
.olw .olf { display: block; text-align: left; margin: 8px 0; font-size: 14px; color: #e6d8b8; }
.olw .olf input { display: block; width: 100%; box-sizing: border-box; margin-top: 4px; padding: 10px; font: 600 18px 'EB Garamond', Georgia, serif; color: #fff; background: rgba(0,0,0,.45); border: 1px solid #c9a24a; border-radius: 6px; }
.olw .btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.olSeats { display: flex; gap: 8px; margin: 8px 0; }
.olSeat { flex: 1; padding: 8px; border: 2px solid var(--c); border-radius: 8px; background: rgba(0,0,0,.35); display: flex; flex-direction: column; gap: 4px; align-items: center; }
.olSeat .olSide { font: 700 12px system-ui, sans-serif; letter-spacing: .14em; color: var(--c); }
.olSeat b { font-size: 18px; }
.olSeat .b { min-width: 0; width: 100%; }
.olWin { font-weight: 700; }
.b.ghost { opacity: .75; }

/* Corner vines. The owner picked this frame (B) on 2026-10-17 for the floor bar,
   the three-line menu, gear, skills and settings. Thin gold line, vines only
   in the corners, a dark painted field inside. The hero move menu and the
   attack window are not restyled.
   The vines sit on the frame, not on the scrolling list. A long gear list
   used to drag them into the middle (owner, 2026-10-17). */
#chip, #sys,
#gearWin .box, #skillsWin .box, #settingsWin .box, #floorsWin .box, #slotsWin .box {
  isolation: isolate;
  background:
    linear-gradient(180deg, rgba(12, 6, 8, .62), rgba(6, 3, 5, .78)),
    url(../assets/ui/vine-field.jpg) center / cover;
  border: 1px solid #e0c17a;
  box-shadow: 0 0 0 1px #2a1210, 0 8px 18px rgba(0, 0, 0, .5);
}
#chip::before, #sys::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    url(../assets/ui/vine-tl.png) left top / 56px 56px no-repeat,
    url(../assets/ui/vine-tr.png) right top / 56px 56px no-repeat,
    url(../assets/ui/vine-bl.png) left bottom / 56px 56px no-repeat,
    url(../assets/ui/vine-br.png) right bottom / 56px 56px no-repeat;
}
#chip::before { background-size: 18px 18px; }
#sys::before { background-size: 44px 44px; }
#gearWin .box, #skillsWin .box, #settingsWin .box, #floorsWin .box, #slotsWin .box {
  overflow: hidden;
  max-height: none;
  padding: 0;
  background:
    url(../assets/ui/vine-tl.png) left top / 56px 56px no-repeat,
    url(../assets/ui/vine-tr.png) right top / 56px 56px no-repeat,
    url(../assets/ui/vine-bl.png) left bottom / 56px 56px no-repeat,
    url(../assets/ui/vine-br.png) right bottom / 56px 56px no-repeat,
    linear-gradient(180deg, rgba(12, 6, 8, .62), rgba(6, 3, 5, .78)),
    url(../assets/ui/vine-field.jpg) center / cover;
}
#gearWin .vscroll, #skillsWin .vscroll, #settingsWin .vscroll, #floorsWin .vscroll, #slotsWin .vscroll {
  overflow: auto;
  max-height: 86vh;
  padding: 14px 16px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

