:root {
  --bg: #f4f2ee;
  --surface: #ffffff;
  --surface-alt: #ebe7df;
  --ink: #18161a;
  --muted: #5c5763;
  --accent: #9e1b32;
  --accent-hover: #7d1427;
  --gold: #b5892e;
  --gold-bright: #f3d68a;
  --border: #dfd9ce;
  --white: #ffffff;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(24, 22, 26, 0.06);
  --shadow-md: 0 8px 24px rgba(24, 22, 26, 0.08);
  --font-display: 'Cinzel', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -9999px; top: 8px;
  background: var(--ink); color: var(--white); padding: 8px 16px; border-radius: 6px; z-index: 100;
}
.skip-link:focus { left: 16px; }

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}

.brand-seal { flex-shrink: 0; }

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.03em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: color 0.15s ease;
}

.site-nav a:hover { color: var(--accent); }

/* Hero & Player */
.hero-section {
  padding: 24px 0 32px;
}

.hero-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  margin-bottom: 16px;
}

.hero-heading h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 36px;
  line-height: 1.2;
  color: var(--ink);
}

.hero-sub {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.stage-shell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.hgw-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 460px;
  max-height: 82vh;
  background: var(--ink);
  overflow: hidden;
}

@media (min-width: 1500px) {
  .hgw-stage {
    aspect-ratio: 16 / 9;
    max-height: 78vh;
  }
}

@media (max-width: 1024px) and (min-width: 641px) {
  .hgw-stage {
    aspect-ratio: 4 / 3;
    min-height: 540px;
    max-height: 82vh;
  }
}

.hgw-stage iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--ink);
}

.hgw-cover {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.hgw-cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.72);
}

.hgw-cover-ui {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 26px 36px;
  border-radius: 2px;
  background: rgba(10, 12, 18, 0.86);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(235, 224, 198, 0.42);
  border-top: 3px solid var(--accent);
  max-width: 92%;
}

.hgw-cover-eyebrow {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-bright);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 28px;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, transform 0.12s ease;
}

.btn-primary:hover { background: var(--accent-hover); color: var(--white); }
.btn-primary:active { transform: translateY(1px); }

.hgw-play-btn {
  min-height: 52px;
  padding: 0 36px;
  font-size: 18px;
  box-shadow: var(--shadow-md);
}

.hgw-cover-hint {
  font-size: 13px;
  color: var(--bg);
}

.hgw-cover-hint strong { color: var(--gold); }

/* In-place Ritual Loader */
.hgw-loader {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--ink);
  color: var(--bg);
  text-align: center;
  padding: 24px;
}

.ritual-spinner {
  position: relative;
  width: 72px;
  height: 72px;
  margin-bottom: 4px;
}

.ritual-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.ritual-ring-outer {
  border: 2px dashed var(--gold);
  animation: hgw-spin 5s linear infinite;
}

.ritual-ring-inner {
  inset: 10px;
  border: 2px solid transparent;
  border-top-color: var(--accent);
  border-right-color: var(--gold);
  animation: hgw-spin-rev 1.4s linear infinite;
}

.ritual-core {
  position: absolute;
  inset: 26px;
  background: var(--accent);
  transform: rotate(45deg);
  border: 1.5px solid var(--gold);
  animation: hgw-pulse 1.6s ease-in-out infinite;
}

@keyframes hgw-spin { to { transform: rotate(360deg); } }
@keyframes hgw-spin-rev { to { transform: rotate(-360deg); } }
@keyframes hgw-pulse {
  0%, 100% { opacity: 0.7; transform: rotate(45deg) scale(0.92); }
  50% { opacity: 1; transform: rotate(45deg) scale(1.08); }
}

.loader-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--gold);
}

.loader-sub {
  margin: 0;
  font-size: 14px;
  color: var(--bg);
}

/* Action Bar */
.action-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.action-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.btn-action:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-action[data-gf-liked],
.btn-action[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
}

.action-count {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--ink);
  font-size: 13px;
}

.btn-action[data-gf-liked] .action-count,
.btn-action[aria-pressed="true"] .action-count {
  background: var(--accent-hover);
  color: var(--white);
}

.btn-share-mini {
  padding: 0 12px;
  color: var(--muted);
}

.share-msg {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

/* Content Sections */
.content-section {
  padding: 48px 0;
  border-top: 1px solid var(--border);
}

.content-section h2 {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  line-height: 1.2;
  color: var(--ink);
}

.content-section h3 {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.3;
  color: var(--ink);
}

.section-intro {
  max-width: 70ch;
  margin-bottom: 32px;
}

.section-intro p {
  margin: 0;
  color: var(--muted);
}

/* Overview Asymmetric Grid */
.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 1fr);
  gap: 32px;
  align-items: start;
}

.overview-copy p {
  max-width: 70ch;
  margin: 0 0 16px;
}

.overview-copy p:last-child { margin-bottom: 0; }

.spec-ledger {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.ledger-head { margin-bottom: 16px; }

.ledger-kicker {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 4px;
}

.ledger-list {
  margin: 0;
  padding: 0;
}

.ledger-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  font-size: 14px;
}

.ledger-row dt {
  color: var(--muted);
  font-weight: 600;
}

.ledger-row dd {
  margin: 0;
  text-align: right;
  color: var(--ink);
}

.ledger-fallback {
  margin: 16px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}

/* 2x2 Numbered Steps */
.steps-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.step-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.step-num {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  color: var(--accent);
  margin-bottom: 8px;
}

.step-item p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

/* Ruled Mode Rows */
.mode-rows {
  border-top: 2px solid var(--ink);
}

.mode-row {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(0, 1.6fr);
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}

.mode-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 4px;
}

.mode-meta h3 { margin: 0; }

.mode-desc {
  margin: 0;
  color: var(--muted);
  max-width: 70ch;
}

/* Two-Column Tips & Player Q&A */
.qa-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
}

.tips-list, .compat-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tips-list li {
  padding-left: 16px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}

.tips-list strong { color: var(--ink); }

.compat-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}

.compat-list strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
}

.compat-list p {
  margin: 0;
  font-size: 15px;
  color: var(--muted);
}

/* FAQ Accordion */
.faq-wrap { max-width: 820px; }

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 20px;
  color: var(--accent);
  flex-shrink: 0;
}
.faq-item[open] summary::after { content: "−"; }

.faq-item p {
  margin: 12px 0 0;
  color: var(--muted);
  max-width: 70ch;
}

/* Comments */
.comments-wrap { max-width: 820px; }

.comments-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.comments-head h2 { margin: 0; }

.comments-badge {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.comment-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.reply-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  margin-bottom: 12px;
  border-radius: 8px;
  background: var(--surface-alt);
  font-size: 14px;
}

.comment-form[data-gf-replying] .reply-banner {
  display: flex;
}

.form-row { margin-bottom: 12px; }

.comment-form input,
.comment-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
}

.comment-form textarea { resize: vertical; min-height: 88px; }

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.form-msg {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.comments-list[data-gf-empty]::before {
  content: "No comments yet. Be the first to share which Servant won your Holy Grail War run!";
  display: block;
  padding: 24px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
  font-size: 15px;
}

.comment-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}

.comment-card[data-gf-owner] {
  border-left: 3px solid var(--accent);
  background: var(--surface-alt);
}

.comment-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 14px;
}

.owner-badge {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--white);
  font-size: 12px;
  font-weight: 600;
}

.comment-time { color: var(--muted); font-size: 13px; }
.comment-body { margin: 0 0 10px; white-space: pre-wrap; word-break: break-word; }
.reply-mention { color: var(--accent); font-weight: 600; margin-right: 6px; }
.comment-replies { margin-top: 12px; padding-left: 16px; border-left: 2px solid var(--border); display: flex; flex-direction: column; gap: 12px; }

.btn-link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* Inner & Legal Pages */
.doc-page { padding: 40px 0 64px; }
.doc-wrap { max-width: 780px; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 16px;
}

.doc-page h1 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 36px;
  line-height: 1.2;
}

.doc-meta {
  margin: 0 0 28px;
  font-size: 14px;
  color: var(--muted);
}

.prose h2 {
  margin: 32px 0 12px;
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.25;
}

.prose p, .prose li { max-width: 70ch; }
.prose ul { padding-left: 20px; }

.prose img {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin: 20px 0;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 14px;
  display: block;
  overflow-x: auto;
}

.prose thead {
  background: var(--ink);
  color: var(--gold);
}

.prose th, .prose td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.prose td:last-child {
  white-space: normal;
  min-width: 180px;
}

.prose tbody tr:nth-child(even) {
  background: rgba(244, 242, 238, 0.55);
}

.prose blockquote {
  margin: 20px 0;
  padding: 14px 18px;
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--muted);
}

.guide-art-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0 28px;
}

.guide-art-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.guide-art-card img {
  margin: 0;
  border: 0;
  border-radius: 0;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.guide-art-card span {
  display: block;
  padding: 8px 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.toc-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 16px 0 24px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.toc-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin-right: 4px;
}

.toc-bar a {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.toc-bar a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

@media (max-width: 640px) {
  .guide-art-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* 404 */
.not-found { padding: 64px 0; text-align: left; }
.nf-code {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 48px;
  color: var(--accent);
}

/* Footer */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 36px 0;
  font-size: 14px;
  color: var(--muted);
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
  text-decoration: none;
}

.footer-tagline { margin: 4px 0 0; font-size: 13px; }

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}

.footer-nav a:hover { color: var(--accent); }

.footer-disclaimer {
  margin: 0 0 8px;
  max-width: 78ch;
  font-size: 13px;
}

.footer-copy { margin: 0; font-size: 13px; }

/* Mobile */
@media (max-width: 820px) {
  .overview-grid, .qa-grid, .mode-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px), (orientation: portrait) and (max-width: 900px) {
  .wrap { padding: 0 16px; }
  .header-row {
    min-height: 52px;
    padding: 10px 0;
    flex-wrap: wrap;
    gap: 8px 14px;
  }
  .brand-name { font-size: 16px; }
  .site-nav { gap: 14px; width: 100%; justify-content: space-between; }
  .site-nav a { font-size: 13px; padding: 4px 0; }

  .hero-section { padding: 10px 0 18px; }
  .hero-heading { margin-bottom: 8px; gap: 3px; }
  .hero-heading h1, .doc-page h1 { font-size: 22px; }
  .hero-sub { font-size: 13px; line-height: 1.4; }

  .hgw-stage { aspect-ratio: 9 / 14; min-height: 560px; max-height: 84vh; }
  .hgw-cover-ui { padding: 18px 16px; gap: 12px; width: calc(100% - 24px); max-width: none; }
  .hgw-play-btn { width: 100%; min-height: 48px; padding: 0 20px; font-size: 16px; }
  .hgw-cover-hint { font-size: 12px; }

  .action-bar { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 12px; }
  .action-group { width: 100%; gap: 8px; }
  .btn-action { flex: 1 1 auto; min-height: 44px; padding: 0 12px; }
  .btn-share-mini { flex: 0 0 auto; min-width: 44px; }
  .btn-fullscreen { width: 100%; }

  .content-section { padding: 32px 0; }
  .content-section h2 { font-size: 24px; margin-bottom: 12px; }
  .section-intro { margin-bottom: 20px; }

  .overview-grid, .qa-grid { gap: 20px; }
  .spec-ledger, .step-item, .comment-form { padding: 18px 16px; }
  .steps-grid { grid-template-columns: 1fr; gap: 14px; }
  .mode-row { gap: 8px; padding: 18px 0; }
  .compat-list li, .faq-item, .comment-card { padding: 14px 16px; }
  .faq-item summary { font-size: 15px; }
  .doc-page { padding: 28px 0 44px; }
  .site-footer { padding: 28px 0; }
  .footer-nav { gap: 12px 18px; }
}

/* Self-Hosted Embed Simulator — Theatrical Visual Novel Editorial HUD */
body.is-embed {
  background: var(--ink);
  color: var(--bg);
  min-height: 100vh;
}

.hgw-app {
  --hud-line: rgba(218, 204, 174, 0.24);
  --hud-line-strong: rgba(235, 224, 198, 0.58);
  --hud-panel: rgba(13, 15, 21, 0.84);
  --hud-well: rgba(8, 10, 15, 0.72);
  --hud-gold: rgba(236, 226, 202, 0.96);
  --hud-muted: rgba(206, 203, 196, 0.72);
  --hud-crimson: rgba(158, 27, 50, 0.92);
  --ui-pad: clamp(6px, 1.1vmin, 14px);
  --ui-gap: clamp(6px, 0.95vmin, 11px);
  --hud-inset: clamp(8px, 1.5vmin, 20px);
  container-type: inline-size;
  container-name: hgw;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--ui-pad);
  gap: var(--ui-gap);
  background:
    linear-gradient(180deg, rgba(9, 11, 16, 0.84) 0%, rgba(7, 8, 13, 0.92) 100%),
    url('https://img.holygrailwar.com/s_0n42231k6z6x18/arena-bg.8e6c0805a4.webp') center / cover no-repeat;
  color: var(--bg);
}

.hgw-app:has(.sim-arena:not([hidden])) {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.ui-ico { flex-shrink: 0; display: inline-block; }

@keyframes hgw-fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes hgw-sheen {
  0% { transform: translateX(-140%) skewX(-18deg); }
  100% { transform: translateX(240%) skewX(-18deg); }
}

@keyframes hgw-target-pulse {
  0%, 100% { border-color: rgba(158, 27, 50, 0.55); }
  50% { border-color: rgba(243, 214, 138, 0.65); }
}

.sim-summon:not([hidden]) .summon-card,
.sim-wish:not([hidden]) .wish-card,
.sim-result:not([hidden]) .result-card,
.sim-event-overlay:not([hidden]) .sim-event-card {
  animation: hgw-fade-up 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.summon-portrait-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(243, 214, 138, 0.14), transparent);
  animation: hgw-sheen 3.8s ease-in-out infinite;
  pointer-events: none;
}

.sim-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: clamp(6px, 0.8vw, 12px);
  width: 100%;
  max-width: min(1240px, 100%);
  margin: 0 auto;
  padding: clamp(5px, 0.75vh, 9px) clamp(8px, 1.2vw, 14px);
  border-radius: 0;
  background: rgba(9, 11, 16, 0.72);
  backdrop-filter: blur(8px);
  border: 0;
  border-bottom: 1px solid var(--hud-line);
}

.sim-bar-left, .sim-bar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(6px, 0.8vw, 10px);
}

.sim-seal-dot {
  width: 7px;
  height: 7px;
  border-radius: 0;
  transform: rotate(45deg);
  background: var(--accent);
  border: 1px solid var(--hud-gold);
}

.sim-title {
  font-family: var(--font-display);
  font-size: clamp(14px, 1.35vw, 18px);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--hud-gold);
}

.sim-day-pill {
  padding: 2px 10px;
  border-radius: 2px;
  background: transparent;
  border-left: 1px solid var(--hud-line-strong);
  color: var(--hud-muted);
  font-size: clamp(12px, 1.05vw, 13px);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.sim-spells {
  display: flex;
  gap: 7px;
  align-items: center;
  padding: 4px 10px;
  border-radius: 2px;
  background: var(--hud-well);
  border: 1px solid var(--hud-line);
}

.spell-pip {
  width: 8px;
  height: 8px;
  border-radius: 0;
  transform: rotate(45deg);
  border: 1px solid rgba(218, 204, 174, 0.35);
  background: transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.spell-pip.is-on {
  background: var(--accent);
  border-color: rgba(243, 214, 138, 0.72);
}

.sim-btn-ghost, .sim-btn-start, .sim-btn-gold, .sim-act-btn, .sim-spell-btn, .sim-tab {
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  border-radius: 2px;
  transition: transform 0.14s ease, background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, opacity 0.16s ease;
}

.sim-btn-ghost {
  padding: clamp(4px, 0.65vh, 7px) clamp(8px, 1.05vw, 14px);
  font-size: clamp(12px, 1vw, 13px);
  letter-spacing: 0.04em;
  background: transparent;
  color: var(--hud-muted);
  border: 1px solid var(--hud-line);
}

.sim-btn-ghost:hover {
  border-color: var(--hud-line-strong);
  color: var(--white);
  background: rgba(218, 204, 174, 0.07);
}

.sim-lang-sel {
  padding: clamp(4px, 0.65vh, 7px) clamp(6px, 0.8vw, 10px);
  cursor: pointer;
}

.sim-lang-sel option {
  background: var(--ink);
  color: var(--bg);
}

.sim-btn-ghost.is-audio-on {
  border-color: rgba(218, 204, 174, 0.38);
  color: var(--hud-gold);
  background: rgba(218, 204, 174, 0.05);
}

.sim-btn-ghost.is-confirm {
  border-color: var(--accent);
  color: var(--white);
  background: rgba(158, 27, 50, 0.42);
}

.sim-setup {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(10px, 1.4vh, 16px);
  flex: 1 1 auto;
  width: 100%;
  max-width: min(1040px, 100%);
  margin: 0 auto;
  padding: clamp(4px, 1vh, 14px) 0;
}

.sim-summon, .sim-wish, .sim-result {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(10px, 1.4vh, 16px);
  flex: 1 1 auto;
  width: 100%;
  max-width: min(1040px, 100%);
  margin: 0 auto;
}

.sim-arena {
  position: relative;
  display: block;
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  max-width: min(1240px, 100%);
  margin: 0 auto;
  container-type: inline-size;
  container-name: arena;
  border-radius: 2px;
  overflow: hidden;
  border: 1px solid var(--hud-line);
  background: var(--ink);
}

.sim-event-overlay {
  position: absolute;
  inset: 0;
  z-index: 25;
  background: rgba(7, 8, 12, 0.84);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--hud-inset);
}

.sim-event-card {
  width: 100%;
  max-width: clamp(340px, 46vw, 560px);
  border-radius: 2px;
  border: 1px solid var(--hud-line-strong);
  background: rgba(13, 14, 20, 0.96);
  overflow: hidden;
}

.sim-event-art {
  position: relative;
  height: clamp(100px, 16vh, 150px);
  overflow: hidden;
  border-bottom: 1px solid var(--hud-line);
}

.sim-event-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.66) saturate(0.85);
}

.sim-event-kicker {
  position: absolute;
  left: 14px;
  bottom: 10px;
  padding: 2px 10px;
  border-radius: 2px;
  background: rgba(10, 11, 16, 0.86);
  border-left: 2px solid var(--accent);
  color: var(--hud-gold);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.sim-event-body {
  padding: clamp(14px, 2vmin, 20px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sim-event-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(18px, 1.8vw, 22px);
  letter-spacing: 0.04em;
  color: var(--hud-gold);
}

.sim-event-text {
  margin: 0;
  font-size: clamp(13px, 1.15vw, 15px);
  color: var(--bg);
}

.sim-event-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 6px;
}

.sim-choice-btn {
  padding: clamp(10px, 1.4vh, 14px) clamp(12px, 1.4vw, 16px);
  border-radius: 2px;
  border: 1px solid var(--hud-line);
  background: rgba(18, 20, 27, 0.85);
  color: var(--white);
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--font-body);
  transition: transform 0.14s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.sim-choice-btn:hover {
  transform: translateY(-1px);
  border-color: var(--hud-line-strong);
  background: rgba(28, 30, 39, 0.92);
}

.sim-choice-btn.is-primary {
  background: rgba(24, 16, 22, 0.94);
  border-color: rgba(158, 27, 50, 0.72);
  border-bottom: 2px solid var(--accent);
}

.sim-choice-btn strong { font-size: 14px; color: var(--hud-gold); letter-spacing: 0.03em; }
.sim-choice-btn span { font-size: 12px; color: var(--hud-muted); }

.wish-card {
  border-radius: 2px;
  border: 1px solid var(--hud-line);
  background: var(--hud-panel);
  overflow: hidden;
  margin: auto 0;
}

.wish-hero {
  position: relative;
  min-height: clamp(130px, 20vh, 185px);
  display: flex;
  align-items: flex-end;
  padding: clamp(14px, 2vmin, 22px);
  overflow: hidden;
  border-bottom: 1px solid var(--hud-line);
}

.wish-altar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.48) saturate(0.8);
}

.wish-hero-overlay {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 14px;
}

.wish-victor-img {
  width: clamp(56px, 5vw, 72px);
  height: clamp(74px, 6.8vw, 94px);
  object-fit: cover;
  border-radius: 2px;
  border: 1px solid var(--hud-line-strong);
  flex-shrink: 0;
}

.wish-eyebrow {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--hud-gold);
}

.wish-title {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: clamp(20px, 2.2vw, 28px);
  color: var(--white);
}

.wish-body {
  padding: clamp(14px, 2vmin, 22px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wish-prompt {
  margin: 0;
  font-size: 14px;
  color: var(--hud-muted);
}

.wish-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wish-chip {
  padding: 7px 12px;
  border-radius: 2px;
  border: 1px solid var(--hud-line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--bg);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.wish-chip.is-active, .wish-chip:hover {
  border-color: var(--accent);
  background: rgba(158, 27, 50, 0.24);
  color: var(--white);
}

.wish-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wish-form input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 2px;
  border: 1px solid var(--hud-line-strong);
  background: var(--hud-well);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 15px;
}

@media (max-width: 640px) {
  .sim-event-choices { grid-template-columns: 1fr; }
}

.summon-card {
  display: grid;
  grid-template-columns: clamp(160px, 22vw, 235px) minmax(0, 1fr);
  gap: clamp(14px, 2.2vw, 26px);
  padding: clamp(14px, 2.2vmin, 24px);
  border-radius: 2px;
  border: 1px solid var(--hud-line);
  background: var(--hud-panel);
  align-items: center;
  margin: auto 0;
}

.summon-portrait-wrap {
  position: relative;
  border-radius: 2px;
  overflow: hidden;
  border: 1px solid var(--hud-line-strong);
  aspect-ratio: 3 / 4;
  background: var(--ink);
}

.summon-portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.summon-class-badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 2px 10px;
  border-radius: 2px;
  background: rgba(10, 11, 16, 0.9);
  border-left: 2px solid var(--accent);
  color: var(--hud-gold);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.summon-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.summon-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--hud-muted);
}

.summon-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(22px, 2.4vw, 30px);
  letter-spacing: 0.04em;
  color: var(--white);
}

.summon-sub {
  margin: 0;
  font-size: clamp(13px, 1.1vw, 14px);
  color: var(--hud-muted);
}

.summon-passive {
  padding: 8px 12px;
  border-radius: 2px;
  border-left: 2px solid var(--accent);
  background: rgba(255, 255, 255, 0.03);
  font-size: 12.5px;
  color: var(--bg);
}

.summon-passive strong { color: var(--hud-gold); }

.summon-odds-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.odds-pill {
  padding: 8px 10px;
  border-radius: 2px;
  border: 1px solid var(--hud-line);
  background: var(--hud-well);
}

.odds-pill span { display: block; font-size: 12px; color: var(--hud-muted); letter-spacing: 0.04em; }
.odds-pill strong { font-size: 15px; color: var(--hud-gold); font-variant-numeric: tabular-nums; }

.arena-main-col, .arena-side-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

@media (max-width: 759px), (orientation: portrait) {
  .summon-card {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .summon-portrait-wrap {
    max-width: 175px;
    margin: 0 auto;
  }
  .summon-odds-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.sim-mode-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-radius: 2px;
  background: var(--hud-well);
  border: 1px solid var(--hud-line);
}

.sim-tab {
  padding: clamp(8px, 1.1vh, 11px) clamp(6px, 1vw, 14px);
  font-size: clamp(12px, 1.1vw, 14px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: transparent;
  color: var(--hud-muted);
  border: 0;
  border-right: 1px solid var(--hud-line);
  border-bottom: 2px solid transparent;
  border-radius: 0;
}

.sim-tab:last-child { border-right: 0; }

.sim-tab:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.03);
}

.sim-tab.is-active {
  background: rgba(218, 204, 174, 0.06);
  border-bottom-color: var(--accent);
  color: var(--hud-gold);
}

.sim-mode-desc {
  padding: clamp(8px, 1.1vh, 11px) clamp(12px, 1.4vw, 16px);
  border-radius: 2px;
  border-left: 2px solid var(--hud-line-strong);
  background: linear-gradient(90deg, rgba(16, 17, 24, 0.85), rgba(16, 17, 24, 0.35));
  font-size: clamp(12.5px, 1.1vw, 14px);
  color: var(--hud-muted);
}

.sim-mode-desc strong { color: var(--hud-gold); }

.sim-master-details {
  border: 1px solid var(--hud-line);
  border-radius: 2px;
  background: var(--hud-well);
}

.sim-master-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 12px;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--hud-muted);
}

.sim-master-summary::-webkit-details-marker { display: none; }
.sim-master-summary strong { color: var(--hud-gold); font-weight: 600; }
.sim-master-caret { font-size: 12px; color: var(--hud-gold); opacity: 0.8; }

.sim-master-details .sim-master-row {
  padding: 0 8px 8px;
}

.sim-master-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(6px, 0.8vw, 10px);
}

.master-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: clamp(7px, 1vh, 11px) clamp(9px, 1.1vw, 13px);
  border-radius: 2px;
  border: 1px solid var(--hud-line);
  background: var(--hud-panel);
  color: var(--bg);
  text-align: left;
  cursor: pointer;
  font-family: var(--font-body);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.master-pill:hover {
  border-color: var(--hud-line-strong);
  background: rgba(24, 26, 35, 0.92);
}

.master-pill.is-picked {
  border-color: var(--hud-line-strong);
  border-bottom: 2px solid var(--accent);
  background: rgba(28, 20, 27, 0.92);
}

.master-pill .ui-ico {
  color: var(--hud-gold);
  width: 26px;
  height: 26px;
  padding: 4px;
  border-radius: 2px;
  background: rgba(218, 204, 174, 0.06);
  border: 1px solid var(--hud-line);
}

.master-pill strong { display: block; font-size: clamp(12px, 1.05vw, 13.5px); color: var(--white); line-height: 1.2; }
.master-pill span { display: block; font-size: 12px; color: var(--hud-muted); line-height: 1.2; }

.sim-label-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.result-mvp-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.result-mvp-strip div {
  padding: 9px 11px;
  border-radius: 2px;
  border: 1px solid var(--hud-line);
  background: var(--hud-well);
  font-size: 12px;
}

.result-mvp-strip span { display: block; color: var(--hud-muted); font-size: 12px; }
.result-mvp-strip strong { color: var(--hud-gold); font-size: 13px; }

.sim-oc-card { max-width: 540px; }

.oc-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.oc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.oc-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--hud-gold);
}

.oc-grid input {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 2px;
  border: 1px solid var(--hud-line);
  background: var(--hud-well);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 14px;
}

@media (max-width: 640px) {
  .sim-master-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-mvp-strip { grid-template-columns: 1fr; }
  .oc-grid { grid-template-columns: 1fr; }
}

.sim-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sim-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sim-label { font-size: 12.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--hud-gold); }

.sim-btn-link {
  background: none;
  border: 0;
  color: var(--hud-gold);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sim-select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 2px;
  border: 1px solid var(--hud-line);
  background: var(--hud-well);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 14px;
}

.sim-roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 6px;
  max-height: clamp(160px, 28vh, 260px);
  overflow-y: auto;
  padding-right: 4px;
}

.roster-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 2px;
  border: 1px solid var(--hud-line);
  background: var(--hud-panel);
  color: var(--bg);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.roster-chip:hover { border-color: var(--hud-line-strong); background: rgba(24, 26, 35, 0.92); }

.roster-chip img {
  width: 28px;
  height: 36px;
  border-radius: 2px;
  object-fit: cover;
  border: 1px solid var(--hud-line);
  flex-shrink: 0;
}

.roster-chip strong { display: block; font-size: 12px; color: var(--white); line-height: 1.2; }
.roster-chip span { display: block; font-size: 12px; color: var(--hud-muted); line-height: 1.15; }

.roster-chip.is-picked {
  background: rgba(28, 19, 25, 0.94);
  border-color: var(--hud-line-strong);
  border-left: 2px solid var(--accent);
  color: var(--white);
}

.roster-chip-del {
  margin-left: auto;
  width: 22px;
  height: 22px;
  border-radius: 2px;
  border: 1px solid var(--hud-line);
  background: rgba(0, 0, 0, 0.35);
  color: var(--bg);
  font-size: 13px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.roster-chip-del:hover {
  border-color: var(--accent);
  color: var(--white);
}

.sim-stage-canvas {
  width: 100%;
  height: auto;
  display: block;
  cursor: pointer;
}

.sim-act-btn.is-locked {
  opacity: 0.35;
  border-color: rgba(158, 27, 50, 0.45);
  color: var(--hud-muted);
}

.result-head-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sim-btn-again-top {
  border-color: rgba(235, 224, 198, 0.45);
  border-bottom: 2px solid var(--hud-gold);
  background: rgba(138, 24, 46, 0.9);
  color: var(--white);
  font-family: var(--font-display);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  padding: 6px 14px;
}

.sim-btn-again-top:hover {
  background: rgba(164, 29, 54, 0.96);
  color: var(--white);
}

.sim-start-row {
  margin-top: clamp(4px, 0.8vh, 10px);
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: clamp(8px, 1vw, 14px);
}

.summon-actions {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: clamp(8px, 1vw, 12px);
}

.sim-btn-start {
  width: 100%;
  min-height: clamp(44px, 5.8vh, 54px);
  padding: clamp(8px, 1.2vh, 13px) clamp(14px, 2vw, 26px);
  border: 1px solid rgba(235, 224, 198, 0.36);
  border-bottom: 2px solid var(--hud-gold);
  background: rgba(138, 24, 46, 0.9);
  color: var(--white);
  font-family: var(--font-display);
  font-size: clamp(13.5px, 1.25vw, 16px);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sim-btn-start:hover {
  background: rgba(164, 29, 54, 0.96);
  border-color: var(--hud-line-strong);
  color: var(--white);
  transform: translateY(-1px);
}

.sim-btn-gold {
  min-height: clamp(44px, 5.8vh, 54px);
  padding: clamp(8px, 1.2vh, 13px) clamp(12px, 1.8vw, 22px);
  border: 1px solid var(--hud-line-strong);
  background: rgba(16, 18, 25, 0.86);
  color: var(--hud-gold);
  font-family: var(--font-display);
  font-size: clamp(12.5px, 1.1vw, 14.5px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sim-btn-gold:hover {
  border-color: var(--hud-gold);
  background: rgba(218, 204, 174, 0.12);
  color: var(--white);
  transform: translateY(-1px);
}

.sim-seed-tag {
  font-size: 12px;
  color: var(--hud-muted);
  background: transparent;
  border: 1px solid var(--hud-line);
  padding: 2px 10px;
  border-radius: 2px;
  font-variant-numeric: tabular-nums;
}

.sim-daily-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(6px, 0.8vw, 10px);
}

.daily-pick-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: clamp(7px, 0.9vh, 10px) clamp(9px, 1vw, 12px);
  border-radius: 2px;
  border: 1px solid var(--hud-line);
  background: var(--hud-panel);
  color: var(--bg);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.daily-pick-card:hover {
  border-color: var(--hud-line-strong);
  background: rgba(24, 26, 35, 0.92);
}

.daily-pick-card.is-picked {
  border-color: var(--hud-line-strong);
  border-left: 2px solid var(--accent);
  background: rgba(28, 19, 25, 0.94);
}

.daily-pick-card strong { display: block; font-size: clamp(12.5px, 1.05vw, 14px); color: var(--white); line-height: 1.25; }
.daily-pick-card span { display: block; font-size: 12px; color: var(--hud-muted); line-height: 1.2; }

.sim-intent-banner {
  position: absolute;
  top: clamp(8px, 1.4vh, 16px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  width: max-content;
  max-width: calc(100% - var(--hud-inset) * 2);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 12px;
  padding: clamp(5px, 0.75vh, 8px) clamp(14px, 1.8vw, 24px);
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(10, 11, 16, 0.82) 14%, rgba(10, 11, 16, 0.82) 86%, transparent);
  backdrop-filter: blur(6px);
  border-top: 1px solid var(--hud-line);
  border-bottom: 1px solid var(--hud-line);
  font-size: clamp(12px, 1.05vw, 13.5px);
  line-height: 1.3;
  text-align: center;
  color: var(--bg);
}

.intent-kicker {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  color: var(--hud-gold);
  letter-spacing: 0.12em;
  flex-shrink: 0;
  padding-right: 8px;
  border-right: 1px solid var(--hud-line);
}

.sim-score-pill {
  font-weight: 600;
  color: var(--hud-gold);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  padding-left: 8px;
  border-left: 1px solid var(--hud-line);
}

.result-score-big {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--hud-gold);
  font-variant-numeric: tabular-nums;
}

.result-emoji-strip {
  padding: 9px 12px;
  border-radius: 2px;
  background: var(--hud-well);
  border: 1px solid var(--hud-line);
  font-size: 16px;
  letter-spacing: 0.1em;
}

.result-board-box {
  padding: 11px 13px;
  border-radius: 2px;
  border: 1px solid var(--hud-line);
  background: var(--hud-well);
}

.board-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--hud-gold);
}

.board-name-form {
  display: flex;
  gap: 6px;
}

.board-name-form input {
  padding: 4px 8px;
  border-radius: 2px;
  border: 1px solid var(--hud-line);
  background: var(--ink);
  color: var(--white);
  font-size: 12px;
  width: 130px;
}

.board-list {
  margin: 0;
  padding-left: 20px;
  font-size: 13px;
  color: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-variant-numeric: tabular-nums;
}

.board-list li.is-me { color: var(--hud-gold); font-weight: 700; }

.result-chronicle-box {
  border-radius: 2px;
  border: 1px solid var(--hud-line);
  background: var(--hud-well);
  overflow: hidden;
}

.chronicle-summary {
  padding: 10px 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--hud-gold);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chronicle-summary::-webkit-details-marker { display: none; }
.chronicle-summary::after { content: "▼"; font-size: 12px; }
.result-chronicle-box[open] .chronicle-summary::after { content: "▲"; }

.chronicle-list {
  max-height: 200px;
  overflow-y: auto;
  padding: 8px 12px 12px;
  border-top: 1px solid var(--hud-line);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  line-height: 1.45;
}

.chronicle-item { margin: 0; color: var(--bg); }
.chronicle-item strong { color: var(--hud-gold); }
.chronicle-item.is-ko { color: var(--white); }

.sim-codex-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(7, 8, 12, 0.88);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.sim-codex-card {
  width: 100%;
  max-width: 720px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border-radius: 2px;
  border: 1px solid var(--hud-line-strong);
  background: rgba(13, 14, 20, 0.96);
}

.codex-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.codex-eyebrow {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--hud-muted);
}

.codex-title {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--hud-gold);
}

.codex-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.codex-stat {
  padding: 8px 10px;
  border-radius: 2px;
  border: 1px solid var(--hud-line);
  background: var(--hud-well);
  font-size: 12px;
}

.codex-stat span { display: block; color: var(--hud-muted); font-size: 12px; }
.codex-stat strong { color: var(--hud-gold); font-size: 15px; font-variant-numeric: tabular-nums; }

.codex-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  overflow-y: auto;
  padding-right: 4px;
}

.codex-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 2px;
  border: 1px solid var(--hud-line);
  background: var(--hud-well);
  font-size: 12px;
}

.codex-item.is-locked { opacity: 0.42; }
.codex-item.is-locked img { filter: grayscale(1) brightness(0.35); }
.codex-item.is-won { border-color: var(--hud-line-strong); border-left: 2px solid var(--accent); background: rgba(28, 19, 25, 0.82); }

.codex-item img {
  width: 34px;
  height: 44px;
  border-radius: 2px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--hud-line);
}

.codex-item strong { display: block; color: var(--white); font-size: 12px; line-height: 1.25; }
.codex-item span { display: block; color: var(--hud-muted); font-size: 12px; }

@media (max-width: 640px) {
  .codex-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .codex-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Non-blocking Bottom PWA Install Bar */
.pwa-bar {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  pointer-events: none;
}

.pwa-bar-inner {
  pointer-events: auto;
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--bg);
  border: 1px solid var(--gold);
  box-shadow: var(--shadow-md);
}

.pwa-bar-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
}

.pwa-bar-copy strong {
  color: var(--gold);
  font-size: 14px;
}

.pwa-ios-tip {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--white);
}

.pwa-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.pwa-install-btn {
  min-height: 40px;
  padding: 0 16px;
  font-size: 14px;
}

.pwa-close-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--muted);
  border-radius: 8px;
  background: transparent;
  color: var(--bg);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.pwa-close-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

@media (max-width: 640px) {
  .pwa-bar { left: 10px; right: 10px; bottom: 10px; }
  .pwa-bar-inner { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px; }
  .pwa-bar-actions { justify-content: space-between; }
  .pwa-install-btn { flex: 1 1 auto; }
}

.sim-stage-wrap {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--ink);
}

.sim-stage-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: pointer;
}

.sim-preview-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 2px;
  border: 1px solid var(--hud-line);
  background: var(--hud-panel);
}

.hero-emblem {
  width: 44px;
  height: 52px;
  border-radius: 2px;
  border: 1px solid var(--hud-line-strong);
  background: var(--hud-well);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--hud-gold);
  overflow: hidden;
}

.hero-emblem img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-info { flex: 1 1 auto; min-width: 0; }
.hero-info strong { display: block; font-size: 14px; color: var(--white); }
.hero-info span { display: block; font-size: 12px; color: var(--hud-muted); margin-bottom: 6px; }

.stat-bars {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  font-size: 12px;
}

.stat-bar-item b { display: block; color: var(--bg); font-weight: 500; font-variant-numeric: tabular-nums; }
.stat-track { height: 3px; border-radius: 0; background: rgba(255, 255, 255, 0.12); overflow: hidden; margin-top: 3px; }
.stat-fill { height: 100%; background: var(--hud-gold); }

.fighter-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.fighter-emblem { color: var(--hud-gold); flex-shrink: 0; }
.fighter-emblem img {
  width: 26px !important;
  height: 30px !important;
  border-radius: 2px !important;
  border: 1px solid var(--hud-line-strong);
}

.sim-fighters {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.fighter-card {
  padding: 8px 9px;
  border-radius: 2px;
  border: 1px solid var(--hud-line);
  background: var(--hud-panel);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.fighter-card.is-mine {
  border-color: var(--hud-line-strong);
  background: rgba(26, 24, 22, 0.92);
}
.fighter-card.is-target {
  border-color: var(--accent);
  background: rgba(34, 16, 22, 0.92);
  animation: hgw-target-pulse 2.2s ease-in-out infinite;
}
.fighter-card.is-clickable { cursor: pointer; }
.fighter-card.is-clickable:hover { border-color: var(--hud-gold); }
.fighter-card.is-dead { opacity: 0.36; filter: grayscale(0.75); }
.fighter-class { font-size: 12px; color: var(--hud-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.fighter-name { font-weight: 600; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.hp-track {
  width: 100%;
  height: 4px;
  border-radius: 0;
  background: rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.hp-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.28s ease;
}

.fighter-card.is-mine .hp-fill {
  background: var(--hud-gold);
}

.arena-bottom-hud {
  position: absolute;
  left: var(--hud-inset);
  right: var(--hud-inset);
  bottom: var(--hud-inset);
  z-index: 8;
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.1vh, 12px);
  pointer-events: none;
  max-width: min(1140px, calc(100% - var(--hud-inset) * 2));
  margin: 0 auto;
}

.arena-mid-hud {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: clamp(8px, 1.4vw, 18px);
  pointer-events: none;
}

.sim-controls {
  pointer-events: auto;
}

.sim-action-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(8px, 1vw, 14px);
}

.sim-act-btn {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 0.9vw, 12px);
  min-height: clamp(50px, 7vh, 68px);
  padding: clamp(8px, 1vh, 12px) clamp(10px, 1.4vw, 18px);
  font-size: clamp(13px, 1.2vw, 15.5px);
  background: rgba(15, 17, 24, 0.9);
  backdrop-filter: blur(10px);
  color: var(--hud-gold);
  border: 1px solid rgba(218, 204, 174, 0.32);
  border-bottom: 2px solid rgba(218, 204, 174, 0.28);
  border-radius: 2px;
}

.sim-act-btn::after {
  position: absolute;
  right: 8px;
  top: 5px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: rgba(218, 204, 174, 0.3);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.sim-act-btn:nth-child(1)::after { content: "01"; }
.sim-act-btn:nth-child(2)::after { content: "02"; }
.sim-act-btn:nth-child(3)::after { content: "03"; }
.sim-act-btn:nth-child(4)::after { content: "04"; }

.act-ico {
  width: clamp(16px, 1.6vw, 22px);
  height: clamp(16px, 1.6vw, 22px);
  flex-shrink: 0;
  opacity: 0.62;
  transition: opacity 0.16s ease, color 0.16s ease;
}

.act-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 2px;
  min-width: 0;
}

.sim-act-btn[data-act="strike"] {
  border-bottom-color: var(--accent);
}

.sim-act-btn[data-act="strike"] .act-ico {
  color: var(--hud-gold);
  opacity: 0.8;
}

.sim-act-btn.is-recommended {
  border-color: var(--gold-bright);
  border-bottom: 2px solid var(--gold-bright);
  background: rgba(42, 34, 24, 0.92);
  box-shadow: 0 0 14px rgba(243, 214, 138, 0.24);
}

.sim-act-btn.is-recommended .act-hint {
  color: var(--gold-bright);
  font-weight: 600;
}

.sim-act-btn:hover {
  background: rgba(26, 28, 38, 0.94);
  border-color: var(--hud-line-strong);
  border-bottom-color: var(--hud-gold);
  color: var(--white);
  transform: translateY(-2px);
}

.sim-act-btn[data-act="strike"]:hover {
  background: rgba(42, 18, 25, 0.94);
  border-color: rgba(218, 204, 174, 0.55);
  border-bottom-color: var(--accent);
}

.sim-act-btn:hover .act-ico { opacity: 1; }
.sim-act-btn:active { transform: translateY(0); }

.act-top {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(13px, 1.35vw, 17px);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.15;
}

.act-hint {
  font-size: 12px;
  font-weight: 400;
  color: var(--hud-muted);
  line-height: 1.15;
}

.sim-spell-dock {
  pointer-events: auto;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: clamp(6px, 0.8vh, 10px);
  flex-shrink: 0;
}

.sim-spell-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: clamp(34px, 4.5vh, 44px);
  padding: clamp(5px, 0.75vh, 8px) clamp(10px, 1.3vw, 16px);
  font-size: clamp(12px, 1.05vw, 13.5px);
  letter-spacing: 0.05em;
  background: rgba(14, 15, 20, 0.84);
  backdrop-filter: blur(6px);
  color: var(--hud-gold);
  border: 1px solid var(--hud-line);
  border-radius: 2px;
}

.sim-spell-btn[data-spell="np"] {
  border-color: rgba(158, 27, 50, 0.62);
  border-bottom: 2px solid var(--accent);
}

.sim-spell-btn[data-spell="np"] .ui-ico {
  color: var(--accent);
}

.sim-spell-btn:hover:not(:disabled) {
  background: rgba(34, 20, 26, 0.92);
  border-color: var(--hud-line-strong);
  color: var(--white);
  transform: translateY(-1px);
}

.sim-auto-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: clamp(30px, 3.8vh, 38px);
  padding: clamp(4px, 0.6vh, 7px) clamp(10px, 1.2vw, 15px);
  font-family: var(--font-body);
  font-size: clamp(12px, 1vw, 13px);
  letter-spacing: 0.08em;
  background: rgba(10, 11, 16, 0.72);
  color: var(--hud-muted);
  border: 1px solid var(--hud-line);
  clip-path: none;
}

.sim-auto-btn:hover {
  color: var(--white);
  border-color: var(--hud-line-strong);
  background: rgba(24, 26, 35, 0.88);
}

.sim-spell-row {
  display: flex;
  align-items: center;
  gap: clamp(6px, 0.7vw, 9px);
}

.sim-spell-label { font-size: 12px; color: var(--hud-muted); font-weight: 600; }
.sim-spell-btn:disabled { opacity: 0.34; cursor: not-allowed; }

.sim-log-wrap {
  pointer-events: auto;
  width: min(440px, 52%);
  display: flex;
  flex-direction: column;
  border: 0;
  border-left: 1.5px solid rgba(218, 204, 174, 0.45);
  border-radius: 0;
  background: linear-gradient(90deg, rgba(10, 11, 16, 0.84) 0%, rgba(10, 11, 16, 0.56) 76%, rgba(10, 11, 16, 0) 100%);
  overflow: hidden;
  transition: width 0.2s ease, background-color 0.2s ease;
}

.sim-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 10px 2px 12px;
  background: transparent;
  border-bottom: 1px solid rgba(218, 204, 174, 0.14);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--hud-muted);
}

.sim-log-toggle {
  padding: 1px 8px;
  border-radius: 2px;
  border: 1px solid var(--hud-line);
  background: transparent;
  color: var(--hud-muted);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.sim-log-toggle:hover,
.sim-log-wrap.is-expanded .sim-log-toggle {
  border-color: var(--hud-line-strong);
  background: rgba(218, 204, 174, 0.1);
  color: var(--white);
}

.sim-log {
  padding: 6px 12px 8px;
  font-size: clamp(12px, 1.08vw, 13.5px);
  line-height: 1.48;
  overflow-y: auto;
  max-height: clamp(50px, 7.5vh, 72px);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: max-height 0.2s ease;
}

.sim-log-wrap.is-expanded {
  width: min(500px, 100%);
  z-index: 14;
  background: rgba(10, 11, 16, 0.94);
  border: 1px solid var(--hud-line);
  border-left: 2px solid var(--hud-line-strong);
}

.sim-log-wrap.is-expanded .sim-log {
  max-height: 220px;
}

.log-line { margin: 0; color: rgba(236, 232, 224, 0.92); }
.log-line strong { color: var(--hud-gold); font-weight: 600; }
.log-line.is-ko { color: var(--white); }

.result-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: clamp(14px, 2vmin, 22px);
  border-radius: 2px;
  border: 1px solid var(--hud-line);
  background: var(--hud-panel);
}

.result-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.result-badge {
  padding: 3px 12px;
  border-radius: 2px;
  background: transparent;
  border: 1px solid var(--hud-line-strong);
  border-left: 2px solid var(--accent);
  color: var(--hud-gold);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
}
.result-mode { font-size: 12px; color: var(--hud-muted); }
.result-title { margin: 0; font-family: var(--font-display); font-size: clamp(20px, 2.2vw, 26px); color: var(--white); }
.result-sub { margin: 0; font-size: 14px; color: var(--hud-muted); }

.result-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.result-stats div {
  padding: 9px 10px;
  border-radius: 2px;
  border: 1px solid var(--hud-line);
  background: var(--hud-well);
  font-size: 12px;
}

.result-stats span { display: block; color: var(--hud-muted); }
.result-stats strong { font-size: 14px; color: var(--hud-gold); font-variant-numeric: tabular-nums; }

.result-preview-wrap {
  border: 1px solid var(--hud-line-strong);
  border-radius: 2px;
  overflow: hidden;
  max-width: 480px;
}

.result-canvas { width: 100%; height: auto; display: block; }

.result-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.result-msg { margin: 0; font-size: 13px; color: var(--hud-gold); min-height: 18px; }

@container hgw (max-width: 960px) {
  .sim-daily-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sim-title { letter-spacing: 0.06em; }
}

@container arena (max-width: 860px) {
  .sim-act-btn {
    padding: clamp(7px, 1vh, 12px) clamp(8px, 1.2vw, 14px);
    gap: 6px;
  }
  .sim-act-btn .act-ico { display: none; }
  .act-copy { align-items: center; text-align: center; }
  .act-top { letter-spacing: 0.05em; font-size: clamp(12.5px, 1.5cqi, 15px); }
  .sim-log-wrap { width: min(360px, 50%); }
}

@container hgw (max-width: 680px) {
  .sim-bar { padding: 6px 8px; gap: 5px; }
  .sim-bar-right { width: 100%; justify-content: space-between; gap: 4px; }
  .sim-bar-right .sim-btn-ghost { padding: 4px 7px; font-size: 12px; }
  .sim-spells { padding: 3px 6px; gap: 4px; }
  .sim-daily-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sim-mode-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sim-tab { border-bottom: 1px solid var(--hud-line); }
  .sim-master-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sim-roster-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 150px; }
  .sim-fighters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sim-start-row, .summon-actions { grid-template-columns: 1fr; }
  .result-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-actions { grid-template-columns: 1fr; }
}

@container arena (max-width: 680px) {
  .arena-bottom-hud { left: 6px; right: 6px; bottom: 6px; gap: 5px; max-width: none; }
  .arena-mid-hud { flex-direction: column-reverse; align-items: stretch; gap: 4px; }
  .sim-log-wrap { width: 100%; background: rgba(10, 11, 16, 0.8); }
  .sim-log-head { padding: 2px 8px; }
  .sim-log { max-height: 24px; padding: 3px 8px; font-size: 12px; line-height: 1.3; }
  .sim-spell-dock { flex-direction: row; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 5px; }
  .sim-spell-row { flex: 1 1 auto; justify-content: flex-end; gap: 5px; }
  .sim-spell-btn, .sim-auto-btn { min-height: 30px; padding: 4px 8px; font-size: 12px; white-space: nowrap; }
  .sim-action-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
  .sim-act-btn { min-height: 44px; padding: 6px 9px; gap: 6px; justify-content: flex-start; }
  .sim-act-btn .act-ico { display: inline-block; width: 15px; height: 15px; }
  .act-copy { align-items: flex-start; text-align: left; }
  .act-top { font-size: 13px; letter-spacing: 0.04em; }
  .sim-intent-banner { top: 5px; padding: 3px 8px; font-size: 12px; gap: 4px 6px; }
}

@media (max-height: 620px) {
  .hgw-app { --ui-pad: 5px; --ui-gap: 4px; --hud-inset: 6px; }
  .sim-bar { padding: 3px 8px; }
  .sim-intent-banner { top: 4px; padding: 3px 10px; font-size: 12px; }
  .arena-bottom-hud { gap: 4px; }
  .sim-log { max-height: 26px; padding: 3px 8px; font-size: 12px; line-height: 1.3; }
  .sim-act-btn { min-height: 40px; padding: 5px 10px; }
  .act-top { font-size: 13px; }
  .sim-spell-btn, .sim-auto-btn { min-height: 28px; padding: 3px 9px; }
  .sim-mode-desc { padding: 6px 10px; font-size: 12px; }
  .daily-pick-card { padding: 5px 8px; }
  .sim-btn-start, .sim-btn-gold { min-height: 38px; padding: 6px 14px; }
}

@media (max-height: 500px) {
  .act-hint { display: none; }
  .sim-act-btn { min-height: 36px; padding: 4px 10px; }
  .sim-log-head { padding: 2px 8px; }
  .sim-log { max-height: 22px; padding: 2px 8px; }
}

@media (max-width: 720px) {
  .hgw-app { padding: 6px 8px; gap: 6px; --hud-inset: 8px; --chamfer: 6px; }
}