:root {
  color-scheme: dark;
  --bg: #050914;
  --surface: rgba(11, 18, 35, 0.72);
  --surface-strong: #0b1326;
  --surface-soft: rgba(16, 27, 51, 0.58);
  --border: rgba(113, 221, 255, 0.18);
  --border-strong: rgba(113, 221, 255, 0.42);
  --text: #eef8ff;
  --muted: #8fa6b8;
  --cyan: #54e9ff;
  --cyan-soft: rgba(84, 233, 255, 0.2);
  --violet: #9d7bff;
  --magenta: #ff5cc8;
  --amber: #ffc75a;
  --green: #43f0b1;
  --red: #ff668d;
  --board-a: #14243b;
  --board-b: #101d31;
  --board-line: rgba(160, 221, 255, 0.29);
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
  --radius: 18px;
  --ease: cubic-bezier(.2,.8,.2,1);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -20%, rgba(67, 98, 169, .26), transparent 42%),
    linear-gradient(145deg, #030610 0%, #071022 48%, #040711 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
}
button, input { font: inherit; }
button { color: inherit; }

.background-grid {
  position: fixed; inset: 0; pointer-events: none; opacity: .18;
  background-image:
    linear-gradient(rgba(84, 233, 255, .09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(84, 233, 255, .09) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at center, black 10%, transparent 72%);
}
.background-glow { position: fixed; width: 34rem; height: 34rem; border-radius: 50%; filter: blur(90px); opacity: .16; pointer-events: none; }
.glow-a { top: -18rem; left: -12rem; background: var(--cyan); }
.glow-b { right: -18rem; bottom: -14rem; background: var(--magenta); }

.app-shell { width: min(1780px, 100%); margin: 0 auto; padding: 18px; position: relative; z-index: 1; }
.glass-panel {
  background: linear-gradient(145deg, rgba(17, 29, 54, .76), rgba(8, 14, 28, .66));
  border: 1px solid var(--border);
  box-shadow: var(--shadow), inset 0 1px rgba(255,255,255,.035);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
}
.topbar { min-height: 76px; border-radius: var(--radius); display: flex; align-items: center; justify-content: space-between; padding: 13px 18px; gap: 18px; }
.brand-block { display: flex; align-items: center; gap: 13px; }
.brand-mark { position: relative; width: 42px; height: 42px; border: 1px solid var(--border-strong); transform: rotate(45deg); box-shadow: 0 0 24px var(--cyan-soft); }
.brand-mark span { position: absolute; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.brand-mark span:nth-child(1) { width: 60%; height: 2px; top: 30%; left: 20%; }
.brand-mark span:nth-child(2) { width: 2px; height: 60%; top: 20%; left: 50%; }
.brand-mark span:nth-child(3) { width: 30%; height: 30%; border-radius: 50%; top: 35%; left: 35%; background: transparent; border: 2px solid var(--magenta); }
.eyebrow { margin: 0 0 3px; color: var(--cyan); font-size: 10px; line-height: 1.2; letter-spacing: .18em; font-weight: 800; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(20px, 2.2vw, 31px); letter-spacing: .08em; font-weight: 400; }
h1 strong { color: var(--cyan); text-shadow: 0 0 20px rgba(84, 233, 255, .45); }
h2 { margin: 0; font-size: 16px; letter-spacing: .035em; }
.top-status { display: flex; align-items: center; gap: 10px; }
.status-chip, .turn-badge, .beta-badge { border: 1px solid var(--border); background: rgba(5, 10, 22, .7); border-radius: 999px; padding: 8px 11px; font-size: 11px; letter-spacing: .09em; font-weight: 800; }
.pulse-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px var(--green); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .38; transform: scale(.8); } }

.workspace { display: grid; grid-template-columns: minmax(230px, 280px) minmax(510px, 1fr) minmax(280px, 360px); gap: 16px; margin-top: 16px; align-items: start; }
.left-rail, .right-rail { display: grid; gap: 12px; }
.panel { border-radius: var(--radius); padding: 15px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-heading.compact { margin-bottom: 10px; }
.turn-badge.sente { color: var(--cyan); }
.turn-badge.gote { color: var(--magenta); border-color: rgba(255,92,200,.28); }
.status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.status-grid > div { background: rgba(4, 9, 20, .62); border: 1px solid rgba(255,255,255,.055); padding: 10px; border-radius: 11px; }
.status-grid span { display: block; color: var(--muted); font-size: 10px; margin-bottom: 4px; }
.status-grid strong { font-size: 14px; }
.check-alert { margin-top: 10px; border: 1px solid rgba(255, 102, 141, .48); color: #ffd7e2; background: rgba(255,102,141,.13); border-radius: 10px; padding: 9px; text-align: center; font-weight: 900; letter-spacing: .18em; animation: warningPulse 1.2s infinite alternate; }
@keyframes warningPulse { to { box-shadow: 0 0 28px rgba(255,102,141,.18); } }
.hidden { display: none !important; }

.hand-list { display: flex; flex-wrap: wrap; gap: 7px; min-height: 40px; }
.hand-piece { min-width: 38px; height: 38px; padding: 0 7px; border-radius: 9px; border: 1px solid var(--border); background: rgba(4, 10, 22, .72); display: inline-flex; align-items: center; justify-content: center; gap: 3px; cursor: pointer; transition: .18s var(--ease); }
.hand-piece:hover:not(:disabled), .hand-piece.selected { border-color: var(--cyan); box-shadow: 0 0 18px var(--cyan-soft); transform: translateY(-1px); }
.hand-piece:disabled { opacity: .35; cursor: default; }
.hand-piece b { font-size: 17px; }
.hand-piece small { color: var(--cyan); font-size: 10px; }
.empty-hand { color: var(--muted); font-size: 12px; padding-top: 8px; }

.button { border: 1px solid var(--border); background: rgba(10, 20, 39, .78); border-radius: 10px; padding: 10px 12px; cursor: pointer; transition: .18s var(--ease); font-weight: 750; font-size: 12px; }
.button:hover:not(:disabled) { transform: translateY(-1px); border-color: var(--border-strong); box-shadow: 0 0 22px var(--cyan-soft); }
.button:disabled { opacity: .38; cursor: not-allowed; }
.button-primary { color: #021018; background: linear-gradient(135deg, #86f5ff, #54e9ff); border-color: transparent; }
.button-danger { color: #ffccd9; border-color: rgba(255,102,141,.24); }
.button-approval { border-color: rgba(255,199,90,.44); color: #ffe7aa; background: rgba(255,199,90,.08); }
.button-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.button-grid .button:last-child { grid-column: 1 / -1; }
.toggle-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 13px; margin-top: 12px; border-top: 1px solid rgba(255,255,255,.055); }
.toggle-row strong, .toggle-row small { display: block; }
.toggle-row strong { font-size: 12px; }
.toggle-row small { color: var(--muted); font-size: 10px; margin-top: 2px; }
.toggle-row input { appearance: none; width: 39px; height: 22px; border-radius: 999px; background: #26344c; position: relative; cursor: pointer; transition: .2s; }
.toggle-row input::after { content: ''; position: absolute; width: 16px; height: 16px; top: 3px; left: 3px; border-radius: 50%; background: #b9c6d2; transition: .2s var(--ease); }
.toggle-row input:checked { background: rgba(84,233,255,.35); box-shadow: inset 0 0 0 1px var(--cyan); }
.toggle-row input:checked::after { transform: translateX(17px); background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }

.board-stage { min-width: 0; display: flex; flex-direction: column; align-items: stretch; }
.board-meta { display: flex; justify-content: space-between; align-items: end; padding: 3px 8px 10px; }
.board-meta > div { display: flex; flex-direction: column; gap: 2px; }
.board-meta strong { font-size: 13px; letter-spacing: .08em; }
.meta-label, .live-evaluation span { color: var(--muted); font-size: 9px; letter-spacing: .14em; }
.live-evaluation { text-align: right; }
.live-evaluation strong { color: var(--green); }
.board-frame { width: min(100%, calc(100vh - 180px)); aspect-ratio: 1; margin: 0 auto; position: relative; padding: clamp(10px, 1.4vw, 18px); background: linear-gradient(135deg, rgba(40,79,112,.34), rgba(4,8,19,.92)); border: 1px solid var(--border-strong); box-shadow: 0 30px 90px rgba(0,0,0,.55), 0 0 50px rgba(84,233,255,.08), inset 0 0 70px rgba(84,233,255,.035); border-radius: 12px; }
.corner { position: absolute; width: 24px; height: 24px; border-color: var(--cyan); opacity: .72; pointer-events: none; }
.corner-tl { left: -1px; top: -1px; border-left: 2px solid; border-top: 2px solid; }
.corner-tr { right: -1px; top: -1px; border-right: 2px solid; border-top: 2px solid; }
.corner-bl { left: -1px; bottom: -1px; border-left: 2px solid; border-bottom: 2px solid; }
.corner-br { right: -1px; bottom: -1px; border-right: 2px solid; border-bottom: 2px solid; }
.shogi-board { width: 100%; height: 100%; display: grid; grid-template-columns: repeat(9, 1fr); grid-template-rows: repeat(9, 1fr); border-top: 1px solid var(--board-line); border-left: 1px solid var(--board-line); background: var(--surface-strong); box-shadow: inset 0 0 45px rgba(0,0,0,.35); }
.board-cell { appearance: none; min-width: 0; min-height: 0; position: relative; display: grid; place-items: center; border: 0; border-right: 1px solid var(--board-line); border-bottom: 1px solid var(--board-line); background: var(--board-a); padding: 0; cursor: pointer; overflow: hidden; }
.board-cell:nth-child(even) { background: var(--board-b); }
.board-cell::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle, rgba(84,233,255,.13), transparent 60%); opacity: 0; transition: .18s; }
.board-cell:hover::before { opacity: .55; }
.board-cell.selected { box-shadow: inset 0 0 0 2px var(--cyan), inset 0 0 24px rgba(84,233,255,.16); z-index: 2; }
.board-cell.legal::after { content: ''; width: 20%; aspect-ratio: 1; position: absolute; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 14px var(--cyan); opacity: .75; }
.board-cell.capture-target::after { width: 68%; border: 2px solid var(--red); background: transparent; box-shadow: 0 0 15px rgba(255,102,141,.6), inset 0 0 12px rgba(255,102,141,.2); }
.board-cell.last-move { background-image: linear-gradient(rgba(255,199,90,.12), rgba(255,199,90,.12)); }
.board-cell.king-in-check { box-shadow: inset 0 0 0 2px var(--red), inset 0 0 25px rgba(255,102,141,.36); animation: kingAlert .8s infinite alternate; }
@keyframes kingAlert { to { filter: brightness(1.18); } }
.piece { width: 76%; height: 82%; display: grid; place-items: center; position: relative; clip-path: polygon(50% 0%, 88% 15%, 82% 100%, 18% 100%, 12% 15%); background: linear-gradient(160deg, #e8f7fb, #8da8b8 70%, #6f8797); color: #07101b; font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; font-size: clamp(16px, 3.1vw, 34px); font-weight: 900; text-shadow: 0 1px rgba(255,255,255,.6); filter: drop-shadow(0 5px 6px rgba(0,0,0,.45)); transition: transform .24s var(--ease), filter .24s; z-index: 1; user-select: none; }
.piece::after { content: ''; position: absolute; inset: 3px; clip-path: inherit; border: 1px solid rgba(255,255,255,.45); }
.piece.gote { transform: rotate(180deg); background: linear-gradient(160deg, #fac7ea, #b989c6 70%, #775987); }
.piece.promoted { color: #7b071d; background: linear-gradient(160deg, #ffe8be, #dfa55a 70%, #9d6830); }
.board-cell:hover .piece { filter: drop-shadow(0 5px 6px rgba(0,0,0,.45)) drop-shadow(0 0 8px rgba(84,233,255,.35)); }
.board-caption { display: flex; justify-content: space-between; gap: 16px; padding: 10px 7px 0; color: var(--muted); font-size: 11px; }
.legend { white-space: nowrap; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin: 0 4px 0 9px; }
.legend-dot.legal { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.legend-dot.last { background: var(--amber); }

.beta-badge { color: #d7ccff; border-color: rgba(157,123,255,.35); padding: 6px 9px; }
.analysis-notice { display: flex; gap: 9px; color: var(--muted); font-size: 11px; line-height: 1.5; padding: 10px; border-radius: 10px; background: rgba(84,233,255,.055); border: 1px solid rgba(84,233,255,.1); margin-bottom: 10px; }
.analysis-notice p { margin: 0; }
.notice-icon { flex: 0 0 auto; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--cyan); display: grid; place-items: center; color: var(--cyan); font-size: 10px; font-weight: 900; }
.candidate-list { display: grid; gap: 8px; }
.candidate-card { border: 1px solid rgba(255,255,255,.07); background: rgba(4,9,19,.58); border-radius: 12px; padding: 11px; cursor: pointer; transition: .18s var(--ease); }
.candidate-card:hover { transform: translateY(-1px); border-color: var(--border-strong); box-shadow: 0 10px 30px rgba(0,0,0,.24); }
.candidate-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.candidate-role { color: var(--cyan); font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.candidate-notation { font-size: 19px; font-weight: 900; }
.probability { text-align: right; }
.probability strong { color: var(--green); font-size: 18px; }
.probability small { display: block; color: var(--muted); font-size: 8px; }
.candidate-explanation { color: #bfd0de; font-size: 11px; margin: 8px 0; line-height: 1.5; }
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { border-radius: 999px; padding: 4px 6px; color: #c4d9e8; border: 1px solid rgba(255,255,255,.07); background: rgba(255,255,255,.035); font-size: 9px; }
.uncertainty { margin-left: auto; color: var(--amber); }

.text-button, .icon-button { background: transparent; border: 0; color: var(--cyan); cursor: pointer; padding: 5px; }
.icon-button { font-size: 23px; line-height: 1; }
.move-history { max-height: 265px; overflow: auto; margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 5px; scrollbar-width: thin; }
.move-history li { background: rgba(4,9,19,.54); border: 1px solid rgba(255,255,255,.045); border-radius: 8px; padding: 7px 8px; font-size: 11px; }
.move-history li:last-child { color: var(--cyan); border-color: rgba(84,233,255,.2); }
.empty-state { color: var(--muted); font-size: 11px; text-align: center; padding: 20px 4px; }

.cyber-dialog { border: 0; padding: 0; background: transparent; color: var(--text); width: min(92vw, 560px); max-height: 90vh; }
.cyber-dialog::backdrop { background: rgba(1,3,8,.78); backdrop-filter: blur(8px); }
.dialog-card { border-radius: 20px; padding: 23px; text-align: center; }
.dialog-card > p:not(.eyebrow) { color: var(--muted); }
.dialog-actions { display: flex; gap: 10px; justify-content: center; margin-top: 20px; }
.approval-dialog { width: min(94vw, 840px); }
.approval-card { text-align: left; padding: 22px; max-height: 86vh; overflow: auto; }
.approval-header { display: flex; justify-content: space-between; align-items: start; }
.approval-lead { line-height: 1.7; font-size: 13px; }
.approval-gate-list { display: grid; gap: 10px; margin-top: 16px; }
.approval-gate { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; border: 1px solid rgba(255,255,255,.075); background: rgba(4,9,20,.55); border-radius: 14px; padding: 14px; }
.approval-gate.approved { border-color: rgba(67,240,177,.35); background: rgba(67,240,177,.055); }
.approval-gate h3 { margin: 0 0 5px; font-size: 14px; }
.approval-gate p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.approval-status { display: inline-flex; margin-top: 8px; padding: 4px 7px; border-radius: 999px; font-size: 9px; font-weight: 900; letter-spacing: .09em; color: var(--amber); background: rgba(255,199,90,.08); border: 1px solid rgba(255,199,90,.2); }
.approved .approval-status { color: var(--green); border-color: rgba(67,240,177,.26); background: rgba(67,240,177,.08); }
.approval-actions { min-width: 112px; }
.approval-actions .button { width: 100%; }
.approval-footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; border-top: 1px solid rgba(255,255,255,.07); margin-top: 17px; padding-top: 14px; color: var(--muted); font-size: 10px; }
.danger-text { color: var(--red); }
.result-card h2 { font-size: 28px; margin-top: 7px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 18px); opacity: 0; pointer-events: none; z-index: 100; border: 1px solid var(--border-strong); background: rgba(6,13,26,.94); border-radius: 999px; padding: 10px 16px; color: var(--text); box-shadow: var(--shadow); transition: .25s var(--ease); font-size: 12px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1180px) {
  .workspace { grid-template-columns: minmax(220px, 260px) minmax(470px, 1fr); }
  .right-rail { grid-column: 1 / -1; grid-template-columns: 1.2fr .8fr; }
  .board-frame { width: min(100%, 720px); }
}
@media (max-width: 820px) {
  .app-shell { padding: 8px; }
  .topbar { padding: 11px; min-height: 66px; }
  .status-chip { display: none; }
  .workspace { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
  .board-stage { order: 1; width: 100%; }
  .left-rail { order: 2; width: 100%; grid-template-columns: 1fr 1fr; }
  .status-panel, .controls-panel { grid-column: 1 / -1; }
  .right-rail { order: 3; width: 100%; display: flex; flex-direction: column; }
  .analysis-panel { order: 1; }
  .history-panel { order: 2; }
  .board-frame { width: 100%; max-width: 680px; }
  .piece { font-size: clamp(17px, 6vw, 34px); }
  .board-caption { font-size: 10px; }
}
@media (max-width: 520px) {
  .brand-mark { width: 32px; height: 32px; }
  .brand-block { gap: 9px; }
  .brand-block .eyebrow { display: none; }
  h1 { font-size: 17px; }
  .button-approval { padding: 8px; }
  .left-rail { grid-template-columns: 1fr; }
  .status-panel, .controls-panel { grid-column: auto; }
  .board-meta { padding-inline: 3px; }
  .board-frame { padding: 7px; }
  .board-caption .legend { display: none; }
  .approval-gate { grid-template-columns: 1fr; }
  .approval-actions { min-width: 0; }
  .approval-footer { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .001ms !important; }
}
@supports not (backdrop-filter: blur(1px)) {
  .glass-panel { background: #0a1326; }
}



/* === Neon / Glassmorphism enhancement override === */
:root {
  --surface: rgba(12, 20, 38, 0.54);
  --surface-soft: rgba(17, 28, 52, 0.44);
  --border: rgba(125, 239, 255, 0.28);
  --border-strong: rgba(125, 239, 255, 0.62);
  --cyan-soft: rgba(84, 233, 255, 0.34);
  --shadow: 0 30px 100px rgba(0, 0, 0, 0.54);
}
body {
  background:
    radial-gradient(circle at 18% 18%, rgba(84,233,255,.17), transparent 28%),
    radial-gradient(circle at 84% 16%, rgba(157,123,255,.16), transparent 24%),
    radial-gradient(circle at 76% 86%, rgba(255,92,200,.14), transparent 26%),
    radial-gradient(circle at 50% -10%, rgba(67, 98, 169, .34), transparent 42%),
    linear-gradient(145deg, #02040c 0%, #071022 44%, #030611 100%);
}
.background-grid {
  opacity: .3;
  background-image:
    linear-gradient(rgba(84, 233, 255, .11) 1px, transparent 1px),
    linear-gradient(90deg, rgba(84, 233, 255, .11) 1px, transparent 1px),
    linear-gradient(rgba(157, 123, 255, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(157, 123, 255, .05) 1px, transparent 1px);
  background-size: 48px 48px, 48px 48px, 144px 144px, 144px 144px;
}
.background-grid::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(84,233,255,.03) 0px,
    rgba(84,233,255,.03) 1px,
    transparent 3px,
    transparent 8px
  );
  opacity: .28;
}
.background-glow {
  width: 42rem;
  height: 42rem;
  filter: blur(110px);
  opacity: .24;
  animation: neonFloat 14s ease-in-out infinite alternate;
}
.glow-a { box-shadow: 0 0 120px rgba(84,233,255,.3); }
.glow-b { box-shadow: 0 0 120px rgba(255,92,200,.24); }
@keyframes neonFloat {
  from { transform: translate3d(0,0,0) scale(1); }
  to { transform: translate3d(1.2rem,-1rem,0) scale(1.08); }
}
.glass-panel, .candidate-card, .approval-gate, .status-grid > div, .move-history li, .hand-piece, .button, .toast {
  position: relative;
  overflow: hidden;
}
.glass-panel {
  background: linear-gradient(145deg, rgba(21, 36, 67, .52), rgba(6, 12, 26, .42));
  border: 1px solid rgba(125,239,255,.24);
  box-shadow:
    var(--shadow),
    0 0 0 1px rgba(255,255,255,.03) inset,
    0 0 34px rgba(84,233,255,.08),
    0 0 58px rgba(157,123,255,.05);
  backdrop-filter: blur(26px) saturate(160%);
  -webkit-backdrop-filter: blur(26px) saturate(160%);
}
.glass-panel::before, .candidate-card::before, .approval-gate::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(125deg, rgba(255,255,255,.15), rgba(255,255,255,0) 24%),
    radial-gradient(circle at top right, rgba(84,233,255,.12), transparent 34%);
  mix-blend-mode: screen;
}
.glass-panel::after {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  pointer-events: none;
  border: 1px solid rgba(255,255,255,.05);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  padding: 1px;
}
.topbar { box-shadow: 0 0 55px rgba(84,233,255,.09), 0 0 85px rgba(157,123,255,.05), var(--shadow); }
.brand-mark { box-shadow: 0 0 28px rgba(84,233,255,.34), inset 0 0 20px rgba(84,233,255,.12); }
h1 strong {
  color: #8ef6ff;
  text-shadow: 0 0 12px rgba(84,233,255,.6), 0 0 24px rgba(84,233,255,.42), 0 0 48px rgba(84,233,255,.18);
}
.status-chip, .turn-badge, .beta-badge {
  background: linear-gradient(180deg, rgba(11,18,35,.86), rgba(6,11,24,.7));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.03), 0 0 18px rgba(84,233,255,.08);
}
.status-grid > div {
  background: linear-gradient(180deg, rgba(7,13,28,.72), rgba(7,13,28,.48));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03), 0 0 18px rgba(84,233,255,.05);
}
.hand-piece {
  background: linear-gradient(180deg, rgba(8, 16, 32, .8), rgba(4, 10, 22, .62));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 0 16px rgba(84,233,255,.05);
}
.button {
  background: linear-gradient(180deg, rgba(13, 25, 47, .78), rgba(6, 12, 27, .84));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 0 16px rgba(84,233,255,.05);
}
.button:hover:not(:disabled) {
  box-shadow: 0 0 24px rgba(84,233,255,.18), 0 0 52px rgba(84,233,255,.12), inset 0 1px 0 rgba(255,255,255,.08);
}
.button-primary {
  color: #041118;
  background: linear-gradient(135deg, #c0fbff 0%, #6ef1ff 48%, #57d8ff 100%);
  box-shadow: 0 0 22px rgba(84,233,255,.28), 0 0 52px rgba(84,233,255,.18);
}
.button-approval {
  background: linear-gradient(180deg, rgba(255,199,90,.14), rgba(255,199,90,.05));
  box-shadow: 0 0 18px rgba(255,199,90,.08);
}
.board-frame {
  background:
    radial-gradient(circle at top, rgba(84,233,255,.1), transparent 35%),
    linear-gradient(135deg, rgba(36,77,118,.44), rgba(4,8,19,.94));
  border: 1px solid rgba(125,239,255,.45);
  box-shadow:
    0 30px 90px rgba(0,0,0,.58),
    0 0 0 1px rgba(255,255,255,.03) inset,
    0 0 80px rgba(84,233,255,.12),
    0 0 120px rgba(157,123,255,.07),
    inset 0 0 80px rgba(84,233,255,.05);
}
.board-frame::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(84,233,255,.06), rgba(255,255,255,0) 26%);
}
.corner { opacity: .95; filter: drop-shadow(0 0 8px rgba(84,233,255,.5)); }
.shogi-board {
  box-shadow: inset 0 0 55px rgba(0,0,0,.45), inset 0 0 18px rgba(84,233,255,.04);
}
.board-cell {
  background: linear-gradient(180deg, rgba(21,37,60,.98), rgba(14,27,45,.98));
}
.board-cell:nth-child(even) {
  background: linear-gradient(180deg, rgba(17,31,52,.98), rgba(12,24,41,.98));
}
.board-cell:hover::before { opacity: .72; }
.board-cell.selected {
  box-shadow: inset 0 0 0 2px var(--cyan), inset 0 0 28px rgba(84,233,255,.24), 0 0 20px rgba(84,233,255,.16);
}
.board-cell.legal::after {
  box-shadow: 0 0 10px var(--cyan), 0 0 24px var(--cyan), 0 0 38px rgba(84,233,255,.3);
}
.board-cell.capture-target::after {
  box-shadow: 0 0 18px rgba(255,102,141,.72), inset 0 0 18px rgba(255,102,141,.25);
}
.piece {
  background: linear-gradient(160deg, #fbfeff, #b7d7e6 62%, #7b96a8);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
  filter: drop-shadow(0 7px 10px rgba(0,0,0,.48));
}
.piece::before {
  content: '';
  position: absolute;
  inset: 0;
  clip-path: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,.26), rgba(255,255,255,0) 40%);
}
.piece.gote {
  background: linear-gradient(160deg, #ffd9f0, #d4a4e3 62%, #8f69a3);
}
.piece.promoted {
  background: linear-gradient(160deg, #fff2d2, #f0bc70 62%, #b17431);
  box-shadow: 0 0 14px rgba(255,199,90,.16), inset 0 1px 0 rgba(255,255,255,.45);
}
.board-cell:hover .piece {
  filter: drop-shadow(0 8px 12px rgba(0,0,0,.5)) drop-shadow(0 0 12px rgba(84,233,255,.45));
}
.analysis-notice {
  background: linear-gradient(180deg, rgba(84,233,255,.08), rgba(84,233,255,.035));
  border-color: rgba(84,233,255,.16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 0 16px rgba(84,233,255,.05);
}
.candidate-card {
  background: linear-gradient(180deg, rgba(8, 16, 31, .68), rgba(4, 9, 19, .54));
  border-color: rgba(125,239,255,.13);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03), 0 0 18px rgba(84,233,255,.04);
}
.candidate-card:hover {
  box-shadow: 0 12px 34px rgba(0,0,0,.28), 0 0 32px rgba(84,233,255,.1);
}
.candidate-role, .notice-icon, .text-button, .icon-button { text-shadow: 0 0 10px rgba(84,233,255,.28); }
.probability strong {
  text-shadow: 0 0 12px rgba(67,240,177,.28), 0 0 22px rgba(67,240,177,.14);
}
.tag {
  background: rgba(255,255,255,.045);
  border-color: rgba(125,239,255,.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.02);
}
.move-history li {
  background: linear-gradient(180deg, rgba(8, 16, 31, .72), rgba(4, 9, 19, .54));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.02);
}
.toast {
  box-shadow: var(--shadow), 0 0 24px rgba(84,233,255,.14);
}
@media (prefers-reduced-motion: reduce) {
  .background-glow, .pulse-dot { animation: none; }
}


/* === Cyber full-send easy-mode helpers === */
.topbar::before,
.panel::before {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(84,233,255,.75), rgba(255,92,200,.4), transparent);
  opacity: .8;
  pointer-events: none;
}
.panel {
  position: relative;
}
.board-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(84,233,255,.025) 0px, rgba(84,233,255,.025) 1px, transparent 4px, transparent 10px);
  mix-blend-mode: screen;
  opacity: .45;
}
.button-approval {
  font-weight: 900;
  letter-spacing: .06em;
}
.helper-grid {
  display: grid;
  gap: 10px;
}
.helper-card {
  border: 1px solid rgba(125,239,255,.14);
  border-radius: 14px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(9,16,32,.74), rgba(4,9,19,.5));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03), 0 0 18px rgba(84,233,255,.04);
}
.helper-card strong {
  display: block;
  margin-bottom: 7px;
  color: var(--cyan);
  font-size: 12px;
  letter-spacing: .04em;
  text-shadow: 0 0 12px rgba(84,233,255,.22);
}
.helper-card ul {
  margin: 0;
  padding-left: 18px;
  color: #d8e9f5;
  font-size: 12px;
  line-height: 1.65;
}
.helper-card li::marker {
  color: var(--magenta);
}
.candidate-role {
  font-size: 11px;
}
.candidate-notation {
  letter-spacing: .02em;
}
.analysis-panel h2, .history-panel h2, .status-panel h2, .help-panel h2 {
  letter-spacing: .05em;
}
@media (max-width: 820px) {
  .helper-grid {
    grid-template-columns: 1fr;
  }
}


/* === Persona opponent AI === */
.persona-panel {
  border-color: rgba(157,123,255,.34);
  box-shadow: var(--shadow), 0 0 42px rgba(157,123,255,.09), inset 0 1px rgba(255,255,255,.04);
}
.persona-core {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 12px;
  align-items: center;
}
.persona-avatar {
  width: 62px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 18px 5px 18px 5px;
  border: 1px solid rgba(84,233,255,.55);
  background:
    linear-gradient(135deg, rgba(84,233,255,.22), rgba(157,123,255,.12)),
    rgba(4,9,20,.8);
  box-shadow: 0 0 24px rgba(84,233,255,.18), inset 0 0 24px rgba(84,233,255,.08);
  transform: rotate(2deg);
  position: relative;
  overflow: hidden;
}
.persona-avatar::before,
.persona-avatar::after {
  content: '';
  position: absolute;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
  opacity: .68;
}
.persona-avatar::before { width: 70%; height: 1px; top: 28%; left: 15%; }
.persona-avatar::after { width: 1px; height: 70%; top: 15%; left: 68%; }
.persona-avatar span {
  font-size: 21px;
  font-weight: 950;
  letter-spacing: .08em;
  color: #dffcff;
  text-shadow: 0 0 14px rgba(84,233,255,.68);
  z-index: 1;
}
.persona-copy strong,
.persona-copy span { display: block; }
.persona-copy strong { font-size: 14px; letter-spacing: .04em; }
.persona-copy span { color: var(--cyan); font-size: 10px; margin-top: 3px; }
.persona-copy p { color: #c6d8e6; font-size: 11px; line-height: 1.5; margin: 7px 0 0; }
.persona-picker {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid rgba(255,255,255,.07);
  color: var(--muted);
  font-size: 10px;
}
.persona-picker select {
  width: 100%;
  color: var(--text);
  border: 1px solid rgba(125,239,255,.22);
  border-radius: 9px;
  padding: 8px 9px;
  background: rgba(5,11,24,.9);
  outline: none;
}
.persona-picker select:focus { border-color: var(--cyan); box-shadow: 0 0 18px rgba(84,233,255,.14); }
.ai-speech {
  margin-top: 10px;
  padding: 10px 11px;
  border-left: 2px solid var(--magenta);
  border-radius: 0 10px 10px 0;
  background: linear-gradient(90deg, rgba(255,92,200,.085), rgba(84,233,255,.025));
  color: #f2e7ff;
  font-size: 11px;
  line-height: 1.55;
  min-height: 51px;
}
.ai-system-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: .06em;
}
.ai-system-strip span { display: inline-flex; align-items: center; gap: 6px; }
.ai-system-strip strong { color: var(--green); }
.ai-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 11px var(--green);
}
.ai-thinking-badge {
  color: var(--green);
  border: 1px solid rgba(67,240,177,.28);
  background: rgba(67,240,177,.07);
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .06em;
}
.ai-thinking-badge.thinking {
  color: var(--amber);
  border-color: rgba(255,199,90,.34);
  background: rgba(255,199,90,.08);
  animation: aiThinkingPulse .7s ease-in-out infinite alternate;
}
@keyframes aiThinkingPulse {
  to { box-shadow: 0 0 18px rgba(255,199,90,.2); opacity: .72; }
}
.persona-panel[data-persona="GUREN_13"] {
  border-color: rgba(255,92,200,.36);
}
.persona-panel[data-persona="GUREN_13"] .persona-avatar {
  border-color: rgba(255,92,200,.65);
  background: linear-gradient(135deg, rgba(255,92,200,.24), rgba(255,102,141,.1)), rgba(15,5,17,.82);
  box-shadow: 0 0 28px rgba(255,92,200,.2), inset 0 0 24px rgba(255,92,200,.09);
}
.persona-panel[data-persona="AEGIS_04"] .persona-avatar {
  border-color: rgba(67,240,177,.58);
  background: linear-gradient(135deg, rgba(67,240,177,.2), rgba(84,233,255,.08)), rgba(4,15,20,.82);
  box-shadow: 0 0 28px rgba(67,240,177,.18), inset 0 0 24px rgba(67,240,177,.08);
}
.board-cell.ai-locked { cursor: wait; }
@media (max-width: 820px) {
  .persona-panel { order: 1; }
  .analysis-panel { order: 2; }
  .history-panel { order: 3; }
}
@media (prefers-reduced-motion: reduce) {
  .ai-thinking-badge.thinking { animation: none; }
}


/* === Game feel / SF vehicle layer === */
.sky-lane {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.sf-vehicle {
  position: absolute;
  width: 120px;
  height: 38px;
  filter: drop-shadow(0 0 12px rgba(84,233,255,.22)) drop-shadow(0 0 28px rgba(84,233,255,.12));
  opacity: .82;
}
.sf-vehicle .trail {
  position: absolute;
  right: 72px;
  top: 16px;
  width: 140px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(84,233,255,0), rgba(84,233,255,.42), rgba(255,92,200,.18));
}
.sf-vehicle .body {
  position: absolute;
  right: 0;
  top: 10px;
  width: 82px;
  height: 18px;
  clip-path: polygon(0 50%, 20% 0, 86% 0, 100% 50%, 86% 100%, 20% 100%);
  background: linear-gradient(90deg, rgba(164,250,255,.95), rgba(74,179,255,.82));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 0 16px rgba(84,233,255,.2);
}
.sf-vehicle .cockpit {
  position: absolute;
  right: 20px;
  top: 13px;
  width: 18px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,255,255,.92), rgba(255,92,200,.72));
  box-shadow: 0 0 12px rgba(255,92,200,.24);
}
.vehicle-a { top: 14%; left: -180px; animation: flyAcross 18s linear infinite; }
.vehicle-b { top: 66%; left: -220px; transform: scale(.78); animation: flyAcross 24s linear infinite 4s; opacity: .64; }
.vehicle-c { top: 32%; right: -200px; transform: scale(.9) scaleX(-1); animation: flyBack 22s linear infinite 2s; opacity: .58; }
@keyframes flyAcross {
  0% { transform: translateX(0) translateY(0); }
  100% { transform: translateX(calc(100vw + 340px)) translateY(-20px); }
}
@keyframes flyBack {
  0% { transform: translateX(0) scale(.9) scaleX(-1) translateY(0); }
  100% { transform: translateX(calc(-100vw - 340px)) scale(.9) scaleX(-1) translateY(18px); }
}
.board-stage {
  position: relative;
}
.board-stage::before {
  content: 'MISSION // CYBER BATTLE';
  position: absolute;
  left: 10px;
  top: -22px;
  font-size: 10px;
  letter-spacing: .22em;
  color: rgba(84,233,255,.82);
  text-shadow: 0 0 12px rgba(84,233,255,.24);
}
.board-frame {
  overflow: hidden;
}
.board-frame .corner { z-index: 4; }
.fleet-panel {
  margin-top: 12px;
  border: 1px solid rgba(125,239,255,.14);
  border-radius: 16px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(8,16,31,.72), rgba(4,9,19,.5));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03), 0 0 18px rgba(84,233,255,.04);
}
.fleet-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.fleet-heading span {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .12em;
}
.fleet-heading strong {
  color: var(--cyan);
  font-size: 11px;
  letter-spacing: .08em;
  text-shadow: 0 0 10px rgba(84,233,255,.2);
}
.fleet-list {
  display: grid;
  gap: 8px;
}
.fleet-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(125,239,255,.1);
}
.fleet-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(125,239,255,.22);
  display: grid;
  place-items: center;
  color: var(--cyan);
  background: radial-gradient(circle at 30% 30%, rgba(84,233,255,.18), rgba(84,233,255,.04));
  text-shadow: 0 0 10px rgba(84,233,255,.26);
  font-size: 18px;
}
.fleet-copy strong,
.fleet-copy span { display: block; }
.fleet-copy strong { font-size: 12px; }
.fleet-copy span { color: #b8cbda; font-size: 10px; margin-top: 2px; }
.fleet-pips {
  display: flex;
  gap: 4px;
}
.fleet-pips i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(84,233,255,.18);
  box-shadow: inset 0 0 0 1px rgba(84,233,255,.16);
}
.fleet-pips i.on {
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(84,233,255,.34);
}
.persona-panel[data-persona="GUREN_13"] .fleet-icon,
.persona-panel[data-persona="GUREN_13"] .fleet-heading strong { color: var(--magenta); }
.persona-panel[data-persona="GUREN_13"] .fleet-icon { border-color: rgba(255,92,200,.28); background: radial-gradient(circle at 30% 30%, rgba(255,92,200,.18), rgba(255,92,200,.04)); text-shadow: 0 0 10px rgba(255,92,200,.26); }
.persona-panel[data-persona="AEGIS_04"] .fleet-icon,
.persona-panel[data-persona="AEGIS_04"] .fleet-heading strong { color: var(--green); }
.persona-panel[data-persona="AEGIS_04"] .fleet-icon { border-color: rgba(67,240,177,.28); background: radial-gradient(circle at 30% 30%, rgba(67,240,177,.18), rgba(67,240,177,.04)); text-shadow: 0 0 10px rgba(67,240,177,.26); }
@media (max-width: 820px) {
  .sky-lane { opacity: .65; }
  .sf-vehicle { transform: scale(.8); }
  .board-stage::before { top: -18px; left: 6px; font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .sf-vehicle { animation: none !important; }
}


/* === Game-feel HUD upgrade === */
.game-hud {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  padding: 12px 14px;
}
.pilot-card {
  border: 1px solid rgba(125,239,255,.16);
  border-radius: 16px;
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(8,16,31,.82), rgba(4,9,19,.55));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03), 0 0 24px rgba(84,233,255,.04);
}
.pilot-card.enemy {
  border-color: rgba(255,92,200,.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03), 0 0 24px rgba(255,92,200,.05);
}
.pilot-tag {
  display: block;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: .14em;
  margin-bottom: 6px;
}
.pilot-card strong {
  display: block;
  font-size: 14px;
  letter-spacing: .05em;
  margin-bottom: 8px;
}
.power-bar {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(84,233,255,.18);
  box-shadow: inset 0 0 12px rgba(0,0,0,.35);
}
.power-bar span {
  display: block;
  height: 100%;
  width: 50%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(84,233,255,.72), rgba(84,233,255,1));
  box-shadow: 0 0 14px rgba(84,233,255,.34), 0 0 26px rgba(84,233,255,.2);
  transition: width .26s var(--ease);
}
.power-bar.enemy {
  border-color: rgba(255,92,200,.22);
}
.power-bar.enemy span {
  background: linear-gradient(90deg, rgba(255,92,200,.65), rgba(255,92,200,1));
  box-shadow: 0 0 14px rgba(255,92,200,.34), 0 0 26px rgba(255,92,200,.2);
}
.pilot-card small {
  display: block;
  margin-top: 6px;
  color: #d9e8f3;
  font-size: 11px;
}
.hud-center {
  min-width: 126px;
  text-align: center;
  display: grid;
  gap: 6px;
}
.vs-mark {
  width: 56px;
  height: 56px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(84,233,255,.34);
  color: #e8fdff;
  font-weight: 1000;
  letter-spacing: .08em;
  background: radial-gradient(circle, rgba(84,233,255,.16), rgba(84,233,255,.03) 60%);
  box-shadow: 0 0 24px rgba(84,233,255,.16), inset 0 0 22px rgba(84,233,255,.08);
}
.phase-label {
  color: var(--cyan);
  font-size: 10px;
  letter-spacing: .12em;
  font-weight: 900;
}
.advantage-text {
  color: #dfeef7;
  font-size: 11px;
}
.mission-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 14px;
  margin-bottom: 10px;
}
.mission-bar strong {
  display: block;
  margin-top: 3px;
  font-size: 14px;
  letter-spacing: .03em;
}
.mission-bar small {
  color: #c6d8e6;
  font-size: 11px;
  text-align: right;
  line-height: 1.45;
}
.turn-banner {
  position: sticky;
  top: 12px;
  z-index: 7;
  align-self: center;
  width: fit-content;
  max-width: calc(100% - 24px);
  margin: 0 auto 10px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid rgba(84,233,255,.26);
  background: rgba(4,9,19,.84);
  color: #e9fdff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
  box-shadow: 0 0 28px rgba(84,233,255,.12);
  opacity: 0;
  transform: translateY(-8px) scale(.98);
  pointer-events: none;
  transition: .22s var(--ease);
}
.turn-banner.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.turn-banner.enemy {
  border-color: rgba(255,92,200,.3);
  box-shadow: 0 0 28px rgba(255,92,200,.16);
}
.turn-banner.player {
  border-color: rgba(84,233,255,.3);
}
.turn-banner.alert {
  border-color: rgba(255,102,141,.36);
  box-shadow: 0 0 30px rgba(255,102,141,.22);
  color: #ffe1ea;
}
.board-frame[data-fx="enemy"] {
  box-shadow:
    0 30px 90px rgba(0,0,0,.58),
    0 0 0 1px rgba(255,255,255,.03) inset,
    0 0 88px rgba(255,92,200,.15),
    0 0 120px rgba(255,92,200,.08),
    inset 0 0 80px rgba(255,92,200,.05);
}
.board-frame[data-fx="player"] {
  box-shadow:
    0 30px 90px rgba(0,0,0,.58),
    0 0 0 1px rgba(255,255,255,.03) inset,
    0 0 88px rgba(84,233,255,.16),
    0 0 120px rgba(84,233,255,.09),
    inset 0 0 80px rgba(84,233,255,.06);
}
.board-frame[data-fx="alert"] {
  box-shadow:
    0 30px 90px rgba(0,0,0,.58),
    0 0 0 1px rgba(255,255,255,.03) inset,
    0 0 92px rgba(255,102,141,.2),
    0 0 132px rgba(255,102,141,.1),
    inset 0 0 90px rgba(255,102,141,.08);
}
@media (max-width: 820px) {
  .game-hud {
    grid-template-columns: 1fr;
  }
  .hud-center {
    order: -1;
  }
  .mission-bar {
    flex-direction: column;
    align-items: flex-start;
  }
  .mission-bar small {
    text-align: left;
  }
}


/* === Three.js spatial layer / current optimal hybrid === */
:root {
  --sf-tilt-x: 0deg;
  --sf-tilt-y: 0deg;
}
.sf-scene-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: .92;
  filter: saturate(1.12) contrast(1.04);
  transition: opacity .45s var(--ease), filter .45s var(--ease);
}
.sf-scene-canvas.sf-disabled,
.sf-space-off .sf-scene-canvas { opacity: 0; }
.background-grid { z-index: 1; }
.background-glow { z-index: 0; }
.app-shell { z-index: 3; }
.sf-status-chip {
  color: #bffaff;
  border-color: rgba(84,233,255,.3);
}
.sf-cube-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 7px;
  border: 1px solid var(--cyan);
  transform: rotate(30deg) skew(-8deg);
  box-shadow: 0 0 8px var(--cyan), inset 0 0 5px rgba(84,233,255,.5);
  animation: sfCubeSpin 5s linear infinite;
}
@keyframes sfCubeSpin { to { transform: rotate(390deg) skew(-8deg); } }
.board-stage {
  perspective: 1700px;
  perspective-origin: 50% 42%;
}
.board-frame {
  transform: rotateX(var(--sf-tilt-x)) rotateY(var(--sf-tilt-y)) translateZ(0);
  transform-style: preserve-3d;
  transition: transform .18s ease-out, box-shadow .25s var(--ease);
}
.board-frame .shogi-board { transform: translateZ(4px); }
.board-frame .corner { transform: translateZ(11px); }
.glass-panel { transform-style: preserve-3d; }
.glass-panel > * { position: relative; z-index: 1; }
.persona-panel[data-persona="REI_09"] { box-shadow: var(--shadow), 0 0 46px rgba(84,233,255,.1), inset 0 1px rgba(255,255,255,.04); }
.persona-panel[data-persona="GUREN_13"] { box-shadow: var(--shadow), 0 0 52px rgba(255,92,122,.13), inset 0 1px rgba(255,255,255,.04); }
.persona-panel[data-persona="AEGIS_04"] { box-shadow: var(--shadow), 0 0 52px rgba(66,245,197,.11), inset 0 1px rgba(255,255,255,.04); }
.sf-fallback .sf-status-chip { color: var(--amber); }
.sf-fallback .sf-cube-dot { border-color: var(--amber); box-shadow: 0 0 8px var(--amber); animation: none; }
@media (max-width: 820px), (pointer: coarse) {
  .sf-scene-canvas { opacity: .72; }
  .board-frame { transform: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  .sf-cube-dot { animation: none; }
  .board-frame { transform: none !important; transition: none; }
}


/* === iOS / domain deployment hardening === */
body {
  padding-top: env(safe-area-inset-top);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
}
.static-fallback { pointer-events: none; }
.noscript-alert {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 999;
  padding: 12px 16px;
  border: 1px solid rgba(255,199,90,.5);
  border-radius: 14px;
  color: #fff0c6;
  background: rgba(17,12,28,.92);
  backdrop-filter: blur(18px);
  text-align: center;
}
@supports (-webkit-touch-callout: none) {
  .board-frame { max-height: none; }
  .board-cell { -webkit-tap-highlight-color: transparent; }
  .glass-panel { -webkit-backdrop-filter: blur(20px) saturate(150%); }
}


/* === SF VEHICLE PIECES v1: no visible kanji, eight distinct vehicle silhouettes === */
.vehicle-piece {
  --unit-color: #71efff;
  --unit-core: #ecfeff;
  --unit-shadow: rgba(84, 233, 255, .55);
  --unit-facing: 0deg;
  width: 91%;
  height: 91%;
  display: grid;
  place-items: center;
  position: relative;
  clip-path: none;
  background: transparent !important;
  color: var(--unit-color);
  font-size: 0;
  text-shadow: none;
  box-shadow: none;
  filter: drop-shadow(0 8px 8px rgba(0,0,0,.5)) drop-shadow(0 0 7px var(--unit-shadow));
  transform: translateY(-4%) rotateZ(var(--unit-facing));
  transform-origin: 50% 58%;
  transition: transform .22s var(--ease), filter .22s var(--ease), opacity .22s var(--ease);
  z-index: 3;
  pointer-events: none;
  animation: vehicleFloat 3.2s ease-in-out infinite;
}
.vehicle-piece::before,
.vehicle-piece::after { display: none !important; }
.vehicle-piece.sente {
  --unit-color: #7befff;
  --unit-core: #f2feff;
  --unit-shadow: rgba(84,233,255,.62);
}
.vehicle-piece.gote {
  --unit-color: #ff80dd;
  --unit-core: #fff1fb;
  --unit-shadow: rgba(255,92,200,.58);
  --unit-facing: 180deg;
  background: transparent !important;
}
.vehicle-piece.promoted {
  --upgrade-color: #ffd064;
  background: transparent !important;
  color: var(--unit-color);
}
@keyframes vehicleFloat {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -3px; }
}
.board-cell:nth-child(3n) .vehicle-piece { animation-delay: -.7s; }
.board-cell:nth-child(4n) .vehicle-piece { animation-delay: -1.3s; }
.board-cell:hover .vehicle-piece,
.board-cell.selected .vehicle-piece {
  transform: translateY(-12%) rotateZ(var(--unit-facing)) scale(1.08);
  filter: drop-shadow(0 11px 10px rgba(0,0,0,.55)) drop-shadow(0 0 13px var(--unit-shadow)) drop-shadow(0 0 25px var(--unit-shadow));
}
.board-cell.last-move .vehicle-piece { filter: drop-shadow(0 8px 8px rgba(0,0,0,.5)) drop-shadow(0 0 12px rgba(255,199,90,.7)); }
.board-cell.king-in-check .vehicle-piece { filter: drop-shadow(0 8px 8px rgba(0,0,0,.5)) drop-shadow(0 0 18px rgba(255,70,115,.95)); }
.unit-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  position: relative;
  z-index: 2;
}
.unit-body,
.unit-wing,
.unit-pod,
.unit-leg,
.unit-track,
.unit-shield {
  fill: currentColor;
  fill-opacity: .31;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linejoin: round;
}
.unit-dark {
  fill: #06101f;
  fill-opacity: .88;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linejoin: round;
}
.unit-core {
  fill: var(--unit-core);
  stroke: currentColor;
  stroke-width: 2.5;
  filter: drop-shadow(0 0 5px currentColor);
}
.unit-light,
.unit-thruster {
  fill: currentColor;
  filter: drop-shadow(0 0 7px currentColor);
}
.unit-thruster { fill-opacity: .72; }
.unit-line,
.unit-orbit {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .7;
}
.unit-orbit { stroke-dasharray: 7 7; animation: unitOrbit 7s linear infinite; transform-origin: 50px 50px; }
@keyframes unitOrbit { to { transform: rotate(360deg); } }
.unit-platform {
  position: absolute;
  left: 15%;
  right: 15%;
  bottom: 4%;
  height: 24%;
  border-radius: 50%;
  border: 1px solid currentColor;
  background: radial-gradient(ellipse, color-mix(in srgb, currentColor 30%, transparent), transparent 68%);
  box-shadow: 0 0 11px var(--unit-shadow), inset 0 0 8px var(--unit-shadow);
  opacity: .7;
  transform: perspective(90px) rotateX(70deg);
  z-index: 1;
}
.unit-status-light {
  position: absolute;
  width: 7%;
  aspect-ratio: 1;
  border-radius: 50%;
  top: 17%;
  right: 17%;
  background: var(--unit-core);
  box-shadow: 0 0 8px currentColor, 0 0 15px currentColor;
  z-index: 4;
  animation: unitPulse 1.8s ease-in-out infinite;
}
@keyframes unitPulse { 50% { opacity: .38; transform: scale(.72); } }
.unit-upgrade-ring {
  fill: none;
  stroke: var(--upgrade-color, #ffd064);
  stroke-width: 2.5;
  stroke-dasharray: 8 5;
  transform-origin: 50px 50px;
  animation: upgradeSpin 3.8s linear infinite;
  filter: drop-shadow(0 0 5px #ffd064);
}
.unit-upgrade-wing,
.unit-upgrade-crown {
  fill: none;
  stroke: var(--upgrade-color, #ffd064);
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 4px #ffd064);
}
@keyframes upgradeSpin { to { transform: rotate(360deg); } }
.unit-k { width: 98%; height: 98%; }
.unit-r, .unit-b { width: 94%; height: 94%; }
.unit-p { width: 78%; height: 78%; }
.hand-vehicle {
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  animation: none;
  transform: rotateZ(var(--unit-facing));
  filter: drop-shadow(0 3px 4px rgba(0,0,0,.45)) drop-shadow(0 0 5px var(--unit-shadow));
}
.hand-vehicle .unit-platform,
.hand-vehicle .unit-status-light { display: none; }
.hand-piece {
  min-width: 58px;
  height: 43px;
  gap: 5px;
}
.hand-piece small { font-size: 11px; font-weight: 900; }
@media (max-width: 820px) {
  .vehicle-piece { width: 96%; height: 96%; }
  .unit-p { width: 84%; height: 84%; }
}
@media (prefers-reduced-motion: reduce) {
  .vehicle-piece,
  .unit-orbit,
  .unit-upgrade-ring,
  .unit-status-light { animation: none !important; }
}


/* === Lightweight SF background v2: no central orb / no orbital rings / no bloom === */
.sf-scene-canvas {
  opacity: .42;
  filter: saturate(1.02) contrast(1.01);
}
.board-stage {
  position: relative;
  isolation: isolate;
}
.board-stage::before {
  content: '';
  position: absolute;
  left: 12%;
  right: 12%;
  top: 51%;
  height: 30%;
  z-index: -1;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(ellipse at center,
    rgba(84,233,255,.18) 0%,
    rgba(84,233,255,.075) 36%,
    rgba(157,123,255,.04) 58%,
    transparent 74%);
  filter: blur(24px);
  transform: translateY(26%) scale(.9);
  animation: boardUnderGlow 5.4s ease-in-out infinite;
}
.board-frame {
  translate: 0 -2px;
  box-shadow:
    0 42px 70px rgba(0,0,0,.54),
    0 22px 42px rgba(84,233,255,.09),
    0 0 0 1px rgba(255,255,255,.03) inset,
    0 0 54px rgba(84,233,255,.09),
    inset 0 0 70px rgba(84,233,255,.045);
  animation: boardHoverShadow 5.4s ease-in-out infinite;
}
@keyframes boardUnderGlow {
  50% { opacity: .68; transform: translateY(31%) scale(.96); }
}
@keyframes boardHoverShadow {
  50% {
    translate: 0 -5px;
    box-shadow:
      0 50px 82px rgba(0,0,0,.58),
      0 28px 52px rgba(84,233,255,.11),
      0 0 0 1px rgba(255,255,255,.03) inset,
      0 0 64px rgba(84,233,255,.1),
      inset 0 0 70px rgba(84,233,255,.045);
  }
}
@media (max-width: 820px), (pointer: coarse) {
  .sf-scene-canvas { display: none !important; }
  .board-stage::before { opacity: .62; filter: blur(18px); }
  .board-frame { animation-duration: 6.8s; }
}
@media (prefers-reduced-motion: reduce) {
  .board-stage::before,
  .board-frame { animation: none !important; }
  .board-frame { translate: none; }
}


/* === Ultra Lite v3: no WebGL, no continuous animation === */
.sf-scene-canvas,
.sky-lane,
.background-glow,
.sf-status-chip { display: none !important; }

html, body {
  background: #040917;
}
body {
  background-image:
    linear-gradient(rgba(84,233,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(84,233,255,.035) 1px, transparent 1px),
    radial-gradient(circle at 50% 8%, rgba(45,96,146,.22), transparent 42%),
    linear-gradient(150deg, #030712 0%, #071426 48%, #09091d 100%);
  background-size: 56px 56px, 56px 56px, auto, auto;
  background-attachment: fixed;
}
.background-grid { opacity: .12 !important; animation: none !important; }
.background-grid::after { display: none !important; }

.glass-panel {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: linear-gradient(145deg, rgba(13,25,47,.96), rgba(6,13,28,.95)) !important;
  box-shadow: 0 16px 44px rgba(0,0,0,.34), inset 0 1px rgba(255,255,255,.035) !important;
}
.glass-panel::before,
.glass-panel::after,
.candidate-card::before,
.approval-gate::before { display: none !important; }

.board-stage {
  perspective: 1200px;
}
.board-frame {
  transform: translateY(-3px) rotateX(1.2deg);
  transform-origin: center 72%;
  box-shadow:
    0 28px 48px rgba(0,0,0,.52),
    0 10px 22px rgba(84,233,255,.08),
    inset 0 0 24px rgba(84,233,255,.035) !important;
  animation: none !important;
}
.board-frame::before,
.board-frame::after { display: none !important; }

.pulse-dot,
.check-alert,
.king-in-check,
.vehicle-piece,
.unit-core,
.unit-status-light,
.corner,
.button,
.candidate-card { animation: none !important; }

.vehicle-piece {
  transition: transform 110ms ease-out, filter 110ms ease-out !important;
  filter: drop-shadow(0 3px 4px rgba(0,0,0,.46)) !important;
}
.board-cell:hover .vehicle-piece,
.board-cell.selected .vehicle-piece {
  filter: drop-shadow(0 4px 5px rgba(0,0,0,.5)) drop-shadow(0 0 6px rgba(84,233,255,.32)) !important;
}

.board-cell::before { transition: opacity 90ms linear !important; }
.button, .candidate-card, .hand-piece { transition-duration: 100ms !important; }

.board-loading {
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  display: grid;
  place-items: center;
  color: rgba(142,246,255,.6);
  font-size: 11px;
  letter-spacing: .16em;
}

@media (max-width: 820px), (pointer: coarse) {
  body { background-attachment: scroll; }
  .glass-panel {
    background: rgba(7,15,31,.97) !important;
    box-shadow: 0 10px 24px rgba(0,0,0,.3) !important;
  }
  .board-frame {
    transform: none;
    box-shadow: 0 16px 30px rgba(0,0,0,.46), 0 0 18px rgba(84,233,255,.05) !important;
  }
  .vehicle-piece { filter: none !important; }
  .board-cell:hover .vehicle-piece,
  .board-cell.selected .vehicle-piece { filter: drop-shadow(0 0 4px rgba(84,233,255,.22)) !important; }
}
