* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --dice-gold: #f1b43a;
  --dice-gold-deep: #c98210;
  --dice-gold-soft: #ffdf8a;
  --dice-gold-bright: #fff0bf;
  --dice-gold-bg: rgba(241, 180, 58, 0.12);
  --dice-gold-bg-strong: rgba(241, 180, 58, 0.2);
}
html, body { width: 100%; height: 100%; overflow: hidden; }
body {
  background: #1a1a2e;
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  color: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}
button, input, canvas {
  touch-action: manipulation;
}
#app { width: 100%; height: 100%; }
.hidden { display: none !important; }

/* Classic RPG Battle Prototype */
#classic-battle-screen {
  height: 100vh;
  background:
    radial-gradient(circle at 50% 18%, rgba(82, 185, 255, 0.18), transparent 32%),
    linear-gradient(180deg, #151a31 0%, #0b1020 100%);
  color: #fff6d4;
  padding: 10px;
  overflow: hidden;
}
.classic-battle-shell {
  width: min(1280px, 100%);
  height: calc(100vh - 20px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.classic-battle-topbar {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr minmax(120px, 180px);
  align-items: center;
  gap: 12px;
}
.classic-battle-topbar .btn {
  border: 2px solid var(--dice-gold-deep);
  border-radius: 10px;
  background: rgba(18, 20, 32, 0.76);
  color: var(--dice-gold-soft);
  padding: 10px 12px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
.classic-battle-topbar .btn:hover {
  background: rgba(241, 180, 58, 0.18);
  border-color: var(--dice-gold-soft);
}
.classic-battle-title {
  text-align: center;
  text-shadow: 0 3px 0 rgba(0,0,0,0.6);
}
.classic-battle-title span {
  display: block;
  color: #9cc8ff;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.classic-battle-title strong {
  display: block;
  color: #fff1a8;
  font-size: clamp(18px, 3vw, 28px);
}
.classic-battle-stage {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  border: 3px solid #d7c481;
  border-radius: 14px;
  background: #182033;
  box-shadow: 0 22px 45px rgba(0,0,0,0.42), inset 0 0 0 2px rgba(255,255,255,0.08);
}
.classic-initiative-screen {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 3px solid rgba(241, 180, 58, 0.78);
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 24%, rgba(80, 177, 228, 0.16), transparent 34%),
    radial-gradient(circle at 50% 100%, rgba(241, 180, 58, 0.14), transparent 42%),
    linear-gradient(180deg, rgba(12, 18, 33, 0.96), rgba(7, 10, 21, 0.98));
  box-shadow: 0 22px 45px rgba(0,0,0,0.42), inset 0 0 0 1px rgba(255,255,255,0.08);
}
.classic-initiative-card {
  width: min(760px, calc(100% - 28px));
  max-height: calc(100% - 28px);
  overflow: auto;
  padding: 28px;
  border: 2px solid rgba(255, 223, 128, 0.78);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(18, 25, 45, 0.94), rgba(10, 14, 27, 0.96)),
    radial-gradient(circle at top, rgba(255, 223, 128, 0.16), transparent 46%);
  box-shadow: 0 16px 38px rgba(0,0,0,0.38), inset 0 0 0 1px rgba(255,255,255,0.08);
  text-align: center;
}
.classic-initiative-kicker {
  color: #7bd7ff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.classic-initiative-card h2 {
  margin: 8px 0 8px;
  color: #fff4a8;
  font-size: clamp(30px, 5vw, 54px);
  text-transform: uppercase;
  text-shadow: 0 4px 0 rgba(0,0,0,0.45), 0 0 22px rgba(241,180,58,0.22);
}
.classic-initiative-card p {
  margin: 0 auto 18px;
  max-width: 560px;
  color: #cfd6e6;
  font-size: 14px;
  line-height: 1.5;
}
.classic-initiative-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}
.classic-initiative-entry {
  display: grid;
  grid-template-columns: 34px 1fr 58px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 2px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  background: rgba(255,255,255,0.055);
  color: #f7f8ff;
  text-align: left;
}
.classic-initiative-entry.hero {
  border-color: rgba(81, 190, 255, 0.54);
}
.classic-initiative-entry.enemy {
  border-color: rgba(233, 69, 96, 0.54);
}
.classic-initiative-rank {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--dice-gold-soft);
  color: #241606;
  font-weight: 900;
}
.classic-initiative-name {
  min-width: 0;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.classic-initiative-roll {
  color: #fff4a8;
  font-size: 20px;
  font-weight: 900;
  text-align: right;
}
#btn-classic-begin {
  min-width: 220px;
  padding: 14px 22px;
  border: 2px solid var(--dice-gold-deep);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(241, 180, 58, 0.96), rgba(201, 130, 16, 0.96));
  color: #211405;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 0 22px rgba(241, 180, 58, 0.24);
}
#btn-classic-begin:hover {
  border-color: var(--dice-gold-soft);
  box-shadow: 0 0 28px rgba(255, 223, 128, 0.44);
  transform: translateY(-1px);
}
.classic-battle-field {
  position: relative;
  overflow: hidden;
  min-height: 0;
  background:
    radial-gradient(ellipse at 50% 92%, rgba(112, 86, 45, 0.68), transparent 47%),
    linear-gradient(180deg, rgba(89, 211, 238, 0.9) 0%, rgba(149, 223, 238, 0.85) 22%, rgba(151, 133, 84, 0.95) 23%, rgba(127, 101, 61, 0.95) 52%, rgba(82, 66, 44, 0.98) 100%);
}
.classic-battle-strip {
  position: absolute;
  z-index: 6;
  top: 10px;
  left: 12px;
  right: 12px;
  display: grid;
  grid-template-columns: 1fr 1.6fr 1fr;
  gap: 8px;
  pointer-events: none;
}
.classic-battle-strip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 7px 10px;
  border: 2px solid rgba(255, 240, 170, 0.78);
  border-radius: 8px;
  background: rgba(7, 12, 28, 0.76);
  color: #fff4a8;
  font-size: 12px;
  font-weight: 800;
  text-shadow: 0 2px 0 rgba(0,0,0,0.68);
  box-shadow: 0 6px 16px rgba(0,0,0,0.24);
}
.classic-battle-field::before {
  content: "";
  position: absolute;
  inset: 16% -8% 34% 42%;
  background:
    radial-gradient(ellipse at 30% 80%, rgba(82, 74, 50, 0.92), transparent 34%),
    linear-gradient(120deg, rgba(105, 95, 62, 0.82), rgba(66, 62, 47, 0.82));
  clip-path: polygon(22% 100%, 0 24%, 12% 0, 100% 0, 100% 100%);
  opacity: 0.72;
}
.classic-battle-field::after {
  content: "";
  position: absolute;
  inset: 52% 0 0;
  background:
    linear-gradient(28deg, transparent 0 18%, rgba(255,255,255,0.12) 19% 20%, transparent 21% 100%),
    linear-gradient(152deg, transparent 0 24%, rgba(0,0,0,0.14) 25% 26%, transparent 27% 100%),
    radial-gradient(ellipse at 22% 78%, rgba(245, 221, 142, 0.22), transparent 20%),
    radial-gradient(ellipse at 68% 60%, rgba(255, 239, 166, 0.16), transparent 22%);
  opacity: 0.76;
}
.classic-combat-line {
  position: absolute;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.classic-combat-line--enemy {
  left: clamp(32px, 8vw, 112px);
  top: 54px;
  bottom: 22px;
  align-items: flex-start;
  justify-content: space-evenly;
}
.classic-combat-line--hero {
  right: clamp(26px, 7vw, 92px);
  top: 54px;
  bottom: 22px;
  align-items: flex-end;
  justify-content: space-evenly;
}
.classic-sprite-card {
  position: relative;
  width: clamp(118px, 14vw, 165px);
  min-height: 82px;
  display: flex;
  align-items: center;
  gap: 8px;
  filter: drop-shadow(0 12px 10px rgba(0,0,0,0.36));
  transition: transform 0.18s ease, opacity 0.18s ease, filter 0.18s ease;
}
.classic-sprite-card.enemy:nth-child(2) { margin-left: 68px; }
.classic-sprite-card.enemy:nth-child(4) { margin-left: 46px; }
.classic-sprite-card.hero:nth-child(2) { margin-right: 42px; }
.classic-sprite-card.hero:nth-child(3) { margin-right: 4px; }
.classic-sprite-card.hero:nth-child(4) { margin-right: 54px; }
.classic-sprite-card.active {
  transform: translateX(-8px);
  filter: drop-shadow(0 0 14px rgba(255, 240, 150, 0.9)) drop-shadow(0 12px 10px rgba(0,0,0,0.36));
}
.classic-sprite-card.targeted {
  transform: translateX(8px);
  filter: drop-shadow(0 12px 10px rgba(0,0,0,0.36));
}
.classic-sprite-card.targeted::before {
  content: "";
  position: absolute;
  inset: -8px;
  pointer-events: none;
  background:
    linear-gradient(#fff4a8, #fff4a8) left top / 22px 4px no-repeat,
    linear-gradient(#fff4a8, #fff4a8) left top / 4px 22px no-repeat,
    linear-gradient(#fff4a8, #fff4a8) right top / 22px 4px no-repeat,
    linear-gradient(#fff4a8, #fff4a8) right top / 4px 22px no-repeat,
    linear-gradient(#fff4a8, #fff4a8) left bottom / 22px 4px no-repeat,
    linear-gradient(#fff4a8, #fff4a8) left bottom / 4px 22px no-repeat,
    linear-gradient(#fff4a8, #fff4a8) right bottom / 22px 4px no-repeat,
    linear-gradient(#fff4a8, #fff4a8) right bottom / 4px 22px no-repeat;
  filter: drop-shadow(0 0 6px rgba(255, 244, 168, 0.95));
}
.classic-sprite-card.defeated {
  opacity: 0.28;
  filter: grayscale(1) drop-shadow(0 8px 8px rgba(0,0,0,0.3));
}
.classic-sprite-card img {
  width: clamp(70px, 9.5vh, 94px);
  height: clamp(70px, 9.5vh, 94px);
  object-fit: contain;
}
.classic-sprite-card.hero img { transform: scaleX(-1); }
.classic-sprite-label {
  min-width: 58px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(7, 12, 28, 0.82);
  color: #fff9cf;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  box-shadow: inset 0 -1px 0 rgba(255,255,255,0.12);
}
.classic-sprite-hp {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -9px;
  height: 5px;
  border-radius: 999px;
  background: rgba(10, 14, 28, 0.78);
  overflow: hidden;
}
.classic-sprite-hp span {
  display: block;
  height: 100%;
  width: var(--hp, 100%);
  background: linear-gradient(90deg, #35e67d, #d8ff75);
}
.classic-battle-floats {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 5;
}
.classic-float-text {
  position: absolute;
  left: var(--x);
  top: var(--y);
  color: var(--color, #fff);
  font-size: 22px;
  font-weight: 900;
  text-shadow: 0 3px 0 #050914, 0 0 12px rgba(255,255,255,0.45);
  animation: classicFloat 1.1s ease-out forwards;
}
.classic-dice-burst {
  position: absolute;
  z-index: 7;
  left: 50%;
  top: 42%;
  min-width: 118px;
  padding: 14px 18px;
  border: 3px solid #fff4a8;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(14, 24, 64, 0.96), rgba(28, 45, 168, 0.95));
  color: #fff4a8;
  font-size: 28px;
  font-weight: 900;
  text-align: center;
  white-space: pre-line;
  text-shadow: 0 3px 0 #050835;
  transform: translate(-50%, -50%) scale(1);
  box-shadow: 0 12px 28px rgba(0,0,0,0.38), 0 0 24px rgba(255, 244, 168, 0.28);
  animation: classicDiceBurst 0.75s ease-out forwards;
}
@keyframes classicDiceBurst {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.72); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
  to { opacity: 0; transform: translate(-50%, -76%) scale(1); }
}
@keyframes classicFloat {
  from { transform: translate(-50%, 0); opacity: 0; }
  16% { opacity: 1; }
  to { transform: translate(-50%, -42px); opacity: 0; }
}
.classic-battle-hud {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: 1fr 1.05fr 1.55fr;
  gap: 8px;
  padding: 8px;
  background:
    linear-gradient(180deg, rgba(11, 16, 30, 0.98), rgba(7, 10, 21, 0.99));
  border-top: 2px solid rgba(241, 180, 58, 0.58);
}
.classic-hud-panel {
  min-height: 128px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 223, 128, 0.34);
  border-radius: 14px;
  background:
    radial-gradient(circle at top right, rgba(120, 208, 255, 0.08), transparent 38%),
    linear-gradient(180deg, rgba(24, 32, 55, 0.94), rgba(12, 17, 31, 0.96));
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06), 0 10px 20px rgba(0,0,0,0.24);
}
.classic-hud-panel h2 {
  margin: 0 0 6px;
  color: var(--dice-gold-bright);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(255, 223, 128, 0.22);
}
.classic-target-list,
.classic-command-list,
.classic-party-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.classic-target-button,
.classic-command-button {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  background: rgba(255,255,255,0.045);
  color: #f7f8ff;
  padding: 6px 9px;
  font-size: clamp(14px, 1.55vw, 17px);
  line-height: 1.05;
  text-align: left;
  text-shadow: none;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}
.classic-target-button.active,
.classic-command-button.active,
.classic-command-button:hover:not(:disabled),
.classic-target-button:hover:not(:disabled) {
  border-color: rgba(255, 223, 128, 0.62);
  background: rgba(241, 180, 58, 0.16);
  color: #fff4c0;
  transform: translateX(2px);
}
.classic-command-button:disabled,
.classic-target-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}
.classic-party-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 78px minmax(90px, 120px);
  align-items: center;
  gap: 8px;
  padding: 5px 7px;
  border-radius: 10px;
  background: rgba(255,255,255,0.045);
  color: #ffffff;
  font-size: clamp(15px, 1.8vw, 19px);
  line-height: 1.1;
  text-shadow: none;
}
.classic-party-row.active {
  outline: 1px solid rgba(255, 223, 128, 0.52);
  color: #fff2a7;
  background: rgba(241, 180, 58, 0.13);
}
.classic-party-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.classic-party-status {
  grid-column: 1 / -1;
  color: #aeb9d1;
  font-size: 11px;
  line-height: 1.2;
}
.classic-command-button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.classic-command-button span {
  color: var(--dice-gold-soft);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.classic-party-hpbar {
  height: 10px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  background: rgba(10, 14, 28, 0.9);
  overflow: hidden;
}
.classic-party-hpbar span {
  display: block;
  height: 100%;
  width: var(--hp, 100%);
  background: linear-gradient(90deg, #f7f26b, #53e37c);
}
.classic-battle-log {
  margin: 7px 0 0;
  min-height: 24px;
  color: #cfd6e6;
  font-size: 12px;
  line-height: 1.35;
}

@media (max-width: 820px) {
  #classic-battle-screen { padding: 10px; }
  .classic-battle-topbar { grid-template-columns: 1fr; }
  .classic-battle-stage {
    grid-template-rows: minmax(410px, 1fr) auto;
  }
  .classic-initiative-list {
    grid-template-columns: 1fr;
  }
  .classic-battle-strip {
    grid-template-columns: 1fr;
  }
  .classic-combat-line--enemy {
    left: 14px;
    top: 54px;
  }
  .classic-combat-line--hero {
    right: 12px;
    top: 58px;
  }
  .classic-sprite-card { width: 112px; }
  .classic-sprite-card img {
    width: 68px;
    height: 68px;
  }
  .classic-battle-hud { grid-template-columns: 1fr; }
  .classic-hud-panel { min-height: auto; }
  .classic-target-button,
  .classic-command-button,
  .classic-party-row { font-size: 18px; }
}

/* Isometric Prototype */
#iso-prototype-screen {
  width: 100%;
  min-height: 100vh;
  padding: 26px;
  overflow: auto;
  background:
    radial-gradient(circle at 20% 18%, rgba(75, 147, 126, 0.22), transparent 32%),
    radial-gradient(circle at 86% 12%, rgba(241, 180, 58, 0.16), transparent 28%),
    linear-gradient(135deg, #101423 0%, #15182d 52%, #0b1220 100%);
}

.iso-prototype-shell {
  width: min(1280px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.iso-prototype-topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border: 1px solid rgba(242, 190, 82, 0.55);
  border-radius: 18px;
  background: rgba(10, 14, 25, 0.78);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.24);
}

.iso-prototype-topbar .btn {
  padding: 11px 18px;
  border: 2px solid var(--dice-gold-deep);
  border-radius: 10px;
  background: rgba(18, 20, 32, 0.76);
  color: var(--dice-gold-soft);
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.iso-prototype-topbar .btn:hover {
  color: #211508;
  background: linear-gradient(180deg, rgba(244, 201, 96, 0.98), rgba(206, 132, 18, 0.96));
  box-shadow: 0 0 24px rgba(235, 177, 55, 0.3);
}

.iso-prototype-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
}

.iso-prototype-title span {
  color: #8ee7c1;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.iso-prototype-title strong {
  color: #f7db8b;
  font-size: clamp(20px, 3vw, 32px);
  text-shadow: 0 3px 14px rgba(0, 0, 0, 0.45);
}

.iso-prototype-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 18px;
  align-items: stretch;
}

#iso-board {
  width: 100%;
  min-height: 520px;
  max-height: calc(100vh - 145px);
  aspect-ratio: 16 / 11;
  display: block;
  border: 2px solid rgba(242, 190, 82, 0.62);
  border-radius: 20px;
  background: #111827;
  box-shadow: inset 0 0 55px rgba(0, 0, 0, 0.42), 0 20px 50px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

.iso-prototype-panel {
  padding: 18px;
  border: 1px solid rgba(242, 190, 82, 0.42);
  border-radius: 18px;
  background: rgba(12, 16, 28, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 18px 40px rgba(0, 0, 0, 0.22);
}

.iso-prototype-panel h2 {
  margin: 0 0 10px;
  color: #f7db8b;
  font-size: 22px;
  letter-spacing: 0.04em;
}

.iso-prototype-hint {
  margin: 0 0 16px;
  color: #c9d7e5;
  font-size: 13px;
  line-height: 1.45;
}

.iso-prototype-actions {
  margin: 0 0 14px;
}

.iso-prototype-actions button {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--dice-gold-deep);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(27, 34, 52, 0.95), rgba(12, 16, 28, 0.95));
  color: var(--dice-gold-soft);
  font-family: inherit;
  font-weight: 800;
  letter-spacing: 0.05em;
  cursor: pointer;
}

.iso-prototype-actions button:hover:not(:disabled) {
  color: #211508;
  background: linear-gradient(180deg, rgba(244, 201, 96, 0.98), rgba(206, 132, 18, 0.96));
  box-shadow: 0 0 22px rgba(235, 177, 55, 0.28);
}

.iso-prototype-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.iso-prototype-stat {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.iso-prototype-stat span {
  color: #91a7bd;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.iso-prototype-stat strong {
  color: #f7f1d0;
  text-align: right;
}

.iso-prototype-log {
  margin-top: 14px;
  padding: 12px;
  min-height: 76px;
  border: 1px solid rgba(142, 231, 193, 0.25);
  border-radius: 12px;
  background: rgba(6, 10, 18, 0.38);
  color: #d9f7e8;
  font-size: 13px;
  line-height: 1.35;
}

@media (max-width: 920px) {
  #iso-prototype-screen {
    padding: 14px;
  }

  .iso-prototype-topbar,
  .iso-prototype-layout {
    grid-template-columns: 1fr;
  }

  .iso-prototype-topbar {
    gap: 10px;
  }

  .iso-prototype-title {
    order: -1;
  }

  #iso-board {
    min-height: 390px;
    max-height: none;
  }
}
#build-stamp {
  position: fixed;
  top: 14px;
  right: 18px;
  z-index: 120;
  padding: 8px 14px;
  border: 1px solid rgba(255, 212, 74, 0.55);
  border-radius: 999px;
  background: rgba(18, 20, 32, 0.9);
  color: #ffd54a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

/* Title Screen */
#title-screen {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  position: relative;
}
#title-logo {
  width: min(520px, 72vw);
  max-width: 100%;
  margin: 96px 0 26px;
  object-fit: contain;
  filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.36));
}
.subtitle { font-size: 18px; color: #888; margin: -16px 0 18px; }
.menu { display: flex; flex-direction: column; gap: 12px; width: 240px; margin-top: -10px; }
.menu button, .hud-buttons button, .hud-panel-toggle, #btn-mobile-hub-close, .mobile-hub-footer button, .mobile-hub-nav-button {
  padding: 12px 24px; font-size: 16px; border: 2px solid var(--dice-gold-deep); border-radius: 8px;
  background: rgba(18, 20, 32, 0.32); color: var(--dice-gold-soft); cursor: pointer; transition: all 0.2s;
}
.menu button:hover, .hud-buttons button:hover, .hud-panel-toggle:hover, #btn-mobile-hub-close:hover, .mobile-hub-footer button:hover, .mobile-hub-nav-button:hover {
  background: linear-gradient(180deg, rgba(241, 180, 58, 0.9) 0%, rgba(201, 130, 16, 0.95) 100%);
  color: #241606;
  border-color: var(--dice-gold-soft);
  box-shadow: 0 10px 22px rgba(201, 130, 16, 0.25);
}
.title-note {
  max-width: 340px;
  margin: 18px 0 0;
  color: #c6d5f0;
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
}
.version { position: absolute; bottom: 16px; color: #555; font-size: 13px; }

#tutorial-screen {
  height: 100%;
  overflow-y: auto;
  background: linear-gradient(160deg, #151827 0%, #17233b 48%, #10233c 100%);
}
#battle-setup-screen {
  height: 100%;
  overflow-y: auto;
  background: linear-gradient(160deg, #151827 0%, #17233b 48%, #10233c 100%);
}
#save-screen {
  height: 100%;
  overflow-y: auto;
  background: linear-gradient(160deg, #151827 0%, #17233b 48%, #10233c 100%);
}
#patch-notes-screen {
  height: 100%;
  overflow-y: auto;
  background: linear-gradient(160deg, #151827 0%, #17233b 48%, #10233c 100%);
}
.save-shell {
  width: min(1120px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 28px 0 40px;
}
.battle-setup-shell {
  width: min(980px, calc(100vw - 40px));
}
.patchnotes-shell {
  width: min(1120px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 28px 0 40px;
}
.save-hero {
  margin-bottom: 22px;
  padding: 22px 24px;
  border: 1px solid rgba(241, 180, 58, 0.22);
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(241, 180, 58, 0.12) 0%, transparent 36%),
    linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.03) 100%);
  box-shadow: 0 18px 32px rgba(0,0,0,0.2);
}
.battle-setup-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.battle-setup-mode-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
}
.battle-setup-mode-label {
  color: #fff0bf;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.battle-setup-mode-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.battle-setup-mode-button {
  padding: 12px 14px;
  border: 1px solid rgba(201, 130, 16, 0.72);
  border-radius: 12px;
  background: rgba(18, 20, 32, 0.34);
  color: #ead29a;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.battle-setup-mode-button:hover {
  background: rgba(255, 215, 74, 0.12);
  border-color: rgba(255, 223, 128, 0.84);
  color: #fff5d4;
}
.battle-setup-mode-button.active {
  border-color: rgba(255, 223, 128, 0.82);
  background: linear-gradient(180deg, rgba(255, 215, 74, 0.26), rgba(255, 158, 64, 0.14));
  box-shadow: 0 0 18px rgba(255, 208, 72, 0.2), inset 0 1px 0 rgba(255, 248, 207, 0.18);
  color: #fff7d1;
}
.battle-setup-mode-summary {
  color: #cfd6e6;
  font-size: 13px;
  line-height: 1.55;
}
.battle-setup-versus-card {
  padding: 16px 18px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  background:
    radial-gradient(circle at top right, rgba(120, 208, 255, 0.08), transparent 38%),
    radial-gradient(circle at bottom left, rgba(233, 69, 96, 0.1), transparent 42%),
    rgba(255,255,255,0.04);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.battle-setup-versus-title {
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
}
.battle-setup-versus-copy {
  color: #cfd6e6;
  font-size: 13px;
  line-height: 1.55;
}
.battle-setup-versus-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.battle-setup-versus-side {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(12, 16, 28, 0.36);
}
.battle-setup-versus-side--blue {
  border-color: rgba(120, 208, 255, 0.34);
  box-shadow: inset 0 0 0 1px rgba(120, 208, 255, 0.06);
}
.battle-setup-versus-side--red {
  border-color: rgba(233, 69, 96, 0.34);
  box-shadow: inset 0 0 0 1px rgba(233, 69, 96, 0.06);
}
.battle-setup-versus-side-title {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
}
.battle-setup-versus-side-copy {
  margin: 0 0 10px;
  color: #b9c4dc;
  font-size: 12px;
  line-height: 1.45;
}
.battle-setup-versus-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.battle-setup-versus-unit {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  color: #f3f6ff;
  font-size: 12px;
  font-weight: 700;
}
.battle-setup-versus-note {
  color: #9aa3bb;
  font-size: 11px;
  line-height: 1.45;
}
.battle-setup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.battle-setup-actions button {
  padding: 11px 16px;
  font-size: 14px;
  border: 2px solid var(--dice-gold-deep);
  border-radius: 10px;
  background: rgba(18, 20, 32, 0.32);
  color: var(--dice-gold-soft);
  cursor: pointer;
  transition: all 0.2s;
}
.battle-setup-actions button:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(241, 180, 58, 0.9) 0%, rgba(201, 130, 16, 0.95) 100%);
  color: #241606;
  border-color: var(--dice-gold-soft);
  box-shadow: 0 10px 22px rgba(201, 130, 16, 0.25);
}
.battle-setup-versus-mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.online-pvp-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(120, 208, 255, 0.18);
  background: rgba(9, 14, 26, 0.38);
}
.online-pvp-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.online-pvp-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.online-pvp-field span,
.online-pvp-room-kicker {
  color: #fff0bf;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.online-pvp-field input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(12, 16, 28, 0.86);
  color: #f7f8ff;
  font: inherit;
}
.online-pvp-field input:focus {
  outline: none;
  border-color: rgba(255, 223, 128, 0.58);
  box-shadow: 0 0 0 2px rgba(255, 223, 128, 0.14);
}
.online-pvp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.online-pvp-actions button {
  padding: 11px 16px;
  font-size: 14px;
  border: 2px solid var(--dice-gold-deep);
  border-radius: 10px;
  background: rgba(18, 20, 32, 0.32);
  color: var(--dice-gold-soft);
  cursor: pointer;
  transition: all 0.2s;
}
.online-pvp-actions button.secondary {
  border-color: rgba(187, 201, 229, 0.22);
  color: #cfd6e6;
}
.online-pvp-actions button:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(241, 180, 58, 0.9) 0%, rgba(201, 130, 16, 0.95) 100%);
  color: #241606;
  border-color: var(--dice-gold-soft);
  box-shadow: 0 10px 22px rgba(201, 130, 16, 0.25);
}
.online-pvp-actions button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}
.online-pvp-empty,
.online-pvp-lobby-note {
  color: #cfd6e6;
  font-size: 13px;
  line-height: 1.55;
}
.online-pvp-lobby-note.ready {
  color: #baf7d4;
}
.online-pvp-room-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-end;
}
.online-pvp-room-code {
  color: #ffffff;
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 800;
  letter-spacing: 0.12em;
}
.online-pvp-room-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #b9c4dc;
  font-size: 13px;
}
.online-pvp-seats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.online-pvp-seat {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}
.online-pvp-seat.active {
  border-color: rgba(120, 208, 255, 0.4);
  box-shadow: inset 0 0 0 1px rgba(120, 208, 255, 0.12);
}
.online-pvp-seat-label {
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
}
.online-pvp-seat-status {
  margin-top: 4px;
  color: #cfd6e6;
  font-size: 12px;
}
.save-hero h1 {
  margin: 0 0 12px;
  color: #ffffff;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
}
.save-hero p {
  max-width: 820px;
  margin: 0;
  color: #d5dcee;
  font-size: 16px;
  line-height: 1.55;
}
.patchnotes-hero {
  margin-bottom: 22px;
  padding: 22px 24px;
  border: 1px solid rgba(241, 180, 58, 0.22);
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(241, 180, 58, 0.12) 0%, transparent 36%),
    linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.03) 100%);
  box-shadow: 0 18px 32px rgba(0,0,0,0.2);
}
.patchnotes-hero h1 {
  margin: 0 0 12px;
  color: #ffffff;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
}
.patchnotes-hero p {
  max-width: 840px;
  margin: 0;
  color: #d5dcee;
  font-size: 16px;
  line-height: 1.55;
}
.patchnotes-range-card {
  margin-bottom: 18px;
  padding: 18px 20px;
  border: 1px solid rgba(241, 180, 58, 0.18);
  border-radius: 16px;
  background:
    radial-gradient(circle at top right, rgba(241, 180, 58, 0.08) 0%, transparent 40%),
    rgba(10, 14, 24, 0.62);
  box-shadow: 0 14px 28px rgba(0,0,0,0.18);
}
.patchnotes-range-title {
  margin-bottom: 8px;
  color: #f2dc8c;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.patchnotes-range-value {
  margin-bottom: 10px;
  color: #fff5cf;
  font-size: clamp(20px, 3vw, 30px);
  font-weight: 800;
}
.patchnotes-range-summary {
  max-width: 900px;
  margin: 0;
  color: #d5dcee;
  font-size: 15px;
  line-height: 1.6;
}
.patchnotes-window {
  display: block;
  margin-bottom: 18px;
}
.patchnotes-window--current {
  margin-bottom: 22px;
}
.patchnotes-window--archive {
  border: 1px solid rgba(241, 180, 58, 0.22);
  border-radius: 16px;
  background:
    radial-gradient(circle at top left, rgba(241, 180, 58, 0.08) 0%, transparent 34%),
    rgba(10, 14, 24, 0.66);
  box-shadow: 0 14px 28px rgba(0,0,0,0.18);
  overflow: hidden;
}
.patchnotes-window-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  cursor: pointer;
  list-style: none;
}
.patchnotes-window-summary::-webkit-details-marker {
  display: none;
}
.patchnotes-window-kicker {
  display: block;
  margin-bottom: 6px;
  color: #f2dc8c;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.patchnotes-window-title {
  display: block;
  color: #fff5cf;
  font-size: clamp(18px, 2.4vw, 24px);
  font-weight: 800;
  line-height: 1.2;
}
.patchnotes-window-toggle {
  flex: 0 0 auto;
  min-width: 72px;
  padding: 9px 12px;
  border: 1px solid rgba(241, 180, 58, 0.4);
  border-radius: 999px;
  background: rgba(241, 180, 58, 0.12);
  color: #ffdf8a;
  font-size: 0;
  font-weight: 800;
  line-height: 1;
  text-align: center;
}
.patchnotes-window-toggle::after {
  content: "Open";
  font-size: 12px;
}
.patchnotes-window--archive[open] .patchnotes-window-toggle::after {
  content: "Close";
}
.patchnotes-window-body {
  padding: 0 18px 18px;
}
.patchnotes-window-body .patchnotes-range-card {
  margin-bottom: 18px;
}
.patchnotes-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.patchnotes-card {
  padding: 20px 22px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.06) 0%, transparent 28%),
    rgba(10, 14, 24, 0.72);
  box-shadow: 0 16px 34px rgba(0,0,0,0.22);
}
.patchnotes-card h2 {
  margin: 0 0 12px;
  color: #fff4c6;
  font-size: 20px;
  line-height: 1.2;
}
.patchnotes-list {
  margin: 0;
  padding-left: 18px;
  color: #dde5f5;
  line-height: 1.65;
}
.patchnotes-list li + li {
  margin-top: 9px;
}
.save-card {
  gap: 16px;
  max-width: 940px;
  margin: 0 auto;
}
.save-screen-status {
  padding: 14px 16px;
  border: 1px solid rgba(241, 180, 58, 0.2);
  border-radius: 14px;
  background: rgba(10, 15, 24, 0.68);
  color: #d5dcee;
  font-size: 14px;
  line-height: 1.5;
}
.save-slots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.save-slot-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 100%;
}
.save-slot-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.save-slot-heading {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.save-slot-title {
  color: #fff7d1;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.save-slot-time {
  color: #c8d4eb;
  font-size: 13px;
}
.save-slot-badge {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(241, 180, 58, 0.3);
  background: rgba(241, 180, 58, 0.12);
  color: #fff0a6;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.save-slot-summary {
  color: #f5f7ff;
  font-size: 15px;
  line-height: 1.5;
}
.save-slot-summary strong {
  color: #fff0a6;
}
.save-slot-meta {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.save-slot-meta li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: #d5dcee;
  font-size: 14px;
}
.save-slot-meta span:first-child {
  color: #fff1bf;
  font-weight: 700;
}
.save-slot-empty {
  color: #c8d4eb;
  font-size: 15px;
  line-height: 1.6;
}
.save-slot-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: auto;
}
.save-slot-actions button {
  padding: 12px 18px;
  border: 2px solid var(--dice-gold-deep);
  border-radius: 10px;
  background: rgba(18, 20, 32, 0.42);
  color: var(--dice-gold-soft);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}
.save-slot-actions button:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(241, 180, 58, 0.9) 0%, rgba(201, 130, 16, 0.95) 100%);
  color: #241606;
  border-color: var(--dice-gold-soft);
  box-shadow: 0 10px 22px rgba(201, 130, 16, 0.25);
}
.save-slot-actions button.secondary {
  border-color: rgba(241, 180, 58, 0.28);
  color: #d5dcee;
}
.save-slot-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}
.save-slot-status {
  color: #d0daee;
  font-size: 13px;
  min-height: 18px;
}
.save-slot-status.success {
  color: #9bf2b2;
}
.save-slot-status.error {
  color: #ffb3a7;
}
.tutorial-shell {
  width: min(1120px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 28px 0 40px;
}
.tutorial-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
}
.tutorial-topbar button {
  padding: 12px 20px;
  font-size: 15px;
  border: 2px solid var(--dice-gold-deep);
  border-radius: 10px;
  background: rgba(18, 20, 32, 0.42);
  color: var(--dice-gold-soft);
  cursor: pointer;
  transition: all 0.2s ease;
}
.tutorial-topbar button:hover {
  background: linear-gradient(180deg, rgba(241, 180, 58, 0.9) 0%, rgba(201, 130, 16, 0.95) 100%);
  color: #241606;
  border-color: var(--dice-gold-soft);
  box-shadow: 0 10px 22px rgba(201, 130, 16, 0.25);
}
.tutorial-hero {
  margin-bottom: 22px;
  padding: 22px 24px;
  border: 1px solid rgba(241, 180, 58, 0.22);
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(241, 180, 58, 0.12) 0%, transparent 36%),
    linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.03) 100%);
  box-shadow: 0 18px 32px rgba(0,0,0,0.2);
}
.tutorial-kicker {
  color: #f2dc8c;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.tutorial-hero h1 {
  margin: 0 0 12px;
  color: #ffffff;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
}
.tutorial-hero p {
  max-width: 760px;
  margin: 0;
  color: #d5dcee;
  font-size: 16px;
  line-height: 1.55;
}
.tutorial-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.tutorial-walkthrough {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.tutorial-progress {
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid rgba(241, 180, 58, 0.18);
  background:
    radial-gradient(circle at top right, rgba(241, 180, 58, 0.12) 0%, transparent 42%),
    rgba(10, 14, 24, 0.62);
}
.tutorial-progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.tutorial-step-kicker,
.tutorial-step-counter {
  color: #f2dc8c;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.tutorial-step-dots {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.tutorial-step-dot {
  width: 34px;
  height: 10px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  transition: all 0.18s ease;
}
.tutorial-step-dot.active {
  border-color: rgba(255, 229, 162, 0.8);
  background: linear-gradient(90deg, rgba(255, 214, 74, 0.92) 0%, rgba(241, 180, 58, 0.98) 100%);
  box-shadow: 0 0 14px rgba(241, 180, 58, 0.25);
}
.tutorial-step-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.06) 0%, transparent 28%),
    rgba(10, 14, 24, 0.72);
  box-shadow: 0 16px 34px rgba(0,0,0,0.22);
}
.tutorial-step-header h2 {
  margin: 0 0 10px;
  color: #ffffff;
  font-size: clamp(24px, 3.2vw, 34px);
  line-height: 1.06;
}
.tutorial-step-summary {
  max-width: 760px;
  margin: 0;
  color: #d7dff1;
  font-size: 16px;
  line-height: 1.55;
}
.tutorial-step-visual {
  padding: 18px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(17, 22, 36, 0.74);
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tutorial-step-body {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 16px;
}
.tutorial-step-body--single {
  grid-template-columns: 1fr;
}
.tutorial-step-block {
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.04);
}
.tutorial-step-block--note {
  background: rgba(241, 180, 58, 0.08);
  border-color: rgba(241, 180, 58, 0.16);
}
.tutorial-step-block-title {
  margin-bottom: 10px;
  color: #fff1bf;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.tutorial-step-points {
  margin: 0;
  padding-left: 18px;
  color: #e0e7f6;
  line-height: 1.6;
}
.tutorial-step-points li + li {
  margin-top: 8px;
}
.tutorial-step-note {
  margin: 0;
  color: #d7dff1;
  line-height: 1.6;
}
.tutorial-step-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.tutorial-step-actions button {
  min-width: 150px;
  padding: 12px 18px;
  font-size: 15px;
  border: 2px solid var(--dice-gold-deep);
  border-radius: 10px;
  background: rgba(18, 20, 32, 0.42);
  color: var(--dice-gold-soft);
  cursor: pointer;
  transition: all 0.2s ease;
}
.tutorial-step-actions button:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(241, 180, 58, 0.9) 0%, rgba(201, 130, 16, 0.95) 100%);
  color: #241606;
  border-color: var(--dice-gold-soft);
  box-shadow: 0 10px 22px rgba(201, 130, 16, 0.25);
}
.tutorial-step-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}
.tutorial-ui-map {
  position: relative;
  width: min(760px, 100%);
  min-height: 300px;
  padding: 24px 28px 32px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(6, 10, 18, 0.42);
}
.tutorial-ui-map-board {
  width: min(300px, 58vw);
  height: min(300px, 58vw);
  margin: 42px auto 0;
  border-radius: 18px;
  border: 2px solid rgba(241, 180, 58, 0.26);
  background:
    linear-gradient(180deg, rgba(127, 177, 90, 0.95) 0%, rgba(102, 145, 71, 0.96) 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
  position: relative;
  overflow: hidden;
}
.tutorial-ui-map-board::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(0,0,0,0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.18) 1px, transparent 1px);
  background-size: 25% 25%;
  opacity: 0.7;
}
.tutorial-ui-badge {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(241, 180, 58, 0.35);
  background: rgba(18, 20, 32, 0.9);
  color: #fff1bf;
  font-size: 11px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.22);
  max-width: 156px;
  text-align: center;
  line-height: 1.25;
}
.tutorial-ui-badge strong {
  color: #fff4c6;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.tutorial-ui-badge small {
  color: #d5dcee;
  font-size: 10px;
  line-height: 1.25;
}
.tutorial-ui-badge--top { top: 8px; left: 50%; transform: translateX(-50%); }
.tutorial-ui-badge--left { left: 8px; top: 110px; }
.tutorial-ui-badge--right { right: 8px; top: 110px; }
.tutorial-ui-badge--initiative { left: 12px; top: 50%; transform: translateY(-50%); }
.tutorial-ui-badge--history { right: 12px; top: 50%; transform: translateY(-50%); }
.tutorial-ui-bottom {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: calc(100% - 44px);
}
.tutorial-ui-bottom .tutorial-ui-badge {
  position: static;
  transform: none;
}
.tutorial-ui-token {
  position: absolute;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  padding: 2px;
  box-sizing: border-box;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08), 0 8px 18px rgba(0,0,0,0.18);
}
.tutorial-ui-token img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
.tutorial-ui-token--player {
  background: radial-gradient(circle at 30% 30%, rgba(162, 216, 255, 0.95) 0%, rgba(71, 141, 217, 0.96) 100%);
}
.tutorial-ui-token--enemy {
  background: radial-gradient(circle at 30% 30%, rgba(255, 170, 170, 0.94) 0%, rgba(212, 71, 97, 0.95) 100%);
}
.tutorial-ui-token--one { left: 18%; top: 59%; }
.tutorial-ui-token--two { left: 47%; top: 48%; }
.tutorial-ui-token--three { right: 18%; top: 34%; }
.tutorial-stage-path {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.tutorial-stage-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(18, 20, 32, 0.72);
  color: #fff4c6;
  font-weight: 700;
}
.tutorial-stage-arrow {
  color: #f2dc8c;
  font-weight: 900;
  font-size: 24px;
}
.tutorial-team-lineup {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  width: min(760px, 100%);
}
.tutorial-team-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 14px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(18, 20, 32, 0.7);
  color: #d7dff1;
  text-align: center;
}
.tutorial-team-chip img {
  width: 82px;
  height: 82px;
  object-fit: cover;
  border-radius: 16px;
}
.tutorial-team-chip strong {
  color: #fff1bf;
  font-size: 15px;
}
.tutorial-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.03) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.tutorial-card--wide {
  grid-column: 1 / -1;
}
.tutorial-card-title {
  color: #ffffff;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.15;
}
.tutorial-initiative-visual {
  width: min(800px, 100%);
  display: grid;
  gap: 14px;
}
.tutorial-initiative-summary,
.tutorial-initiative-note {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(241, 180, 58, 0.22);
  background: rgba(18, 20, 32, 0.68);
  color: #dce5f6;
  line-height: 1.45;
}
.tutorial-initiative-summary {
  display: grid;
  gap: 5px;
}
.tutorial-initiative-summary strong {
  color: #fff4c6;
  font-size: 17px;
}
.tutorial-initiative-note {
  color: #fff1bf;
  font-weight: 700;
}
.tutorial-order-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.tutorial-order-chip {
  display: grid;
  grid-template-columns: auto 42px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 11px 12px;
  border-radius: 14px;
  background: rgba(18, 20, 32, 0.64);
  border: 1px solid rgba(241, 180, 58, 0.24);
  color: #f8edc2;
  font-size: 13px;
  font-weight: 700;
}
.tutorial-order-chip--enemy {
  border-color: rgba(255, 120, 120, 0.32);
}
.tutorial-order-chip img {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 10px;
}
.tutorial-order-rank {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #f6cf73 0%, #d1961b 100%);
  color: #16110a;
  font-weight: 900;
}
.tutorial-order-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.tutorial-order-copy strong,
.tutorial-order-copy small {
  overflow-wrap: anywhere;
}
.tutorial-order-copy strong {
  color: #fff4c6;
  font-size: 13px;
  line-height: 1.15;
}
.tutorial-order-copy small {
  color: #d5dcee;
  font-size: 12px;
  line-height: 1.2;
}
.tutorial-steps {
  margin: 0;
  padding-left: 20px;
  color: #d8dfee;
  line-height: 1.6;
}
.tutorial-steps li + li {
  margin-top: 8px;
}
.tutorial-board-example {
  display: grid;
  grid-template-columns: repeat(3, 72px);
  grid-template-rows: repeat(3, 72px);
  gap: 6px;
  justify-content: center;
}
.tutorial-board-tile {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(180deg, #7fb15a 0%, #679147 100%);
  border: 1px solid rgba(18, 20, 32, 0.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}
.tutorial-board-tile img {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: 12px;
}
.tutorial-board-tile--move {
  box-shadow: inset 0 0 0 3px rgba(116, 241, 144, 0.95), 0 0 18px rgba(116, 241, 144, 0.24);
}
.tutorial-board-tile--attack {
  box-shadow: inset 0 0 0 3px rgba(255, 110, 110, 0.98), 0 0 18px rgba(255, 110, 110, 0.24);
}
.tutorial-board-tile--heal {
  box-shadow: inset 0 0 0 3px rgba(109, 238, 255, 0.98), 0 0 18px rgba(109, 238, 255, 0.24);
}
.tutorial-board-tile--danger {
  background: linear-gradient(180deg, rgba(220, 74, 74, 0.9) 0%, rgba(120, 28, 28, 0.96) 100%);
  box-shadow: inset 0 0 0 3px rgba(255, 207, 207, 0.86), 0 0 18px rgba(255, 100, 100, 0.2);
}
.tutorial-board-tile--unit {
  box-shadow: inset 0 0 0 3px rgba(255, 214, 74, 0.95), 0 0 18px rgba(255, 214, 74, 0.24);
}
.tutorial-board-tile--selected::after {
  content: '';
  position: absolute;
  inset: 8px;
  border: 3px solid rgba(255, 255, 255, 0.95);
  border-radius: 14px;
  pointer-events: none;
}
.tutorial-board-tile--danger::before,
.tutorial-board-tile--danger::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 42px;
  height: 3px;
  background: rgba(255, 245, 220, 0.9);
  border-radius: 999px;
  box-shadow: 0 0 10px rgba(255, 226, 168, 0.22);
}
.tutorial-board-tile--danger::before {
  transform: translate(-50%, -50%) rotate(45deg);
}
.tutorial-board-tile--danger::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}
.tutorial-legend {
  display: grid;
  gap: 8px;
  color: #d8dfee;
  font-size: 14px;
  line-height: 1.45;
}
.tutorial-legend > div {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tutorial-swatch {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  flex: 0 0 auto;
}
.tutorial-swatch--active { background: #ffd54a; }
.tutorial-swatch--selected {
  background: #ffffff;
  box-shadow: inset 0 0 0 2px #182133;
}
.tutorial-swatch--move { background: #67de83; }
.tutorial-swatch--attack { background: #ff6b6b; }
.tutorial-swatch--heal { background: #61eaff; }
.tutorial-swatch--danger { background: #d44848; }
.tutorial-roll-guide {
  display: grid;
  gap: 10px;
}
.tutorial-roll-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(18, 20, 32, 0.48);
  color: #d7dff1;
}
.tutorial-roll-band strong {
  color: #ffffff;
  font-size: 17px;
}
.tutorial-roll-band--fail { border-color: rgba(255, 179, 71, 0.42); }
.tutorial-roll-band--miss { border-color: rgba(255, 121, 121, 0.3); }
.tutorial-roll-band--hit { border-color: rgba(83, 215, 105, 0.35); }
.tutorial-roll-band--crit { border-color: rgba(255, 214, 74, 0.5); }
.tutorial-copy {
  margin: 0;
  color: #d7dff1;
  line-height: 1.55;
}
.tutorial-unit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.tutorial-unit-card {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 14px;
  background: rgba(18, 20, 32, 0.44);
  border: 1px solid rgba(255,255,255,0.07);
}
.tutorial-unit-card img {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 16px;
  justify-self: center;
}
.tutorial-unit-card h3 {
  margin: 0 0 6px;
  color: #fff1bf;
  font-size: 17px;
}
.tutorial-unit-card p {
  margin: 0;
  color: #d8dfee;
  font-size: 14px;
  line-height: 1.45;
}
.tutorial-terrain-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.tutorial-terrain-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(18, 20, 32, 0.44);
  border: 1px solid rgba(255,255,255,0.07);
  text-align: center;
}
.tutorial-terrain-item img {
  max-width: 100%;
  max-height: 120px;
  object-fit: contain;
}
.tutorial-terrain-item span {
  color: #d8dfee;
  font-size: 14px;
  line-height: 1.45;
}
.tutorial-bullets {
  margin: 0;
  padding-left: 20px;
  color: #d8dfee;
  line-height: 1.6;
}
.tutorial-bullets li + li {
  margin-top: 8px;
}
.tutorial-action-button {
  min-height: 42px;
  padding: 10px 14px;
  border: 2px solid var(--dice-gold-deep);
  border-radius: 10px;
  background: rgba(18, 20, 32, 0.56);
  color: var(--dice-gold-soft);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}
.tutorial-action-button:hover:not(:disabled),
.tutorial-action-button:focus-visible,
.tutorial-action-button.active {
  background: linear-gradient(180deg, rgba(241, 180, 58, 0.92) 0%, rgba(201, 130, 16, 0.96) 100%);
  border-color: var(--dice-gold-soft);
  color: #241606;
  box-shadow: 0 10px 22px rgba(201, 130, 16, 0.25);
  outline: none;
}
.tutorial-action-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.tutorial-action-button--large {
  min-height: 54px;
  padding: 14px 18px;
  font-size: 15px;
}
.tutorial-initiative-controls,
.tutorial-board-controls,
.tutorial-stage-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.tutorial-initiative-controls .tutorial-action-button {
  flex: 0 0 auto;
}
.tutorial-initiative-controls .tutorial-initiative-note {
  flex: 1 1 260px;
}
.tutorial-roll-faceoff {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(241, 180, 58, 0.22);
  background: rgba(18, 20, 32, 0.68);
}
.tutorial-roll-faceoff-label,
.tutorial-roll-faceoff-copy {
  color: #fff1bf;
  font-weight: 800;
  line-height: 1.25;
}
.tutorial-roll-faceoff-copy {
  text-align: right;
}
.tutorial-roll-faceoff-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.tutorial-die-face {
  width: 82px;
  height: 82px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 244, 198, 0.6);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 246, 215, 0.96) 0%, rgba(236, 208, 139, 0.96) 100%);
  color: #251807;
  font-size: 38px;
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(0,0,0,0.22);
}
.tutorial-roll-faceoff.rolling .tutorial-die-face,
.tutorial-attack-faceoff.rolling .tutorial-die-display {
  animation: tutorial-die-pulse 0.18s ease-in-out infinite alternate;
}
@keyframes tutorial-die-pulse {
  from { transform: translateY(0) rotate(-1deg); }
  to { transform: translateY(-3px) rotate(1deg); }
}
.tutorial-board-lab,
.tutorial-team-lab,
.tutorial-roll-lab,
.tutorial-stage-lab {
  width: min(820px, 100%);
  display: grid;
  gap: 14px;
}
.tutorial-board-example--interactive {
  grid-template-columns: repeat(4, minmax(58px, 76px));
  grid-template-rows: repeat(4, minmax(58px, 76px));
}
.tutorial-board-example--interactive .tutorial-board-tile {
  width: 100%;
  min-width: 0;
  min-height: 58px;
  padding: 0;
  cursor: pointer;
}
.tutorial-board-example--interactive .tutorial-board-tile:hover,
.tutorial-board-example--interactive .tutorial-board-tile:focus-visible {
  outline: 2px solid rgba(255, 244, 198, 0.8);
  outline-offset: 2px;
}
.tutorial-board-status,
.tutorial-roll-note,
.tutorial-stage-note {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(241, 180, 58, 0.18);
  background: rgba(18, 20, 32, 0.62);
  color: #fff1bf;
  line-height: 1.45;
  font-weight: 700;
}
.tutorial-ui-map--interactive {
  display: grid;
  grid-template-columns: minmax(118px, 150px) minmax(230px, 1fr) minmax(118px, 150px);
  grid-template-areas:
    "top top top"
    "left board right"
    "team board enemy"
    "bottom bottom bottom"
    "detail detail detail";
  align-items: center;
  gap: 12px;
  min-height: 0;
  padding: 18px;
}
.tutorial-ui-map--interactive .tutorial-ui-badge {
  position: static;
  transform: none;
  width: 100%;
  max-width: none;
  min-height: 44px;
  border-radius: 12px;
  cursor: pointer;
}
.tutorial-ui-map--interactive .tutorial-ui-badge:hover,
.tutorial-ui-map--interactive .tutorial-ui-badge:focus-visible,
.tutorial-ui-map--interactive .tutorial-ui-badge.active {
  border-color: var(--dice-gold-soft);
  background: rgba(241, 180, 58, 0.2);
  color: var(--dice-gold-bright);
  outline: none;
}
.tutorial-ui-map--interactive .tutorial-ui-badge strong {
  font-size: 10px;
}
.tutorial-ui-topbar {
  grid-area: top;
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr) minmax(0, 0.8fr);
  gap: 10px;
}
.tutorial-ui-side {
  display: grid;
  gap: 10px;
}
.tutorial-ui-side--left { grid-area: left; }
.tutorial-ui-side--right { grid-area: right; }
.tutorial-ui-badge--team { grid-area: team; }
.tutorial-ui-badge--enemy { grid-area: enemy; }
.tutorial-ui-map--interactive .tutorial-ui-map-board {
  grid-area: board;
  width: min(300px, 100%);
  height: auto;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
}
.tutorial-ui-map--interactive .tutorial-ui-bottom {
  grid-area: bottom;
  position: static;
  transform: none;
  max-width: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 150px));
  justify-content: center;
}
.tutorial-ui-detail {
  grid-area: detail;
  display: grid;
  gap: 5px;
  min-height: 76px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(241, 180, 58, 0.22);
  background: rgba(18, 20, 32, 0.68);
  color: #dce5f6;
  line-height: 1.45;
}
.tutorial-ui-detail strong {
  color: #fff4c6;
  font-size: 16px;
}
.tutorial-team-lineup--interactive .tutorial-team-chip {
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
  font: inherit;
}
.tutorial-team-lineup--interactive .tutorial-team-chip:hover,
.tutorial-team-lineup--interactive .tutorial-team-chip:focus-visible,
.tutorial-team-lineup--interactive .tutorial-team-chip.active {
  border-color: var(--dice-gold-soft);
  background: rgba(241, 180, 58, 0.15);
  box-shadow: 0 0 18px rgba(241, 180, 58, 0.18);
  outline: none;
}
.tutorial-unit-detail {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(241, 180, 58, 0.2);
  background: rgba(18, 20, 32, 0.66);
}
.tutorial-unit-detail img {
  width: 92px;
  height: 92px;
  border-radius: 16px;
  object-fit: cover;
}
.tutorial-unit-detail strong,
.tutorial-unit-detail span {
  display: block;
}
.tutorial-unit-detail strong {
  color: #fff4c6;
  font-size: 20px;
}
.tutorial-unit-detail span {
  margin: 3px 0 8px;
  color: #f2dc8c;
  font-weight: 800;
}
.tutorial-unit-detail p {
  margin: 0;
  color: #dce5f6;
  line-height: 1.5;
}
.tutorial-roll-lab {
  grid-template-columns: minmax(120px, 0.32fr) minmax(0, 0.68fr);
  align-items: start;
}
.tutorial-roll-lab .tutorial-action-button,
.tutorial-roll-lab .tutorial-roll-note {
  grid-column: 1 / -1;
}
.tutorial-attack-faceoff {
  display: grid;
  grid-template-columns: minmax(82px, 1fr) 118px minmax(82px, 1fr);
  align-items: center;
  gap: 12px;
}
.tutorial-attack-unit {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-width: 0;
  color: #fff1bf;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}
.tutorial-attack-unit img {
  width: 70px;
  height: 70px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(18, 20, 32, 0.56);
}
.tutorial-die-display {
  min-height: 144px;
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 16px;
  border-radius: 18px;
  border: 2px solid rgba(241, 180, 58, 0.26);
  background: rgba(18, 20, 32, 0.72);
  color: #fff4c6;
}
.tutorial-die-display span {
  font-size: 56px;
  font-weight: 900;
  line-height: 1;
}
.tutorial-die-display small {
  color: #dce5f6;
  font-weight: 800;
  text-align: center;
}
.tutorial-die-display--fail { border-color: rgba(255, 179, 71, 0.8); }
.tutorial-die-display--miss { border-color: rgba(255, 121, 121, 0.8); }
.tutorial-die-display--hit { border-color: rgba(83, 215, 105, 0.8); }
.tutorial-die-display--crit { border-color: rgba(255, 214, 74, 0.9); box-shadow: 0 0 24px rgba(255, 214, 74, 0.2); }
.tutorial-roll-band.active {
  background: rgba(241, 180, 58, 0.14);
  border-color: var(--dice-gold-soft);
  box-shadow: 0 0 18px rgba(241, 180, 58, 0.2);
}
.tutorial-stage-path--guided {
  display: grid;
  grid-template-columns: repeat(9, auto);
  align-items: center;
  justify-content: center;
}
.tutorial-stage-path--guided .tutorial-stage-chip.active {
  border-color: var(--dice-gold-soft);
  background: rgba(241, 180, 58, 0.18);
  box-shadow: 0 0 18px rgba(241, 180, 58, 0.16);
}
.tutorial-stage-path--guided .tutorial-stage-chip.complete {
  border-color: rgba(102, 230, 145, 0.4);
  color: #d6ffe0;
}
.tutorial-stage-path--guided .tutorial-stage-arrow.active {
  color: #86f2a5;
  text-shadow: 0 0 14px rgba(102, 230, 145, 0.28);
}
.tutorial-stage-note {
  display: grid;
  gap: 5px;
}
.tutorial-stage-note strong {
  color: #fff4c6;
  font-size: 16px;
}

@media (max-width: 700px) {
  #title-logo {
    width: min(420px, 82vw);
    margin: 108px 0 20px;
  }
  .subtitle {
    margin: -12px 0 14px;
  }
  .tutorial-shell {
    width: min(100vw - 22px, 1120px);
    padding: 18px 0 28px;
  }
  .save-shell {
    width: min(100vw - 22px, 1120px);
    padding: 18px 0 28px;
  }
  .battle-setup-mode-row,
  .battle-setup-versus-mode-tabs,
  .battle-setup-versus-grid,
  .battle-setup-versus-list,
  .online-pvp-form-grid,
  .online-pvp-seats {
    grid-template-columns: 1fr;
  }
  .online-pvp-room-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .tutorial-topbar {
    flex-direction: column;
    align-items: stretch;
  }
  .patchnotes-shell {
    width: min(100vw - 24px, 1120px);
    padding: 18px 0 28px;
  }
  .patchnotes-window-summary {
    align-items: flex-start;
    flex-direction: column;
  }
  .patchnotes-window-toggle {
    min-width: 84px;
  }
  .patchnotes-window-body {
    padding: 0 12px 14px;
  }
  .tutorial-step-body {
    grid-template-columns: 1fr;
  }
  .tutorial-step-actions {
    flex-direction: column;
  }
  .tutorial-step-actions button {
    width: 100%;
  }
  .tutorial-team-lineup {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tutorial-step-visual {
    min-height: 0;
    padding: 14px;
  }
  .tutorial-order-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tutorial-order-chip {
    grid-template-columns: auto 38px minmax(0, 1fr);
    padding: 10px;
  }
  .tutorial-order-chip img {
    width: 38px;
    height: 38px;
  }
  .tutorial-ui-map {
    min-height: 290px;
    padding: 18px 16px 78px;
  }
  .tutorial-ui-map--interactive {
    grid-template-columns: 1fr;
    grid-template-areas:
      "top"
      "board"
      "left"
      "team"
      "enemy"
      "right"
      "bottom"
      "detail";
    padding: 14px;
  }
  .tutorial-ui-topbar,
  .tutorial-ui-map--interactive .tutorial-ui-bottom {
    grid-template-columns: 1fr;
  }
  .tutorial-ui-side {
    grid-template-columns: 1fr;
  }
  .tutorial-ui-map-board {
    width: min(220px, 62vw);
    height: min(220px, 62vw);
  }
  .tutorial-ui-map--interactive .tutorial-ui-map-board {
    width: min(260px, 74vw);
  }
  .tutorial-ui-badge {
    max-width: 124px;
    padding: 8px 10px;
  }
  .tutorial-ui-map--interactive .tutorial-ui-badge {
    max-width: none;
  }
  .tutorial-ui-badge--left,
  .tutorial-ui-badge--right {
    top: 84px;
  }
  .tutorial-ui-badge--initiative,
  .tutorial-ui-badge--history {
    top: auto;
    bottom: 78px;
    transform: none;
  }
  .tutorial-grid,
  .patchnotes-grid,
  .tutorial-unit-grid,
  .tutorial-terrain-row {
    grid-template-columns: 1fr;
  }
  .save-slots {
    grid-template-columns: 1fr;
  }
  .tutorial-board-example {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(3, minmax(0, 72px));
  }
  .tutorial-board-example--interactive {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(4, minmax(0, 62px));
  }
  .tutorial-initiative-controls,
  .tutorial-board-controls,
  .tutorial-stage-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .tutorial-team-lineup--interactive {
    grid-template-columns: 1fr;
  }
  .tutorial-unit-detail,
  .tutorial-roll-lab {
    grid-template-columns: 1fr;
  }
  .tutorial-roll-faceoff,
  .tutorial-attack-faceoff {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
  .tutorial-roll-faceoff-control {
    width: 100%;
  }
  .tutorial-roll-faceoff-control .tutorial-action-button {
    flex: 1 1 180px;
  }
  .tutorial-roll-faceoff-copy {
    text-align: center;
  }
  .tutorial-unit-detail img {
    justify-self: center;
  }
  .tutorial-stage-path--guided {
    grid-template-columns: 1fr;
  }
  .tutorial-stage-path--guided .tutorial-stage-arrow {
    transform: rotate(90deg);
  }
}

@media (max-width: 420px) {
  .tutorial-order-strip {
    grid-template-columns: 1fr;
  }
  .tutorial-initiative-summary,
  .tutorial-initiative-note {
    padding: 12px;
  }
}

/* Game Screen */
#game-screen {
  --game-ui-scale: 1;
  display: flex; flex-direction: column; height: 100%; position: relative;
}
#hud-top {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px;
  padding: calc(10px * var(--game-ui-scale)) calc(24px * var(--game-ui-scale)); background: rgba(0,0,0,0.4); border-bottom: 1px solid #333;
  position: relative;
}
#turn-indicator { font-size: calc(20px * var(--game-ui-scale)); font-weight: bold; }
#round-counter { font-size: calc(14px * var(--game-ui-scale)); color: #888; text-align: right; }
#turn-indicator,
#round-counter {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#hud-settings { position: relative; justify-self: start; }
.hud-top-button {
  padding: calc(10px * var(--game-ui-scale)) calc(14px * var(--game-ui-scale));
  border: 1px solid var(--dice-gold-deep);
  border-radius: calc(8px * var(--game-ui-scale));
  background: rgba(18, 20, 32, 0.5);
  color: var(--dice-gold-soft);
  font-size: calc(12px * var(--game-ui-scale));
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.hud-top-button:hover {
  background: var(--dice-gold-bg);
  color: var(--dice-gold-bright);
  border-color: var(--dice-gold-soft);
}
#settings-panel {
  position: fixed;
  top: 64px;
  left: 24px;
  width: 390px;
  max-height: 78vh;
  padding: 16px;
  border: 1px solid #5d4a2b;
  border-radius: 12px;
  background: rgba(18, 20, 32, 0.97);
  box-shadow: 0 18px 40px rgba(0,0,0,0.35);
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  z-index: 40;
}
#settings-panel h3 {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #d7c28c;
}
.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.settings-header button {
  padding: 8px 12px;
  border: 1px solid rgba(201, 130, 16, 0.72);
  border-radius: 8px;
  background: rgba(18, 20, 32, 0.36);
  color: #ead29a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}
.settings-header button:hover {
  background: var(--dice-gold-bg);
  color: var(--dice-gold-bright);
  border-color: var(--dice-gold-soft);
}
.settings-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.settings-tab-button {
  padding: 10px 12px;
  border: 1px solid rgba(201, 130, 16, 0.7);
  border-radius: 8px;
  background: rgba(18, 20, 32, 0.35);
  color: #e8d3a0;
  font-size: 11px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.settings-tab-button:hover {
  background: var(--dice-gold-bg);
  color: var(--dice-gold-bright);
  border-color: var(--dice-gold-soft);
}
.settings-tab-button.active {
  background: var(--dice-gold-bg-strong);
  color: var(--dice-gold-bright);
  border-color: var(--dice-gold-deep);
}
.settings-utility-row {
  display: flex;
  justify-content: stretch;
}
.settings-utility-row button {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(201, 130, 16, 0.7);
  border-radius: 8px;
  background: rgba(18, 20, 32, 0.35);
  color: #e8d3a0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.settings-utility-row button:hover {
  background: var(--dice-gold-bg);
  color: var(--dice-gold-bright);
  border-color: var(--dice-gold-soft);
}
.settings-lock-panel {
  margin: 12px 0 14px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.settings-lock-panel.unlocked {
  border-color: rgba(120, 205, 122, 0.4);
  background: rgba(120, 205, 122, 0.08);
}
.settings-lock-title {
  font-size: 13px;
  font-weight: 700;
  color: #f3f6ff;
}
.settings-lock-subtitle {
  font-size: 11px;
  line-height: 1.4;
  color: #9da9c5;
}
.settings-lock-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
.settings-lock-controls input {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #46506a;
  border-radius: 8px;
  background: rgba(0,0,0,0.26);
  color: #f3f6ff;
}
.settings-lock-controls button {
  padding: 9px 12px;
  border: 1px solid var(--dice-gold-deep);
  border-radius: 8px;
  background: var(--dice-gold-bg);
  color: var(--dice-gold-soft);
  cursor: pointer;
}
.settings-lock-controls button:disabled {
  opacity: 0.6;
  cursor: default;
}
.settings-lock-status {
  font-size: 11px;
  color: #f2dc8c;
}
.settings-view {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.settings-note {
  font-size: 12px;
  line-height: 1.45;
  color: #9aa3bb;
}
#settings-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 48vh;
  overflow-y: auto;
  padding-right: 4px;
}
.settings-section {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  overflow: hidden;
}
.settings-section summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  color: #f2dc8c;
  font-size: 12px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}
.settings-section summary::-webkit-details-marker {
  display: none;
}
.settings-section summary::after {
  content: '+';
  font-size: 18px;
  line-height: 1;
  color: #fff4c6;
}
.settings-section[open] summary::after {
  content: '-';
}
.settings-section-meta {
  font-size: 10px;
  color: #9aa3bb;
  letter-spacing: 1.2px;
}
.settings-section-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 32vh;
  overflow-y: auto;
  padding: 0 10px 10px;
}
.settings-section-body::-webkit-scrollbar { width: 10px; }
.settings-section-body::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.05);
  border-radius: 999px;
}
.settings-section-body::-webkit-scrollbar-thumb {
  background: rgba(192,163,95,0.55);
  border-radius: 999px;
}
.settings-section-body::-webkit-scrollbar-thumb:hover {
  background: rgba(224,192,117,0.8);
}
.settings-row {
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.settings-row-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.settings-row-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #f3f6ff;
}
.settings-row-subtitle {
  font-size: 11px;
  line-height: 1.35;
  color: #8f97af;
}
.settings-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.settings-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.settings-field label {
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #aeb7cd;
}
.settings-field input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #46506a;
  border-radius: 8px;
  background: rgba(0,0,0,0.26);
  color: #f3f6ff;
}
.settings-field input:disabled,
.settings-lock-controls input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.settings-actions {
  display: flex;
  gap: 8px;
}
.settings-actions button {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--dice-gold-deep);
  border-radius: 8px;
  background: var(--dice-gold-bg);
  color: var(--dice-gold-soft);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.settings-actions button:hover {
  background: var(--dice-gold-bg-strong);
  color: var(--dice-gold-bright);
  border-color: var(--dice-gold-soft);
}
.settings-actions button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: rgba(255,255,255,0.04);
  color: #8f97af;
  border-color: #46506a;
}
.settings-actions button.secondary {
  border-color: rgba(201, 130, 16, 0.7);
  background: rgba(241, 180, 58, 0.08);
  color: #edd7a2;
}
.settings-actions button.secondary:hover {
  background: var(--dice-gold-bg-strong);
  border-color: var(--dice-gold-soft);
  color: var(--dice-gold-bright);
}
.sound-settings {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.coop-settings {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.coop-settings-summary {
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  color: #f3f6ff;
  font-size: 13px;
  line-height: 1.45;
}
.coop-settings-summary strong {
  color: #fff0bf;
}
.coop-settings-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.coop-preset-button {
  padding: 10px 12px;
  border: 1px solid rgba(201, 130, 16, 0.7);
  border-radius: 10px;
  background: rgba(18, 20, 32, 0.34);
  color: #ead29a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
.coop-preset-button:hover {
  background: var(--dice-gold-bg);
  color: var(--dice-gold-bright);
  border-color: var(--dice-gold-soft);
}
.coop-settings-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.coop-settings-row {
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.coop-settings-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.coop-settings-unit {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #f3f6ff;
  font-size: 14px;
  font-weight: 700;
}
.coop-settings-assigned {
  color: #9aa3bb;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.coop-settings-players {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.coop-player-button {
  padding: 10px 0;
  border: 1px solid rgba(120, 208, 255, 0.26);
  border-radius: 10px;
  background: rgba(26, 38, 60, 0.66);
  color: #cfeaff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.coop-player-button:hover {
  border-color: rgba(168, 232, 255, 0.54);
  background: rgba(53, 102, 156, 0.5);
  color: #f4fcff;
}
.coop-player-button.active {
  border-color: rgba(255, 223, 128, 0.7);
  background: linear-gradient(180deg, rgba(255, 215, 74, 0.3), rgba(255, 158, 64, 0.18));
  color: #fff7d1;
  box-shadow: 0 0 18px rgba(255, 208, 72, 0.2), inset 0 1px 0 rgba(255, 248, 207, 0.18);
}
.coop-settings-footer {
  color: #9aa3bb;
  font-size: 11px;
  line-height: 1.45;
}
.sound-row {
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sound-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.sound-row-title {
  font-size: 14px;
  font-weight: 600;
  color: #f3f6ff;
}
.sound-row-subtitle {
  font-size: 11px;
  color: #8f97af;
}
.sound-row-value {
  font-size: 12px;
  font-weight: 700;
  color: #f2dc8c;
}
.sound-slider {
  width: 100%;
  accent-color: #c0a35f;
}
#settings-form::-webkit-scrollbar { width: 10px; }
#settings-form::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.05);
  border-radius: 999px;
}
#settings-form::-webkit-scrollbar-thumb {
  background: rgba(192,163,95,0.55);
  border-radius: 999px;
}
#settings-form::-webkit-scrollbar-thumb:hover {
  background: rgba(224,192,117,0.8);
}
#game-area {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 10px;
}
#board-stage-area {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: calc(10px * var(--game-ui-scale));
}
#board-stage-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
canvas#grid {
  border: 2px solid #5d4a2b;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(187, 152, 96, 0.18);
  background: linear-gradient(180deg, #7aa652 0%, #6b8f49 100%);
  touch-action: manipulation;
}
.side-panel {
  width: 180px; background: rgba(0,0,0,0.3); border-radius: 8px; padding: 12px;
  display: flex; flex-direction: column; gap: 8px; max-height: 100%; overflow-y: auto;
}
#panel-left,
#panel-right {
  min-height: 0;
  max-height: min(100%, calc(100vh - 180px));
  overflow: hidden;
}
.collapsible-side-panel {
  width: 200px;
  height: 430px;
  max-height: 70vh;
  align-self: center;
  overflow: hidden;
  transition: width 0.2s ease, padding 0.2s ease;
}
.collapsible-side-panel.collapsed {
  width: 52px;
  padding: 10px 8px;
}
#panel-treasure.collapsed {
  display: none;
}
#panel-guide.collapsed {
  display: none;
}
#panel-rules.collapsed {
  display: none;
}
#panel-initiative:not(.collapsed) {
  width: 200px;
}
.history-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  flex: 1;
}
.collapsible-side-panel.collapsed .history-content {
  display: none;
}
.history-toggle {
  border: 1px solid rgba(201, 130, 16, 0.72);
  background: rgba(18, 20, 32, 0.42);
  color: #ead29a;
  border-radius: 8px;
  padding: 10px 8px;
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  align-self: stretch;
  min-height: 120px;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.history-toggle:hover {
  background: var(--dice-gold-bg);
  color: var(--dice-gold-bright);
  border-color: var(--dice-gold-soft);
}
.collapsible-side-panel:not(.collapsed) .history-toggle {
  writing-mode: horizontal-tb;
  text-orientation: initial;
  min-height: auto;
  width: 100%;
  padding: 10px 12px;
}
.side-panel-header {
  display: flex;
  align-items: center;
  justify-content: stretch;
  gap: 0;
  padding-bottom: 6px;
  border-bottom: 1px solid #333;
  margin-bottom: 8px;
}
.side-panel h3,
.side-panel-title {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #888;
}
.panel-title-button {
  width: 100%;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  border: 1px solid rgba(241, 180, 58, 0.48);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(18, 20, 32, 0.74) 0%, rgba(18, 20, 32, 0.46) 100%);
  color: var(--dice-gold-soft);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.panel-title-button:hover {
  background: linear-gradient(180deg, rgba(241, 180, 58, 0.9) 0%, rgba(201, 130, 16, 0.95) 100%);
  color: #241606;
  border-color: var(--dice-gold-soft);
  box-shadow: 0 10px 22px rgba(201, 130, 16, 0.25);
}
#red-roster,
#blue-roster {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scrollbar-gutter: stable;
}
#red-roster::-webkit-scrollbar,
#blue-roster::-webkit-scrollbar {
  width: 10px;
}
#red-roster::-webkit-scrollbar-track,
#blue-roster::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.05);
  border-radius: 999px;
}
#red-roster::-webkit-scrollbar-thumb,
#blue-roster::-webkit-scrollbar-thumb {
  background: rgba(192,163,95,0.55);
  border-radius: 999px;
}
#red-roster::-webkit-scrollbar-thumb:hover,
#blue-roster::-webkit-scrollbar-thumb:hover {
  background: rgba(224,192,117,0.8);
}
.roster-unit {
  padding: 8px; border-radius: 6px; background: rgba(255,255,255,0.05); font-size: 13px;
  display: flex; flex-direction: column; gap: 2px;
  scroll-margin-block: 12px;
}
.roster-unit.hovered-target {
  transform: translateX(-2px);
}
.roster-unit.hovered-target.hovered-red {
  background: linear-gradient(180deg, rgba(115, 195, 255, 0.2) 0%, rgba(255,255,255,0.08) 100%);
  border: 1px solid rgba(190, 229, 255, 0.76);
  box-shadow: 0 0 16px rgba(78, 168, 222, 0.22);
}
.roster-unit.hovered-target.hovered-blue {
  background: linear-gradient(180deg, rgba(255, 119, 150, 0.22) 0%, rgba(255,255,255,0.08) 100%);
  border: 1px solid rgba(255, 191, 208, 0.76);
  box-shadow: 0 0 16px rgba(233, 69, 96, 0.24);
}
.roster-unit.hovered-target .unit-label {
  font-weight: 700;
}
.roster-unit.hovered-target .hp-bar {
  box-shadow: 0 0 12px rgba(255,255,255,0.12);
}
.roster-unit.hovered-target .hp-fill {
  filter: brightness(1.15);
}
.unit-label {
  display: flex;
  align-items: center;
  gap: 6px;
}
.unit-badge {
  width: 18px;
  height: 18px;
  object-fit: cover;
  border-radius: 4px;
  flex: 0 0 auto;
}
.unit-badge-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
}
.roster-unit.dead { opacity: 0.3; text-decoration: line-through; }
.roster-unit .hp-bar-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.roster-unit .hp-bar {
  position: relative;
  height: 6px;
  overflow: visible;
}
.roster-unit .hp-bar-track {
  position: relative;
  height: 100%;
  border-radius: 999px;
  background: #333;
  overflow: hidden;
}
.roster-unit .hp-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s;
}
.roster-unit .shield-fill {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 999px;
  background: rgba(88, 205, 255, 0.95);
  box-shadow: 0 0 8px rgba(88, 205, 255, 0.45);
  border: 1px solid rgba(212, 247, 255, 0.75);
  min-width: 2px;
  pointer-events: none;
}
.hp-status-badges {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.hp-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.22px;
  background: var(--badge-bg, rgba(255,255,255,0.1));
  border: 1px solid var(--badge-border, rgba(255,255,255,0.18));
  color: var(--badge-color, #eef4ff);
  cursor: help;
}
.roster-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.roster-hp-text {
  font-size: 11px;
  color: #777;
}
.roster-status-list {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.status-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.2px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.08);
  color: #dce3f5;
  cursor: help;
}
.status-chip.debuff {
  background: rgba(233, 69, 96, 0.16);
  border-color: rgba(255, 152, 170, 0.45);
  color: #ffd7df;
}
.status-chip.buff {
  background: rgba(83, 215, 105, 0.14);
  border-color: rgba(150, 244, 166, 0.4);
  color: #d7ffe0;
}
.status-chip.passive {
  background: rgba(241, 180, 58, 0.16);
  border-color: rgba(255, 214, 127, 0.42);
  color: #fff0b3;
}
.status-chip.neutral {
  background: rgba(113, 148, 224, 0.14);
  border-color: rgba(173, 199, 255, 0.38);
  color: #deebff;
}
#unit-guide,
#rules-guide,
#treasure-guide {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  min-height: 0;
  flex: 1;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: #5f6d9c rgba(255,255,255,0.05);
  overscroll-behavior: contain;
}
#panel-guide {
  width: 290px;
}
#panel-treasure {
  width: 290px;
}
#panel-rules {
  width: 290px;
}
.collapsible-side-panel #unit-guide::-webkit-scrollbar,
.collapsible-side-panel #rules-guide::-webkit-scrollbar,
.collapsible-side-panel #treasure-guide::-webkit-scrollbar {
  width: 10px;
}
.collapsible-side-panel #unit-guide::-webkit-scrollbar-track,
.collapsible-side-panel #rules-guide::-webkit-scrollbar-track,
.collapsible-side-panel #treasure-guide::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.05);
  border-radius: 999px;
}
.collapsible-side-panel #unit-guide::-webkit-scrollbar-thumb,
.collapsible-side-panel #rules-guide::-webkit-scrollbar-thumb,
.collapsible-side-panel #treasure-guide::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #6d7fb8 0%, #495b8f 100%);
  border-radius: 999px;
  border: 2px solid rgba(12, 16, 29, 0.95);
}
.collapsible-side-panel #unit-guide::-webkit-scrollbar-thumb:hover,
.collapsible-side-panel #rules-guide::-webkit-scrollbar-thumb:hover,
.collapsible-side-panel #treasure-guide::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #8194cf 0%, #5a6ea6 100%);
}
.guide-entry {
  border-radius: 6px;
  background: rgba(255,255,255,0.05);
  color: #cfd6e6;
  font-size: 12px;
  line-height: 1.35;
  overflow: hidden;
}
.guide-entry summary {
  list-style: none;
  cursor: pointer;
  padding: 8px 10px;
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.guide-entry summary::-webkit-details-marker {
  display: none;
}
.guide-entry summary::after {
  content: '+';
  color: #8ea3d8;
  font-size: 15px;
  line-height: 1;
}
.guide-entry[open] summary {
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.guide-entry[open] summary::after {
  content: '-';
}
.guide-entry-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px 10px;
  min-height: 110px;
  max-height: 220px;
  overflow-y: scroll;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #5f6d9c rgba(255,255,255,0.05);
}
.guide-entry-body::-webkit-scrollbar {
  width: 8px;
}
.guide-entry-body::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.05);
  border-radius: 999px;
}
.guide-entry-body::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #6d7fb8 0%, #495b8f 100%);
  border-radius: 999px;
  border: 1px solid rgba(12, 16, 29, 0.95);
}
.guide-entry-body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #8194cf 0%, #5a6ea6 100%);
}
.guide-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
  align-items: start;
}
.guide-key {
  color: #ffffff;
  font-weight: 700;
}
.guide-value {
  color: #cfd6e6;
}
.guide-entry strong {
  color: #ffffff;
}
.guide-team-selector {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.guide-team-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px 10px;
  border: 1px solid rgba(234, 210, 154, 0.28);
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  color: #d6dceb;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}
.guide-team-button:hover {
  transform: translateY(-1px);
  background: rgba(201, 130, 16, 0.14);
  border-color: rgba(234, 210, 154, 0.82);
  color: #fff1bf;
}
.guide-team-button.active {
  background: linear-gradient(180deg, rgba(241, 180, 58, 0.22) 0%, rgba(201, 130, 16, 0.18) 100%);
  border-color: var(--dice-gold-soft);
  color: #fff1bf;
  box-shadow: 0 8px 18px rgba(201, 130, 16, 0.18);
}
.guide-team-prompt-card {
  align-items: center;
  justify-content: center;
  min-height: 160px;
  text-align: center;
}
.unit-guide-selector {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.unit-guide-button {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  padding: 10px 10px;
  border: 1px solid rgba(201, 130, 16, 0.64);
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  color: #ead29a;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.unit-guide-button .unit-badge,
.unit-guide-button .unit-badge-fallback {
  width: 22px;
  height: 22px;
  border-radius: 6px;
}
.unit-guide-button:hover {
  transform: translateY(-1px);
  background: rgba(201, 130, 16, 0.14);
  border-color: rgba(234, 210, 154, 0.82);
  color: #fff1bf;
}
.unit-guide-button.active {
  background: linear-gradient(180deg, rgba(241, 180, 58, 0.22) 0%, rgba(201, 130, 16, 0.18) 100%);
  border-color: var(--dice-gold-soft);
  color: #fff1bf;
  box-shadow: 0 8px 18px rgba(201, 130, 16, 0.18);
}
.unit-info-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.03) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.unit-card-portrait-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  padding: 12px;
  border-radius: 12px;
  background:
    radial-gradient(circle at top, rgba(241, 180, 58, 0.18) 0%, rgba(18, 20, 32, 0) 58%),
    linear-gradient(180deg, rgba(18, 20, 32, 0.7) 0%, rgba(18, 20, 32, 0.42) 100%);
}
.unit-card-portrait-image {
  max-width: 100%;
  max-height: 190px;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.34));
}
.unit-card-portrait-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 140px;
  height: 140px;
  font-size: 76px;
}
.unit-card-title {
  color: #ffffff;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.15;
}
.unit-card-role {
  color: #f0cd7f;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.4px;
}
.unit-card-section {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.unit-card-section-title {
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.4px;
}
.unit-card-copy {
  color: #cfd6e6;
  font-size: 12px;
  line-height: 1.45;
}
.unit-card-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.unit-card-stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 9px;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
}
.unit-card-stat-label {
  color: #f1ddb2;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.unit-card-stat-value {
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
}
.treasure-info-card {
  min-height: 100%;
}
.treasure-placeholder-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  padding: 12px;
  border-radius: 12px;
  background:
    radial-gradient(circle at top, rgba(241, 180, 58, 0.18) 0%, rgba(18, 20, 32, 0) 60%),
    linear-gradient(180deg, rgba(18, 20, 32, 0.72) 0%, rgba(18, 20, 32, 0.42) 100%);
}
.treasure-art-image {
  max-width: 100%;
  max-height: 194px;
  object-fit: contain;
  filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.34));
}
.treasure-placeholder {
  --treasure-accent: #d1b56a;
  width: 166px;
  height: 166px;
  border-radius: 24px;
  border: 2px solid color-mix(in srgb, var(--treasure-accent) 58%, white 16%);
  background:
    radial-gradient(circle at 30% 24%, rgba(255,255,255,0.18) 0%, transparent 30%),
    linear-gradient(160deg, color-mix(in srgb, var(--treasure-accent) 34%, rgba(18, 20, 32, 0.96)) 0%, rgba(18, 20, 32, 0.96) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.1),
    0 16px 26px rgba(0, 0, 0, 0.25),
    0 0 26px color-mix(in srgb, var(--treasure-accent) 18%, transparent);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.treasure-placeholder-mark {
  color: #ffffff;
  font-size: 52px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 3px;
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.28);
}
.treasure-placeholder-label {
  color: #eadfbe;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.8px;
}
.rules-info-card {
  min-height: 100%;
}
#history-log,
#initiative-log {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  min-height: 0;
  flex: 1;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: #5f6d9c rgba(255,255,255,0.05);
  overscroll-behavior: contain;
}
.collapsible-side-panel #history-log::-webkit-scrollbar,
.collapsible-side-panel #initiative-log::-webkit-scrollbar {
  width: 10px;
}
.collapsible-side-panel #history-log::-webkit-scrollbar-track,
.collapsible-side-panel #initiative-log::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.05);
  border-radius: 999px;
}
.collapsible-side-panel #history-log::-webkit-scrollbar-thumb,
.collapsible-side-panel #initiative-log::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #6d7fb8 0%, #495b8f 100%);
  border-radius: 999px;
  border: 2px solid rgba(12, 16, 29, 0.95);
}
.collapsible-side-panel #history-log::-webkit-scrollbar-thumb:hover,
.collapsible-side-panel #initiative-log::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #8194cf 0%, #5a6ea6 100%);
}
.history-entry {
  padding: 7px 8px;
  border-radius: 6px;
  background: rgba(255,255,255,0.05);
  color: #cfd6e6;
  font-size: 12px;
  line-height: 1.35;
}
.initiative-entry {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 9px;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.05);
  color: #dbe4f6;
  font-size: 12px;
  position: relative;
  overflow: visible;
}
.initiative-entry.team-red {
  border-color: rgba(78, 168, 222, 0.34);
  background: rgba(78, 168, 222, 0.08);
}
.initiative-entry.team-blue {
  border-color: rgba(233, 69, 96, 0.34);
  background: rgba(233, 69, 96, 0.08);
}
.initiative-entry.active {
  background: rgba(241, 180, 58, 0.14);
  border-color: rgba(241, 180, 58, 0.45);
  box-shadow: 0 10px 20px rgba(201, 130, 16, 0.16);
  transform: translateY(-1px);
}
.initiative-entry.active::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 11px;
  pointer-events: none;
  animation: initiative-active-glow 1.8s ease-in-out infinite;
}
.initiative-entry.team-red.active {
  background: linear-gradient(180deg, rgba(102, 191, 255, 0.34) 0%, rgba(55, 123, 199, 0.22) 100%);
  border-color: rgba(191, 231, 255, 0.92);
  box-shadow: 0 0 0 1px rgba(191, 231, 255, 0.5), 0 0 18px rgba(78, 168, 222, 0.34), 0 12px 24px rgba(78, 168, 222, 0.26);
}
.initiative-entry.team-blue.active {
  background: linear-gradient(180deg, rgba(255, 122, 148, 0.34) 0%, rgba(192, 46, 74, 0.22) 100%);
  border-color: rgba(255, 205, 215, 0.92);
  box-shadow: 0 0 0 1px rgba(255, 205, 215, 0.5), 0 0 18px rgba(233, 69, 96, 0.36), 0 12px 24px rgba(233, 69, 96, 0.28);
}
.initiative-entry.team-red.active::after {
  border: 1px solid rgba(191, 231, 255, 0.76);
  box-shadow: 0 0 18px rgba(78, 168, 222, 0.42), 0 0 30px rgba(78, 168, 222, 0.18);
}
.initiative-entry.team-blue.active::after {
  border: 1px solid rgba(255, 205, 215, 0.76);
  box-shadow: 0 0 18px rgba(233, 69, 96, 0.44), 0 0 30px rgba(233, 69, 96, 0.2);
}
.initiative-entry.defeated {
  opacity: 0.52;
}
.initiative-entry.boss-slot {
  border-color: rgba(233, 69, 96, 0.3);
  background: rgba(233, 69, 96, 0.08);
}
.initiative-rank {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #0d1220;
  background: linear-gradient(180deg, #f6cf73 0%, #d1961b 100%);
}
.initiative-entry.boss-slot .initiative-rank {
  background: linear-gradient(180deg, #ff8ca4 0%, #d33d5b 100%);
}
.initiative-entry.active .initiative-rank {
  box-shadow: 0 0 12px rgba(255, 232, 173, 0.42);
}
.initiative-entry.active .initiative-roll {
  box-shadow: 0 0 14px rgba(255, 232, 173, 0.24);
}
.initiative-entry.team-red.active .initiative-roll {
  box-shadow: 0 0 14px rgba(140, 215, 255, 0.3);
}
.initiative-entry.team-blue.active .initiative-roll {
  box-shadow: 0 0 14px rgba(255, 161, 180, 0.32);
}
.initiative-entry.active .unit-badge,
.initiative-entry.active .unit-badge-fallback {
  box-shadow: 0 0 14px rgba(255,255,255,0.18);
}
@keyframes initiative-active-glow {
  0%,
  100% {
    opacity: 0.72;
  }
  50% {
    opacity: 1;
  }
}
.initiative-main {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.initiative-name {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 700;
  min-width: 0;
}
.initiative-name .unit-badge,
.initiative-name .unit-badge-fallback {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}
.initiative-roll {
  justify-self: end;
  min-width: 44px;
  padding: 4px 7px;
  border-radius: 999px;
  text-align: center;
  color: #fff1bf;
  background: rgba(201, 130, 16, 0.18);
  border: 1px solid rgba(241, 180, 58, 0.26);
  font-weight: 800;
}
.initiative-entry.defeated .initiative-name-text,
.initiative-entry.defeated .initiative-roll {
  text-decoration: line-through;
}
.initiative-empty {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  color: #aeb9d2;
  font-size: 12px;
  line-height: 1.45;
}
#hud-bottom {
  display: flex; align-items: center; justify-content: center;
  padding: calc(7px * var(--game-ui-scale)) calc(18px * var(--game-ui-scale)); background: rgba(0,0,0,0.4); border-top: 1px solid #333;
}
#hud-bottom-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(10px * var(--game-ui-scale));
  flex-wrap: wrap;
  width: 100%;
}
#mobile-turn-card {
  display: none;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(241, 180, 58, 0.28);
  border-radius: 14px;
  background:
    radial-gradient(circle at top right, rgba(241, 180, 58, 0.12) 0%, transparent 38%),
    linear-gradient(180deg, rgba(20, 24, 38, 0.96) 0%, rgba(15, 18, 30, 0.98) 100%);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.22);
}
#mobile-turn-card-header {
  color: #f1ddb2;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
#mobile-turn-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mobile-turn-titleline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.mobile-turn-owner {
  color: #8fd3ff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.mobile-turn-identity {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: #fff8da;
  font-size: 15px;
  font-weight: 800;
}
.mobile-turn-identity .unit-badge,
.mobile-turn-identity .unit-badge-fallback {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  flex: 0 0 auto;
}
.mobile-turn-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mobile-turn-hp {
  color: #d3dcf0;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.mobile-turn-statuses {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.mobile-turn-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.mobile-turn-action-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(241, 180, 58, 0.22);
  background: rgba(255, 215, 0, 0.08);
  color: #fff0b1;
  font-size: 12px;
  font-weight: 700;
}
.mobile-turn-action-chip.done {
  color: rgba(219, 200, 142, 0.72);
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  background: rgba(255, 215, 0, 0.03);
}
.mobile-turn-step {
  color: #dce5f5;
  font-size: 13px;
  line-height: 1.45;
}
.mobile-turn-step strong {
  color: #fff4c6;
}
.hud-panel-toggle {
  min-width: calc(96px * var(--game-ui-scale));
  white-space: nowrap;
}
#btn-guide-toggle {
  display: none !important;
}
#unit-info {
  flex: 0 1 auto;
  width: min(calc(780px * var(--game-ui-scale)), calc(100vw - 140px));
  min-width: calc(320px * var(--game-ui-scale));
  max-width: min(calc(780px * var(--game-ui-scale)), calc(100vw - 140px));
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: calc(6px * var(--game-ui-scale));
  font-size: calc(12.2px * var(--game-ui-scale));
  line-height: 1;
  padding: calc(8px * var(--game-ui-scale)) calc(12px * var(--game-ui-scale));
  border: 1px solid rgba(255, 215, 0, 0.58);
  border-radius: calc(8px * var(--game-ui-scale));
  background: linear-gradient(180deg, rgba(31, 42, 79, 0.92), rgba(16, 20, 34, 0.95));
  color: #fff4b3;
  box-shadow: 0 0 0 1px rgba(255, 215, 0, 0.12), 0 0 20px rgba(255, 215, 0, 0.16), inset 0 1px 0 rgba(255, 245, 197, 0.18);
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  text-overflow: clip;
  min-height: calc(44px * var(--game-ui-scale));
  scrollbar-width: none;
}
#unit-info::-webkit-scrollbar {
  display: none;
}
#unit-info > * {
  flex: 0 0 auto;
}
#unit-info .unit-badge,
#unit-info .unit-badge-fallback {
  width: calc(16px * var(--game-ui-scale));
  height: calc(16px * var(--game-ui-scale));
  border-radius: calc(4px * var(--game-ui-scale));
  vertical-align: text-bottom;
}
#unit-info .turn-flow-prefix {
  color: #ffd96c;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(255, 217, 108, 0.35);
}
#unit-info .turn-flow-owner {
  display: inline-flex;
  align-items: center;
  padding: calc(3px * var(--game-ui-scale)) calc(9px * var(--game-ui-scale));
  border-radius: calc(999px * var(--game-ui-scale));
  border: 1px solid rgba(121, 226, 192, 0.48);
  background: linear-gradient(180deg, rgba(84, 200, 158, 0.2), rgba(30, 98, 79, 0.18));
  color: #eafff8;
  font-weight: 700;
  box-shadow: 0 0 16px rgba(99, 220, 181, 0.14);
}
#unit-info .turn-flow-unit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fff7d6;
  font-weight: 700;
}
#unit-info .turn-flow-sep {
  color: rgba(255, 233, 156, 0.72);
}
#unit-info .turn-flow-action {
  display: inline-flex;
  align-items: center;
  padding: calc(3px * var(--game-ui-scale)) calc(9px * var(--game-ui-scale));
  border-radius: calc(999px * var(--game-ui-scale));
  border: 1px solid rgba(255, 223, 128, 0.32);
  background: rgba(255, 217, 108, 0.08);
  color: #fff2b2;
  font-weight: 600;
  transition: opacity 0.18s ease, color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
#unit-info .turn-flow-action.ready {
  color: #fff8cf;
  border-color: rgba(255, 223, 128, 0.6);
  background: linear-gradient(180deg, rgba(255, 223, 128, 0.18), rgba(255, 190, 73, 0.1));
  box-shadow: 0 0 14px rgba(255, 213, 74, 0.18), inset 0 1px 0 rgba(255, 248, 207, 0.22);
}
#unit-info .turn-flow-action.attention {
  animation: turn-flow-attention 1.35s ease-in-out infinite;
}
#unit-info .turn-flow-action.done {
  color: rgba(217, 195, 126, 0.72);
  border-color: rgba(217, 195, 126, 0.24);
  background: rgba(255, 217, 108, 0.04);
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  opacity: 0.8;
}
#unit-info .turn-flow-status {
  color: #ffd87f;
  font-weight: 700;
}
#unit-info .turn-flow-end-hint {
  display: inline-flex;
  align-items: center;
  padding: calc(3px * var(--game-ui-scale)) calc(9px * var(--game-ui-scale));
  border-radius: calc(999px * var(--game-ui-scale));
  border: 1px solid rgba(120, 208, 255, 0.35);
  background: rgba(79, 171, 255, 0.12);
  color: #cfeaff;
  font-weight: 700;
}
#unit-info .turn-flow-end-hint.ready {
  border-color: rgba(255, 223, 128, 0.7);
  background: linear-gradient(180deg, rgba(255, 215, 74, 0.28), rgba(255, 158, 64, 0.16));
  color: #fff8cf;
  box-shadow: 0 0 18px rgba(255, 208, 72, 0.24), inset 0 1px 0 rgba(255, 248, 207, 0.18);
}
#unit-info .turn-flow-end-hint.enemy {
  border-color: rgba(255, 120, 150, 0.35);
  background: rgba(233, 69, 96, 0.14);
  color: #ffd2dc;
}
#unit-info .turn-flow-end-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: calc(4px * var(--game-ui-scale)) calc(12px * var(--game-ui-scale));
  border-radius: calc(999px * var(--game-ui-scale));
  border: 1px solid rgba(120, 208, 255, 0.35);
  background: rgba(79, 171, 255, 0.12);
  color: #cfeaff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  pointer-events: auto;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
#unit-info .turn-flow-end-button:hover {
  transform: translateY(-1px);
}
#unit-info .turn-flow-end-button:disabled {
  opacity: 0.56;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
#unit-info .turn-flow-end-button.ready {
  border-color: rgba(255, 223, 128, 0.7);
  background: linear-gradient(180deg, rgba(255, 215, 74, 0.28), rgba(255, 158, 64, 0.16));
  color: #fff8cf;
  box-shadow: 0 0 18px rgba(255, 208, 72, 0.24), inset 0 1px 0 rgba(255, 248, 207, 0.18);
}
#unit-info .turn-flow-end-button.attention {
  animation: turn-flow-attention 1.35s ease-in-out infinite;
}
@keyframes turn-flow-attention {
  0%, 100% {
    box-shadow: 0 0 14px rgba(255, 208, 72, 0.2), inset 0 1px 0 rgba(255, 248, 207, 0.18);
    transform: translateY(0);
  }
  50% {
    box-shadow: 0 0 26px rgba(255, 208, 72, 0.42), inset 0 1px 0 rgba(255, 248, 207, 0.3);
    transform: translateY(-1px);
  }
}
#action-log { display: none; }
.hud-buttons { display: flex; gap: calc(6px * var(--game-ui-scale)); flex: 0 0 auto; }
.hud-buttons #btn-mobile-select-active {
  display: none;
}
.hud-buttons button {
  padding: calc(9px * var(--game-ui-scale)) calc(16px * var(--game-ui-scale));
  font-size: calc(14px * var(--game-ui-scale));
}
.hud-buttons #btn-end-turn.ready-to-end {
  box-shadow: 0 0 0 1px rgba(255, 223, 128, 0.18), 0 0 18px rgba(255, 204, 72, 0.28);
}
.hud-buttons #btn-ultimate.ready-to-cast {
  border-color: rgba(138, 245, 255, 0.68);
  color: #f3fdff;
  background: linear-gradient(180deg, rgba(72, 164, 255, 0.28), rgba(28, 94, 150, 0.28));
  box-shadow: 0 0 0 1px rgba(138, 245, 255, 0.14), 0 0 18px rgba(111, 220, 255, 0.26);
}
.hud-buttons #btn-ultimate.unavailable {
  opacity: 0.62;
  cursor: help;
  border-color: rgba(138, 245, 255, 0.22);
  background: rgba(72, 164, 255, 0.08);
  color: rgba(221, 241, 255, 0.86);
}
.hud-buttons button:disabled { opacity: 0.3; cursor: default; pointer-events: none; }
#coop-handoff-overlay {
  position: absolute;
  inset: 0;
  z-index: 58;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(18px * var(--game-ui-scale));
  background: rgba(6, 10, 18, 0.56);
}
.coop-handoff-card {
  width: min(calc(360px * var(--game-ui-scale)), 92%);
  padding: calc(20px * var(--game-ui-scale));
  border: 1px solid rgba(255, 223, 128, 0.56);
  border-radius: calc(18px * var(--game-ui-scale));
  background: linear-gradient(180deg, rgba(17, 24, 40, 0.97), rgba(9, 14, 24, 0.98));
  box-shadow: 0 26px 52px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 248, 207, 0.16);
  text-align: center;
}
.coop-handoff-kicker {
  color: #8fd3ff;
  font-size: calc(11px * var(--game-ui-scale));
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.coop-handoff-title {
  margin-top: calc(10px * var(--game-ui-scale));
  color: #fff0bf;
  font-size: calc(28px * var(--game-ui-scale));
  font-weight: 800;
  line-height: 1.08;
}
.coop-handoff-copy {
  margin: calc(12px * var(--game-ui-scale)) 0 calc(18px * var(--game-ui-scale));
  color: #d5e5f5;
  font-size: calc(14px * var(--game-ui-scale));
  line-height: 1.5;
}
#choice-actions {
  position: absolute;
  left: 0;
  top: 66%;
  transform: translateY(-50%);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: calc(14px * var(--game-ui-scale));
  z-index: 45;
  box-sizing: border-box;
  width: 100%;
}
#choice-actions[data-overlay-mode="summary"],
#choice-actions[data-overlay-mode="reward"],
#choice-actions[data-overlay-mode="result"] {
  top: 75%;
}
#choice-actions[data-overlay-mode="choice"] {
  top: 82%;
}
#choice-actions[data-overlay-mode="initiative"] {
  top: 83%;
}
.choice-button {
  min-width: calc(220px * var(--game-ui-scale));
  padding: calc(14px * var(--game-ui-scale)) calc(18px * var(--game-ui-scale));
  border: 2px solid var(--dice-gold-deep);
  border-radius: calc(12px * var(--game-ui-scale));
  background: rgba(20, 24, 38, 0.92);
  color: var(--dice-gold-soft);
  font-size: calc(15px * var(--game-ui-scale));
  font-weight: 700;
  letter-spacing: 0.4px;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(0,0,0,0.28);
  transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease;
}
.choice-button:hover {
  background: linear-gradient(180deg, rgba(241, 180, 58, 0.92) 0%, rgba(201, 130, 16, 0.96) 100%);
  color: #241606;
  transform: translateY(-1px);
}
.choice-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 12px 28px rgba(0,0,0,0.18);
}
#stage-summary-ultimates {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 14px);
  transform: translateX(-50%);
  width: min(calc(700px * var(--game-ui-scale)), calc(100vw - 96px));
  max-height: 360px;
  overflow-y: auto;
  padding: calc(16px * var(--game-ui-scale)) calc(18px * var(--game-ui-scale));
  border: 2px solid rgba(241, 180, 58, 0.7);
  border-radius: calc(16px * var(--game-ui-scale));
  background: rgba(12, 16, 26, 0.94);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(6px);
}
#dungeon-flow-guide {
  position: absolute;
  left: 50%;
  top: calc(28px * var(--game-ui-scale));
  transform: translateX(-50%);
  z-index: 52;
  width: min(calc(476px * var(--game-ui-scale)), calc(100vw - 64px));
}
#dungeon-flow-guide[data-mode="start"] {
  top: 50%;
  transform: translate(-50%, -50%);
}
.dungeon-flow-guide-card {
  padding: calc(18px * var(--game-ui-scale));
  border-radius: calc(16px * var(--game-ui-scale));
  border: 2px solid rgba(241, 180, 58, 0.7);
  background: rgba(12, 16, 26, 0.95);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(6px);
}
.dungeon-flow-guide-title {
  margin: 0 0 6px;
  color: var(--dice-gold-soft);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: center;
}
.dungeon-flow-guide-subtitle {
  margin: 0 0 12px;
  color: #d6dceb;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
}
#stage-summary-ultimates.route-choice-mode {
  width: min(calc(840px * var(--game-ui-scale)), calc(100vw - 96px));
  max-height: 620px;
  overflow-y: visible;
}
#stage-summary-ultimates.boss-ultimate-mode {
  width: min(calc(840px * var(--game-ui-scale)), calc(100vw - 96px));
  max-height: 500px;
}
#stage-summary-ultimates.final-stats-mode {
  width: min(calc(760px * var(--game-ui-scale)), calc(100vw - 96px));
  max-height: 420px;
}
#stage-summary-ultimates::-webkit-scrollbar {
  width: 10px;
}
#stage-summary-ultimates::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
}
#stage-summary-ultimates::-webkit-scrollbar-thumb {
  background: rgba(241, 180, 58, 0.7);
  border-radius: 999px;
}
.stage-summary-ultimates-title {
  margin: 0 0 10px;
  color: var(--dice-gold-soft);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: center;
}
.stage-summary-ultimates-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.stage-summary-ultimates-section {
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.stage-summary-ultimates-section h4 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.stage-summary-ultimates-section--active h4 {
  color: #8af5ff;
}
.stage-summary-ultimates-section--lost h4 {
  color: #ffb3a7;
}
.stage-summary-ultimates-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.stage-summary-ultimates-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stage-summary-ultimates-name {
  color: #f5f7ff;
  font-size: 14px;
  font-weight: 700;
}
.stage-summary-ultimates-effect {
  color: #d6dceb;
  font-size: 13px;
  line-height: 1.35;
}
.stage-summary-ultimates-empty {
  color: #c7cfdf;
  font-size: 13px;
  line-height: 1.35;
}
.stage-summary-ultimates-lead {
  margin: 0 0 14px;
  color: #d6dceb;
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}
.stage-summary-panel-actions {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}
.stage-summary-map-button {
  min-width: calc(220px * var(--game-ui-scale));
}
.dungeon-flow-panel {
  width: min(434px, 100%);
  margin: 0 auto;
}
.dungeon-flow-map {
  position: relative;
  width: 100%;
  aspect-ratio: 1155 / 1618;
  background: center / contain no-repeat url("Assets/Titles and Maps/Parchment Map.png");
}
.dungeon-flow-safe {
  position: absolute;
  inset: 8% 11.5% 8.5% 11.5%;
}
.dungeon-flow-heading {
  position: absolute;
  top: 7%;
  left: 50%;
  transform: translateX(-50%);
  color: #4c2d14;
  font-family: Georgia, "Times New Roman", serif;
  width: 100%;
  max-width: 72%;
  font-size: 25px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(255, 236, 186, 0.5);
}
.dungeon-flow-slot {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.dungeon-flow-line {
  position: absolute;
  z-index: 1;
  background: #6f4c29;
  box-shadow: 0 1px 0 rgba(255, 233, 190, 0.28);
}
.dungeon-flow-line--arrow-down::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 9px solid #6f4c29;
}
.dungeon-flow-line--stage1-link {
  left: calc(50% - 1.5px);
  top: 27.8%;
  width: 3px;
  height: 6.8%;
}
.dungeon-flow-line--stage2-link {
  left: calc(50% - 1.5px);
  top: 44.3%;
  width: 3px;
  height: 3.8%;
}
.dungeon-flow-line--camp-link-top {
  left: calc(50% - 1.5px);
  top: 48.1%;
  width: 3px;
  height: 11.4%;
}
.dungeon-flow-line--camp-link-bottom {
  left: calc(50% - 1.5px);
  top: 71%;
  width: 3px;
  height: 5.2%;
}
.dungeon-flow-line--choice-stem {
  left: calc(50% - 1.5px);
  top: 53.5%;
  width: 3px;
  height: 3.1%;
}
.dungeon-flow-line--choice-split {
  left: 29%;
  top: 56.5%;
  width: 42%;
  height: 3px;
}
.dungeon-flow-line--choice-left {
  left: 29%;
  top: 56.5%;
  width: 3px;
  height: 2.9%;
}
.dungeon-flow-line--choice-right {
  right: 29%;
  top: 56.5%;
  width: 3px;
  height: 2.9%;
}
.dungeon-flow-line--merge-left {
  left: 29%;
  top: 70.9%;
  width: 3px;
  height: 3.8%;
}
.dungeon-flow-line--merge-right {
  right: 29%;
  top: 70.9%;
  width: 3px;
  height: 3.8%;
}
.dungeon-flow-line--merge-bar {
  left: 29%;
  top: 74.5%;
  width: 42%;
  height: 3px;
}
.dungeon-flow-line--encounter3-link {
  left: calc(50% - 1.5px);
  top: 74.5%;
  width: 3px;
  height: 2.2%;
}
.dungeon-flow-line--boss-link {
  left: calc(50% - 1.5px);
  top: 85.4%;
  width: 3px;
  height: 3.9%;
}
.dungeon-flow-slot--encounter1,
.dungeon-flow-slot--encounter2,
.dungeon-flow-slot--encounter3,
.dungeon-flow-slot--boss {
  left: 24%;
  width: 52%;
  height: 8.8%;
}
.dungeon-flow-slot--encounter1 { top: 18.4%; }
.dungeon-flow-slot--encounter2 { top: 35.1%; }
.dungeon-flow-slot--encounter3 { top: 76.2%; }
.dungeon-flow-slot--boss { top: 89.4%; }
.dungeon-flow-slot--choice {
  left: 36%;
  top: 47.7%;
  width: 28%;
  height: 5.8%;
}
.dungeon-flow-slot--branch-left,
.dungeon-flow-slot--branch-right {
  top: 59.2%;
  width: 31%;
  height: 11.8%;
}
.dungeon-flow-slot--branch-left { left: 13.5%; }
.dungeon-flow-slot--branch-right { right: 13.5%; }
.dungeon-flow-map.camp-only .dungeon-flow-slot--branch-right {
  left: 24%;
  right: auto;
  width: 52%;
  top: 58.8%;
  height: 11%;
}
.dungeon-flow-node {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 6px 10px;
  border-radius: 10px;
  border: 2px solid rgba(132, 88, 44, 0.95);
  background: linear-gradient(180deg, #ffe7a0 0%, #e0be73 100%);
  color: #2f1b0d;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
  box-shadow: 0 4px 0 rgba(120, 76, 37, 0.34), inset 0 1px 0 rgba(255, 246, 214, 0.86);
}
.dungeon-flow-node.choice-pill {
  border-width: 2px;
  border-radius: 10px;
}
.dungeon-flow-slot--branch-left .dungeon-flow-node,
.dungeon-flow-slot--branch-right .dungeon-flow-node {
  font-size: 13px;
  line-height: 1.04;
}
.dungeon-flow-node.completed {
  background: linear-gradient(180deg, #f6dda1 0%, #d7b16a 100%);
  color: rgba(47, 27, 13, 0.72);
  border-color: rgba(132, 88, 44, 0.95);
  box-shadow: 0 3px 0 rgba(120, 76, 37, 0.26), inset 0 1px 0 rgba(255, 246, 214, 0.64);
  text-decoration: line-through;
  text-decoration-thickness: 3px;
  text-decoration-color: rgba(92, 52, 20, 0.82);
  filter: saturate(0.72);
}
.dungeon-flow-node.completed::before {
  content: "Cleared";
  position: absolute;
  left: 50%;
  bottom: -11px;
  transform: translateX(-50%);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(66, 104, 48, 0.82);
  background: linear-gradient(180deg, #e9ffd7 0%, #85bf65 100%);
  color: #244116;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
}
.dungeon-flow-node.active {
  background: linear-gradient(180deg, #fff0ae 0%, #f0c15d 54%, #cf8d2c 100%);
  color: #241304;
  border-color: rgba(74, 132, 52, 0.98);
  box-shadow: 0 4px 0 rgba(120, 76, 37, 0.36), inset 0 1px 0 rgba(255, 247, 220, 0.92), 0 0 0 2px rgba(154, 235, 140, 0.34), 0 0 28px rgba(107, 228, 99, 0.66);
  animation: dungeon-flow-active-pulse 1.45s ease-in-out infinite;
}
.dungeon-flow-node.active::after {
  content: "Click";
  position: absolute;
  top: -11px;
  right: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(73, 115, 44, 0.9);
  background: linear-gradient(180deg, #f1ffe0 0%, #7ccf62 100%);
  color: #224118;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18), 0 0 12px rgba(118, 222, 99, 0.38);
}
button.dungeon-flow-node {
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.18s ease, filter 0.18s ease;
}
button.dungeon-flow-node:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
  box-shadow: 0 4px 0 rgba(120, 76, 37, 0.36), inset 0 1px 0 rgba(255, 246, 214, 0.92), 0 0 34px rgba(107, 228, 99, 0.72);
}
.dungeon-flow-map.camp-only .dungeon-flow-slot--choice,
.dungeon-flow-map.camp-only .dungeon-flow-slot--branch-left,
.dungeon-flow-map.camp-only .dungeon-flow-line--choice-stem,
.dungeon-flow-map.camp-only .dungeon-flow-line--choice-split,
.dungeon-flow-map.camp-only .dungeon-flow-line--choice-left,
.dungeon-flow-map.camp-only .dungeon-flow-line--choice-right,
.dungeon-flow-map.camp-only .dungeon-flow-line--merge-left,
.dungeon-flow-map.camp-only .dungeon-flow-line--merge-right,
.dungeon-flow-map.camp-only .dungeon-flow-line--merge-bar,
.dungeon-flow-map.camp-only .dungeon-flow-line--encounter3-link {
  display: none;
}
@keyframes dungeon-flow-active-pulse {
  0%,
  100% {
    box-shadow: 0 4px 0 rgba(120, 76, 37, 0.36), inset 0 1px 0 rgba(255, 247, 220, 0.92), 0 0 0 2px rgba(154, 235, 140, 0.24), 0 0 18px rgba(107, 228, 99, 0.4);
  }
  50% {
    box-shadow: 0 4px 0 rgba(120, 76, 37, 0.38), inset 0 1px 0 rgba(255, 247, 220, 0.98), 0 0 0 3px rgba(154, 235, 140, 0.34), 0 0 40px rgba(107, 228, 99, 0.82);
  }
}
.stage-summary-ultimate-card {
  gap: 6px;
}
.stage-summary-ultimate-ability {
  color: var(--dice-gold-soft);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.03em;
}
.stage-summary-ultimate-details {
  margin: 4px 0 0;
  padding-left: 18px;
  color: #cfd6e6;
  font-size: 12px;
  line-height: 1.4;
}
.stage-summary-ultimate-details li + li {
  margin-top: 4px;
}
.route-choice-subtitle {
  margin: 0 0 14px;
  color: #d6dceb;
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}
.route-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.route-choice-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}
.route-choice-progress-copy {
  color: #e2e8f7;
  font-size: 12px;
  line-height: 1.35;
}
.route-choice-progress-count {
  flex: 0 0 auto;
  color: #fff0b3;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.route-choice-summary-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 14px;
}
.route-choice-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
}
.route-choice-summary-row.is-chosen {
  border-color: rgba(241, 180, 58, 0.24);
}
.route-choice-summary-row.is-focused {
  border-color: rgba(241, 180, 58, 0.6);
  box-shadow: 0 0 0 1px rgba(241, 180, 58, 0.12) inset;
}
.route-choice-summary-name {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #f4f7ff;
  font-size: 12px;
  font-weight: 700;
}
.route-choice-summary-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.route-choice-summary-choice {
  color: #d6dceb;
  font-size: 11px;
  font-weight: 700;
}
.route-choice-summary-change {
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(201, 130, 16, 0.72);
  background: rgba(20, 24, 38, 0.82);
  color: #f0d48a;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}
.route-choice-summary-change:hover {
  background: rgba(34, 40, 56, 0.94);
}
.route-choice-card {
  padding: 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  overflow: visible;
}
.route-choice-card--selected {
  border-color: rgba(241, 180, 58, 0.34);
  box-shadow: 0 0 0 1px rgba(241, 180, 58, 0.14) inset;
}
.route-choice-card-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}
.route-choice-card-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff4c6;
  font-size: 14px;
  font-weight: 800;
}
.route-choice-card-status {
  color: #c7cfdf;
  font-size: 12px;
  line-height: 1.35;
}
.route-choice-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.route-choice-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 114px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(16, 20, 32, 0.72);
  color: #dde5f5;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
  overflow: visible;
}
.route-choice-option strong {
  color: #fff4c6;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.route-choice-option-copy {
  color: #d4dced;
  font-size: 12px;
  line-height: 1.4;
}
.route-choice-relic-line {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  margin-top: 2px;
}
.route-choice-relic-label {
  color: #9eb2db;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.route-choice-option:focus-visible {
  outline: 2px solid rgba(255, 223, 142, 0.8);
  outline-offset: 2px;
}
.route-choice-option:hover {
  border-color: rgba(241, 180, 58, 0.48);
  background: rgba(28, 32, 46, 0.92);
  transform: translateY(-1px);
}
.route-choice-option.selected {
  border-color: rgba(241, 180, 58, 0.76);
  background: linear-gradient(180deg, rgba(241, 180, 58, 0.14) 0%, rgba(20, 24, 38, 0.96) 100%);
  box-shadow: 0 0 0 1px rgba(241, 180, 58, 0.2) inset;
}
.route-choice-relic-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
}
.route-choice-relic-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff1b3;
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
  cursor: pointer;
}
.route-choice-relic-trigger:hover,
.route-choice-relic-trigger:focus-visible {
  color: #fff7d1;
}
.route-choice-relic-trigger:focus-visible {
  outline: 2px solid rgba(255, 223, 142, 0.72);
  outline-offset: 2px;
  border-radius: 4px;
}
.route-choice-relic-card {
  position: relative;
  z-index: 18;
  width: min(260px, 100%);
  margin-top: 8px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 214, 127, 0.34);
  background: linear-gradient(180deg, rgba(17, 20, 31, 0.98) 0%, rgba(10, 12, 20, 0.98) 100%);
  box-shadow: 0 14px 28px rgba(0,0,0,0.42), 0 0 0 1px rgba(255, 214, 127, 0.08) inset;
  display: none;
}
.route-choice-relic-wrap:hover .route-choice-relic-card,
.route-choice-relic-wrap.open .route-choice-relic-card {
  display: block;
}
.route-choice-relic-card-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 8px;
}
.route-choice-relic-image {
  display: block;
  width: min(124px, 100%);
  max-height: 92px;
  object-fit: contain;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.28));
}
.route-choice-relic-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.route-choice-relic-card-title {
  color: #fff1b7;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}
.route-choice-relic-card-owner {
  color: #9eb2db;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.route-choice-relic-card-lines {
  margin: 2px 0 0;
  padding-left: 16px;
  color: #dee6f5;
  font-size: 11px;
  line-height: 1.38;
}
.route-choice-relic-card-lines li + li {
  margin-top: 4px;
}
.result-stats-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.result-stats-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.result-stats-name {
  color: #f5f7ff;
  font-size: 14px;
  font-weight: 700;
}
.result-stats-values {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: #d6dceb;
  font-size: 13px;
  line-height: 1.35;
}
.result-stats-values strong {
  color: #fff1bf;
}
#mobile-hub-overlay {
  position: fixed;
  inset: 0;
  z-index: 85;
  padding: 14px;
  background: rgba(8, 12, 20, 0.72);
  backdrop-filter: blur(8px);
}
#mobile-hub-card {
  width: min(760px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  margin: 0 auto;
  border-radius: 18px;
  border: 1px solid rgba(241, 180, 58, 0.32);
  background:
    radial-gradient(circle at top right, rgba(241, 180, 58, 0.12) 0%, transparent 34%),
    linear-gradient(180deg, rgba(18, 20, 32, 0.97) 0%, rgba(15, 19, 31, 0.98) 100%);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.38);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.mobile-hub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.mobile-hub-kicker {
  color: #f2dc8c;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.mobile-hub-title {
  color: #ffffff;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.05;
}
#mobile-hub-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 16px 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(241, 180, 58, 0.6) rgba(255,255,255,0.05);
}
#mobile-hub-nav::-webkit-scrollbar {
  height: 10px;
}
#mobile-hub-nav::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.05);
  border-radius: 999px;
}
#mobile-hub-nav::-webkit-scrollbar-thumb {
  background: rgba(241, 180, 58, 0.62);
  border-radius: 999px;
}
.mobile-hub-nav-button {
  flex: 0 0 auto;
  min-width: max-content;
  padding: 9px 12px;
  border: 1px solid rgba(201, 130, 16, 0.72);
  border-radius: 999px;
  background: rgba(18, 20, 32, 0.36);
  color: #ead29a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  white-space: nowrap;
  text-transform: uppercase;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.mobile-hub-nav-button.active {
  background: linear-gradient(180deg, rgba(241, 180, 58, 0.92) 0%, rgba(201, 130, 16, 0.96) 100%);
  color: #241606;
  border-color: var(--dice-gold-soft);
}
#mobile-hub-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 16px 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(241, 180, 58, 0.6) rgba(255,255,255,0.05);
}
#mobile-hub-content::-webkit-scrollbar {
  width: 12px;
}
#mobile-hub-content::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.05);
  border-radius: 999px;
}
#mobile-hub-content::-webkit-scrollbar-thumb {
  background: rgba(241, 180, 58, 0.62);
  border-radius: 999px;
  border: 2px solid rgba(12, 16, 29, 0.95);
}
.mobile-hub-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mobile-hub-panel-title {
  color: #fff4c6;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.15;
}
.mobile-hub-panel-subtitle {
  color: #c7d0e6;
  font-size: 14px;
  line-height: 1.5;
}
.mobile-hub-panel-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mobile-hub-footer {
  display: flex;
  gap: 10px;
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.mobile-hub-footer button,
#btn-mobile-hub-close {
  min-height: 46px;
}
.mobile-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.mobile-overview-card,
.mobile-overview-roster-card,
.mobile-overview-turn-flow {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}
.mobile-overview-card-label,
.mobile-overview-section-title {
  color: #f1ddb2;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.mobile-overview-card-value {
  color: #ffffff;
  font-size: 22px;
  font-weight: 800;
  margin-top: 4px;
}
.mobile-overview-turn-copy,
.mobile-overview-turn-note,
.mobile-overview-empty {
  color: #dbe4f5;
  font-size: 13px;
  line-height: 1.5;
}
.mobile-overview-turn-note {
  margin-top: 8px;
}
.mobile-overview-rosters {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.mobile-overview-roster-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mobile-overview-roster-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
}
.mobile-overview-roster-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.mobile-overview-roster-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #f7faff;
  font-size: 13px;
  font-weight: 700;
}
.mobile-overview-roster-hp {
  color: #c6d0e7;
  font-size: 12px;
  font-weight: 600;
}
.mobile-overview-roster-statuses {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
@media (max-width: 900px) {
  #stage-summary-ultimates {
    width: min(560px, calc(100vw - 48px));
    max-height: 300px;
  }
  .dungeon-flow-heading {
    font-size: 23px;
  }
  #dungeon-flow-guide {
    width: min(95vw, 460px);
    top: 18px;
  }
  .stage-summary-ultimates-grid {
    grid-template-columns: 1fr;
  }
  #stage-summary-ultimates.route-choice-mode {
    width: min(92vw, 700px);
    max-height: 82vh;
    overflow-y: auto;
  }
  #stage-summary-ultimates.boss-ultimate-mode {
    width: min(92vw, 720px);
    max-height: 72vh;
  }
  #stage-summary-ultimates.final-stats-mode {
    width: min(92vw, 700px);
    max-height: 60vh;
  }
  .route-choice-grid,
  .route-choice-options {
    grid-template-columns: 1fr;
  }
  .route-choice-progress {
    flex-direction: column;
    align-items: flex-start;
  }
  .route-choice-summary-row {
    align-items: flex-start;
    flex-direction: column;
  }
  .route-choice-summary-actions {
    width: 100%;
    justify-content: space-between;
  }
  .route-choice-card {
    padding: 10px;
  }
  .route-choice-relic-card {
    width: min(270px, 100%);
  }
}
@media (max-width: 980px) {
  #hud-top {
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 8px 12px;
  }
  #hud-settings,
  #panel-left,
  #panel-right,
  #panel-history,
  #panel-initiative,
  #panel-guide,
  #panel-treasure,
  #panel-rules,
  #btn-treasure-panel-toggle,
  #btn-guide-toggle,
  #btn-rules-toggle {
    display: none !important;
  }
  #dungeon-flow-guide[data-mode="start"] {
    top: 46%;
  }
  .dungeon-flow-heading {
    font-size: 22px;
  }
  .dungeon-flow-panel {
    width: min(446px, 100%);
  }
  #turn-indicator {
    font-size: 16px;
  }
  #round-counter {
    font-size: 12px;
  }
  #game-area {
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 8px 10px 6px;
  }
  #board-stage-area {
    width: 100%;
  }
  #board-stage-inner {
    width: 100%;
    justify-content: center;
  }
  canvas#grid {
    max-width: min(96vw, 96vh);
    max-height: calc(100vh - 230px);
  }
  #hud-bottom {
    padding: 8px 10px calc(env(safe-area-inset-bottom, 0px) + 8px);
  }
  #hud-bottom-center {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }
  #mobile-turn-card {
    display: flex;
    order: 0;
  }
  #unit-info {
    display: none;
  }
  .hud-buttons {
    order: 1;
    width: 100%;
    justify-content: stretch;
    gap: 8px;
  }
  .hud-buttons #btn-mobile-select-active {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .hud-buttons button {
    flex: 1 1 0;
    min-height: 46px;
    padding: 11px 12px;
    font-size: 15px;
  }
  #choice-actions {
    top: 72%;
    gap: 10px;
    padding: 0 10px;
  }
  #choice-actions[data-overlay-mode="summary"],
  #choice-actions[data-overlay-mode="reward"],
  #choice-actions[data-overlay-mode="result"] {
    top: 79%;
  }
  #choice-actions[data-overlay-mode="choice"] {
    top: 74%;
  }
  #choice-actions[data-overlay-mode="initiative"] {
    top: 85%;
  }
  .choice-button {
    min-width: 0;
    width: min(92vw, 320px);
  }
  #stage-summary-ultimates {
    width: min(92vw, 620px);
    max-height: 54vh;
    bottom: calc(100% + 10px);
  }
  #stage-summary-ultimates.route-choice-mode {
    width: min(92vw, 680px);
    max-height: 64vh;
  }
  #stage-summary-ultimates.boss-ultimate-mode {
    width: min(92vw, 680px);
    max-height: 68vh;
  }
  #stage-summary-ultimates.final-stats-mode {
    width: min(92vw, 680px);
    max-height: 58vh;
  }
  #settings-panel {
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
    max-height: none;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    z-index: 90;
  }
  .coop-settings-presets,
  .coop-settings-players {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .battle-setup-mode-row,
  .battle-setup-versus-grid,
  .battle-setup-versus-list {
    grid-template-columns: 1fr;
  }
  #mobile-hub-card {
    width: calc(100vw - 28px);
    max-height: calc(100vh - 28px);
  }
  #mobile-hub-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
    gap: 8px;
  }
  #mobile-hub-nav::-webkit-scrollbar {
    display: none;
  }
  .mobile-hub-nav-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    white-space: normal;
    text-align: center;
    line-height: 1.15;
  }
}
@media (max-width: 980px) and (orientation: landscape) {
  #hud-top {
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    padding: 6px 10px;
  }
  #turn-indicator {
    font-size: 13px;
  }
  #round-counter {
    font-size: 11px;
  }
  .hud-top-button {
    padding: 8px 10px;
    font-size: 10px;
  }
  #game-area {
    padding: 4px 8px 2px;
    justify-content: center;
  }
  canvas#grid {
    max-width: min(95vw, 1080px);
    max-height: calc(100vh - 86px);
  }
  #hud-bottom {
    padding: 4px 8px calc(env(safe-area-inset-bottom, 0px) + 4px);
  }
  #hud-bottom-center {
    flex-direction: row;
    gap: 6px;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: stretch;
  }
  #mobile-turn-card {
    flex: 1 1 auto;
    min-width: 0;
    padding: 8px 10px;
    gap: 4px;
  }
  #mobile-turn-card-header {
    font-size: 10px;
  }
  .mobile-turn-titleline {
    gap: 8px;
  }
  .mobile-turn-identity {
    font-size: 13px;
  }
  .mobile-turn-identity .unit-badge,
  .mobile-turn-identity .unit-badge-fallback {
    width: 20px;
    height: 20px;
  }
  .mobile-turn-hp {
    font-size: 11px;
  }
  .mobile-turn-statuses {
    gap: 3px;
  }
  .mobile-turn-action-chip {
    min-height: 24px;
    padding: 4px 8px;
    font-size: 10px;
  }
  .mobile-turn-step {
    font-size: 10px;
    line-height: 1.25;
  }
  .hud-buttons {
    width: min(42vw, 360px);
    flex: 0 0 min(42vw, 360px);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 1fr;
    justify-content: stretch;
  }
  .hud-buttons button {
    min-height: 34px;
    padding: 6px 8px;
    font-size: 11px;
  }
  #settings-panel {
    top: 6px;
    left: 6px;
    right: 6px;
    bottom: 6px;
    max-height: none;
    width: auto;
    padding: 12px;
    border-radius: 14px;
  }
  #mobile-hub-card {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    border-radius: 16px;
  }
  #choice-actions {
    top: 68%;
  }
  #choice-actions[data-overlay-mode="summary"],
  #choice-actions[data-overlay-mode="reward"],
  #choice-actions[data-overlay-mode="result"] {
    top: 74%;
  }
  #choice-actions[data-overlay-mode="choice"] {
    top: 70%;
  }
  #choice-actions[data-overlay-mode="initiative"] {
    top: 81%;
  }
  .mobile-hub-header {
    padding: 10px 12px 8px;
  }
  .mobile-hub-title {
    font-size: 18px;
  }
  #mobile-hub-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding: 8px 12px 6px;
  }
  .mobile-hub-nav-button {
    min-height: 38px;
    padding: 6px 8px;
    font-size: 10px;
  }
  #mobile-hub-content {
    padding: 0 12px 10px;
  }
  .mobile-hub-panel {
    gap: 10px;
  }
  .mobile-hub-panel-title {
    font-size: 18px;
  }
  .mobile-hub-panel-subtitle {
    font-size: 12px;
    line-height: 1.4;
  }
  .mobile-hub-footer {
    padding: 10px 12px 12px;
    gap: 8px;
  }
  .mobile-hub-footer button,
  #btn-mobile-hub-close {
    min-height: 40px;
  }
}
#btn-play-again {
  border-color: var(--dice-gold-deep);
  color: var(--dice-gold-soft);
}
#btn-play-again:hover {
  background: linear-gradient(180deg, rgba(241, 180, 58, 0.92) 0%, rgba(201, 130, 16, 0.96) 100%);
  color: #241606;
}
.jellykid-home-tag {
  position: fixed;
  top: max(0px, env(safe-area-inset-top));
  left: max(0px, env(safe-area-inset-left));
  z-index: 10000;
  width: 155px;
  height: 53px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 5px 10px 4px 8px;
  color: #ffffff;
  text-decoration: none;
  background: #131a31;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.22);
  -webkit-tap-highlight-color: transparent;
}

.jellykid-home-tag__mark {
  position: relative;
  width: 46px;
  height: 43px;
  flex: 0 0 46px;
  border: 4px solid #050918;
  border-radius: 56% 44% 48% 52% / 54% 55% 45% 46%;
  display: grid;
  place-items: center;
  color: #07334a;
  font-family: "Trebuchet MS", "Arial Rounded MT Bold", system-ui, sans-serif;
  font-size: 24px;
  font-weight: 1000;
  line-height: 1;
  background: linear-gradient(#a8f1ff, #61ddff 72%, #45c9ee);
  box-shadow: 0 3px 0 #1b9fd0;
}

.jellykid-home-tag__mark::after {
  position: absolute;
  right: 4px;
  bottom: -12px;
  width: 11px;
  height: 17px;
  border: 4px solid #050918;
  border-top: 0;
  border-radius: 0 0 999px 999px;
  content: "";
  background: #45c9ee;
}

.jellykid-home-tag__copy {
  display: grid;
  gap: 1px;
  align-content: center;
  font-family: "Trebuchet MS", "Arial Rounded MT Bold", system-ui, sans-serif;
  line-height: 0.86;
  text-align: left;
  text-shadow: none;
}

.jellykid-home-tag__copy strong {
  color: #ffffff;
  font-size: 16px;
  font-weight: 1000;
  letter-spacing: 0;
}

.jellykid-home-tag__copy small {
  color: #61ddff;
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.jellykid-home-tag:focus-visible {
  outline: 3px solid #ffc84d;
  outline-offset: 3px;
}

@media (max-width: 520px) {
  .jellykid-home-tag {
    transform: scale(0.86);
    transform-origin: top left;
  }
}

