:root {
  color-scheme: dark;
  --ink: #231b18;
  --ink-soft: #4e3f36;
  --ink-muted: #806d5b;
  --paper: #ead8b5;
  --paper-bright: #f4e8cb;
  --paper-deep: #c6a878;
  --border: rgba(65, 43, 29, 0.2);
  --cinnabar: #b7473f;
  --cinnabar-dark: #81352f;
  --jade: #2f766a;
  --gold: #e2ae53;
  --cyan: #4f9c9d;
  --rival: #7d6259;
  --neutral: #a9a092;
  --shadow: 0 24px 70px rgba(7, 4, 3, 0.28);
  --radius: 8px;
  --sans: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
  --serif: "Noto Serif SC", "STSong", "SimSun", serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--ink);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--paper-bright);
  background: var(--ink);
  font-family: var(--sans);
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

button,
a,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

button:focus-visible,
a:focus-visible,
[role="option"]:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.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;
}

.game-app {
  position: relative;
  min-height: 100vh;
  background: #241a17;
}

.game-app::before {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: "";
  opacity: 0.17;
  background-image: linear-gradient(rgba(226, 174, 83, 0.08) 1px, transparent 1px), linear-gradient(90deg, rgba(226, 174, 83, 0.08) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 88%);
}

.topbar,
main,
.site-footer {
  position: relative;
  z-index: 1;
  width: min(1480px, calc(100% - 64px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 84px;
  border-bottom: 1px solid rgba(234, 216, 181, 0.14);
}

.brand-lockup {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  color: var(--paper-bright);
  text-decoration: none;
}

.brand-stamp,
.faction-emblem,
.selected-mark {
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-weight: 700;
}

.brand-stamp {
  width: 32px;
  height: 32px;
  color: var(--ink);
  background: var(--gold);
  border: 1px solid rgba(244, 232, 203, 0.52);
  border-radius: 3px;
  box-shadow: 3px 3px 0 rgba(183, 71, 63, 0.7);
}

.brand-copy {
  display: grid;
  gap: 3px;
}

.brand-copy strong {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.04em;
}

.brand-copy small,
.local-badge,
.eyebrow,
.eyebrow-muted,
.panel-index,
.card-overline,
.resource-label,
.resource-sub,
.map-overlay,
.map-footer,
.site-footer,
.keyboard-hint,
.section-label,
.legend-item,
.faction-motto,
.faction-meter + .meter-caption,
.territory-facts span,
.selected-copy span,
.selected-copy small,
.command-hint,
.result-stat-row span {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.brand-copy small {
  color: rgba(234, 216, 181, 0.53);
  letter-spacing: 0.12em;
}

.topbar-actions,
.match-controls,
.eyebrow-row,
.intro-footer,
.map-toolbar-right,
.map-footer,
.dialog-heading,
.result-actions,
.command-footer,
.card-overline,
.meter-caption {
  display: flex;
  align-items: center;
}

.topbar-actions {
  gap: 16px;
}

.local-badge {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: rgba(234, 216, 181, 0.54);
}

.local-dot,
.log-live span,
.phase-pulse {
  display: inline-block;
  border-radius: 50%;
  background: var(--jade);
  box-shadow: 0 0 0 4px rgba(47, 118, 106, 0.14);
}

.local-dot {
  width: 6px;
  height: 6px;
}

.quiet-button,
.text-button,
.wide-quiet-button,
.icon-button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  color: rgba(244, 232, 203, 0.72);
  background: transparent;
}

.quiet-button {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(234, 216, 181, 0.23);
  border-radius: 999px;
  font-size: 11px;
}

.quiet-button:hover,
.text-button:hover,
.wide-quiet-button:hover,
.icon-button:hover {
  color: var(--paper-bright);
  border-color: rgba(226, 174, 83, 0.7);
}

[data-lucide] {
  width: 16px;
  height: 16px;
  stroke-width: 1.7;
}

main {
  min-height: calc(100vh - 145px);
}

.screen {
  min-height: calc(100vh - 145px);
  padding: 48px 0 40px;
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(400px, 0.92fr);
  gap: clamp(42px, 8vw, 128px);
  align-items: center;
  min-height: calc(100vh - 250px);
}

.intro-copy {
  max-width: 690px;
}

.eyebrow-row {
  gap: 12px;
  color: var(--gold);
}

.eyebrow-rule {
  width: 54px;
  height: 1px;
  background: rgba(226, 174, 83, 0.6);
}

.eyebrow-muted {
  color: rgba(234, 216, 181, 0.42);
}

.eyebrow,
.panel-index {
  color: var(--gold);
  font-weight: 700;
}

.intro-copy h1,
.match-title-group h1,
.result-copy h1 {
  max-width: 850px;
  margin: 25px 0 18px;
  color: var(--paper-bright);
  font-family: var(--serif);
  font-size: clamp(72px, 10vw, 154px);
  font-weight: 800;
  line-height: 0.88;
  letter-spacing: 0.01em;
}

.intro-copy h1 span,
.result-copy h1 span {
  display: block;
  color: var(--cinnabar);
  text-indent: 0.95em;
}

.intro-lead {
  margin: 0;
  color: rgba(244, 232, 203, 0.88);
  font-family: var(--serif);
  font-size: clamp(22px, 2.7vw, 38px);
  line-height: 1.45;
}

.intro-note {
  max-width: 480px;
  margin: 26px 0 0;
  color: rgba(234, 216, 181, 0.5);
  font-size: 13px;
  line-height: 1.9;
}

.intro-stats {
  display: flex;
  gap: 0;
  margin-top: 50px;
}

.intro-stat {
  display: grid;
  gap: 7px;
  min-width: 112px;
  padding-right: 26px;
  margin-right: 26px;
  border-right: 1px solid rgba(234, 216, 181, 0.18);
}

.intro-stat:last-child {
  padding-right: 0;
  margin-right: 0;
  border-right: 0;
}

.intro-stat strong {
  color: var(--gold);
  font-family: var(--serif);
  font-size: 28px;
}

.intro-stat span {
  color: rgba(234, 216, 181, 0.45);
  font-size: 11px;
}

.panel-surface {
  border: 1px solid var(--border);
  background: var(--paper-bright);
  box-shadow: var(--shadow);
}

.intro-panel {
  position: relative;
  max-width: 560px;
  padding: 30px;
  color: var(--ink);
  background-color: var(--paper);
  background-image: linear-gradient(rgba(92, 59, 35, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(92, 59, 35, 0.035) 1px, transparent 1px);
  background-size: 28px 28px;
}

.intro-panel::after {
  position: absolute;
  right: -8px;
  bottom: -8px;
  z-index: -1;
  width: 100%;
  height: 100%;
  content: "";
  border: 1px solid rgba(226, 174, 83, 0.55);
}

.panel-heading,
.command-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.panel-heading h2,
.command-header h2 {
  margin: 8px 0 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 27px;
  line-height: 1;
}

.panel-heading > [data-lucide],
.command-header > [data-lucide] {
  width: 23px;
  height: 23px;
  color: var(--cinnabar);
}

.panel-caption {
  max-width: 390px;
  margin: 18px 0 22px;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.7;
}

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

.faction-option {
  display: grid;
  grid-template-columns: 35px 1fr;
  gap: 9px;
  align-items: center;
  min-height: 66px;
  padding: 9px;
  color: var(--ink);
  text-align: left;
  background: rgba(255, 249, 232, 0.42);
  border: 1px solid rgba(65, 43, 29, 0.15);
  border-radius: 5px;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.faction-option:hover {
  transform: translateY(-2px);
  border-color: rgba(183, 71, 63, 0.7);
}

.faction-option[aria-selected="true"] {
  background: var(--ink);
  border-color: var(--ink);
  box-shadow: inset 3px 0 0 var(--cinnabar), 5px 5px 0 rgba(183, 71, 63, 0.16);
}

.faction-glyph {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  color: var(--paper-bright);
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  border-radius: 3px;
}

.faction-option-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.faction-option-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.faction-option-copy small {
  overflow: hidden;
  color: var(--ink-muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.faction-option[aria-selected="true"] .faction-option-copy strong {
  color: var(--paper-bright);
}

.faction-option[aria-selected="true"] .faction-option-copy small {
  color: rgba(234, 216, 181, 0.54);
}

.resume-panel {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 10px 12px;
  margin-top: 16px;
  color: var(--ink);
  border: 1px solid rgba(47, 118, 106, 0.35);
  background: rgba(47, 118, 106, 0.08);
}

.resume-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 28px;
  height: 28px;
  color: var(--jade);
  border: 1px solid rgba(47, 118, 106, 0.35);
  border-radius: 50%;
}

.resume-panel > div:nth-child(2) {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.resume-panel strong {
  font-size: 12px;
}

.resume-panel span {
  overflow: hidden;
  color: var(--ink-muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resume-panel .text-button {
  margin-left: auto;
  color: var(--jade);
  font-size: 11px;
  white-space: nowrap;
}

.cta-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 58px;
  padding: 0 17px 0 21px;
  margin-top: 20px;
  color: var(--paper-bright);
  background: var(--cinnabar);
  box-shadow: 6px 6px 0 rgba(129, 53, 47, 0.2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.cta-button:hover {
  background: #ca584d;
  box-shadow: 3px 3px 0 rgba(129, 53, 47, 0.28);
  transform: translate(2px, 2px);
}

.cta-button [data-lucide] {
  width: 19px;
  height: 19px;
}

.keyboard-hint {
  margin: 18px 0 0;
  color: var(--ink-muted);
  text-align: center;
  letter-spacing: 0.04em;
  text-transform: none;
}

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  color: var(--ink);
  background: rgba(226, 174, 83, 0.35);
  border: 1px solid rgba(65, 43, 29, 0.2);
  border-bottom-width: 2px;
  border-radius: 3px;
  font-family: var(--sans);
  font-size: 10px;
}

.intro-footer {
  justify-content: space-between;
  padding-top: 30px;
  color: rgba(234, 216, 181, 0.35);
  font-size: 10px;
  letter-spacing: 0.11em;
}

.online-hub {
  position: relative;
  width: 100%;
  padding: 24px;
  margin-top: 38px;
  color: var(--ink);
  background: var(--paper-bright);
  border-color: rgba(234, 216, 181, 0.28);
  box-shadow: 0 16px 45px rgba(7, 4, 3, 0.18);
}

.online-hub::after {
  position: absolute;
  right: -7px;
  bottom: -7px;
  z-index: -1;
  width: 100%;
  height: 100%;
  content: "";
  border: 1px solid rgba(79, 156, 157, 0.45);
}

.online-hub-heading,
.online-room-status-heading,
.online-control-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.online-hub-heading {
  align-items: flex-start;
  padding-bottom: 19px;
  border-bottom: 1px solid rgba(65, 43, 29, 0.15);
}

.online-hub-heading h2 {
  margin: 8px 0 0;
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1;
}

.online-hub-heading p {
  margin: 12px 0 0;
  color: var(--ink-muted);
  font-size: 11px;
  line-height: 1.65;
}

.online-service-state,
.online-profile,
.online-control-heading,
.online-room-code,
.online-room-player,
.online-text-button,
.online-primary-button,
.online-secondary-button,
.auth-submit,
.auth-security-note {
  display: inline-flex;
  align-items: center;
}

.online-service-state {
  gap: 7px;
  color: var(--ink-muted);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.online-service-dot {
  width: 6px;
  height: 6px;
  background: var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(226, 174, 83, 0.14);
}

.online-service-state.is-online {
  color: var(--jade);
}

.online-service-state.is-online .online-service-dot {
  background: var(--jade);
  box-shadow: 0 0 0 4px rgba(47, 118, 106, 0.13);
}

.online-service-state.is-offline {
  color: var(--cinnabar);
}

.online-service-state.is-offline .online-service-dot {
  background: var(--cinnabar);
  box-shadow: 0 0 0 4px rgba(183, 71, 63, 0.13);
}

.online-hub-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.88fr) minmax(285px, 1.08fr) minmax(220px, 0.9fr);
  gap: 20px;
  padding-top: 20px;
}

.online-profile {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-content: start;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  background: rgba(65, 43, 29, 0.045);
  border: 1px solid rgba(65, 43, 29, 0.12);
}

.online-profile-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--jade);
  border: 1px solid rgba(47, 118, 106, 0.3);
  background: rgba(47, 118, 106, 0.08);
}

.online-profile-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.online-overline {
  color: var(--ink-muted);
  font-size: 8px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.online-profile-copy strong {
  overflow: hidden;
  font-family: var(--serif);
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-profile-copy small {
  overflow: hidden;
  color: var(--ink-muted);
  font-size: 10px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-text-button {
  grid-column: 1 / -1;
  justify-content: space-between;
  min-height: 30px;
  padding: 0 1px;
  margin-top: 7px;
  color: var(--jade);
  background: transparent;
  font-size: 10px;
  font-weight: 700;
}

.online-text-button:hover {
  color: var(--cinnabar);
}

.online-control-heading {
  min-height: 20px;
  color: var(--ink-muted);
  font-size: 10px;
}

.online-control-heading > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-control-actions {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 8px;
  margin-top: 12px;
}

.online-primary-button,
.online-secondary-button {
  justify-content: center;
  gap: 7px;
  min-height: 43px;
  padding: 0 12px;
  font-size: 10px;
  font-weight: 700;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.online-primary-button {
  color: var(--paper-bright);
  background: var(--jade);
  border: 1px solid var(--jade);
}

.online-secondary-button {
  color: var(--ink-soft);
  background: rgba(65, 43, 29, 0.04);
  border: 1px solid rgba(65, 43, 29, 0.22);
}

.online-primary-button:hover,
.online-secondary-button:hover {
  transform: translateY(-2px);
  border-color: var(--cinnabar);
}

.online-primary-button:hover {
  background: #3d8d7e;
}

.online-primary-button:disabled,
.online-secondary-button:disabled,
.online-text-button:disabled {
  opacity: 0.45;
}

.online-room-status {
  padding: 12px;
  margin-top: 12px;
  background: rgba(47, 118, 106, 0.07);
  border: 1px solid rgba(47, 118, 106, 0.24);
}

.online-room-status-heading > span {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  color: var(--jade);
  font-size: 10px;
}

.online-room-status-heading strong {
  color: var(--ink);
}

.inline-icon-button {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: var(--ink-muted);
  background: transparent;
  border: 1px solid rgba(65, 43, 29, 0.16);
  border-radius: 50%;
}

.inline-icon-button:hover {
  color: var(--cinnabar);
  border-color: rgba(183, 71, 63, 0.55);
}

.online-room-code {
  justify-content: space-between;
  gap: 8px;
  padding: 9px 0 7px;
  margin-top: 7px;
  border-top: 1px solid rgba(65, 43, 29, 0.12);
}

.online-room-code span {
  color: var(--ink-muted);
  font-size: 8px;
  letter-spacing: 0.14em;
}

.online-room-code strong {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-room-players {
  display: grid;
  gap: 5px;
}

.online-room-player {
  justify-content: space-between;
  gap: 7px;
  min-width: 0;
  padding: 5px 0;
  color: var(--ink-soft);
  border-top: 1px solid rgba(65, 43, 29, 0.09);
  font-size: 10px;
}

.online-room-player > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-room-player > span:last-child {
  flex: 0 0 auto;
  color: var(--ink-muted);
  font-size: 8px;
}

.online-room-list-wrap {
  min-width: 0;
}

.online-room-list {
  display: grid;
  gap: 7px;
  min-height: 96px;
  max-height: 155px;
  padding-right: 3px;
  margin-top: 7px;
  overflow-y: auto;
}

.online-room-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 9px;
  background: rgba(65, 43, 29, 0.04);
  border: 1px solid rgba(65, 43, 29, 0.12);
}

.online-room-item-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.online-room-item-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-room-item-copy small {
  overflow: hidden;
  color: var(--ink-muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-room-item button {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  min-height: 28px;
  padding: 0 8px;
  color: var(--jade);
  background: transparent;
  border: 1px solid rgba(47, 118, 106, 0.35);
  font-size: 9px;
}

.online-room-item button:hover {
  color: var(--paper-bright);
  background: var(--jade);
}

.online-empty-room {
  display: grid;
  place-items: center;
  min-height: 96px;
  color: var(--ink-muted);
  border: 1px dashed rgba(65, 43, 29, 0.18);
  font-size: 10px;
}

.online-join-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px;
  margin-top: 9px;
}

.online-join-form input {
  min-width: 0;
  min-height: 36px;
  padding: 0 10px;
  color: var(--ink);
  background: rgba(255, 252, 244, 0.72);
  border: 1px solid rgba(65, 43, 29, 0.2);
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 0.16em;
}

.online-join-form input::placeholder {
  color: var(--ink-muted);
  letter-spacing: 0.08em;
}

.online-join-form input:focus-visible {
  border-color: var(--jade);
  outline: none;
}

.online-join-form input:disabled {
  opacity: 0.45;
}

.online-join-form .online-secondary-button {
  min-height: 36px;
  padding: 0 12px;
}

.online-join-message {
  margin-top: 6px;
  color: var(--ink-muted);
  font-size: 9px;
  line-height: 1.6;
}

.online-join-message.is-error {
  color: var(--cinnabar);
}

.online-join-message.is-success {
  color: var(--jade);
}

.online-match-status {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 34px;
  padding: 0 9px;
  color: #9fd3c8;
  background: rgba(47, 118, 106, 0.12);
  border: 1px solid rgba(47, 118, 106, 0.45);
  font-size: 9px;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.online-match-status [data-lucide] {
  width: 13px;
  height: 13px;
}

.auth-dialog {
  width: min(420px, calc(100% - 28px));
  padding: 24px;
  color: var(--ink);
  background: var(--paper-bright);
  border: 1px solid var(--paper-deep);
  box-shadow: var(--shadow);
}

.auth-dialog::backdrop {
  background: rgba(11, 7, 6, 0.73);
  backdrop-filter: blur(4px);
}

.auth-dialog h2 {
  margin: 8px 0 0;
  font-family: var(--serif);
  font-size: 28px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin-top: 22px;
  background: rgba(65, 43, 29, 0.16);
}

.auth-tab {
  min-height: 36px;
  color: var(--ink-muted);
  background: rgba(65, 43, 29, 0.04);
  font-size: 11px;
}

.auth-tab[aria-selected="true"] {
  color: var(--paper-bright);
  background: var(--ink);
}

.auth-form {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.auth-form label {
  color: var(--ink-muted);
  font-size: 10px;
}

.auth-form input {
  min-height: 42px;
  padding: 0 11px;
  color: var(--ink);
  background: rgba(255, 249, 232, 0.7);
  border: 1px solid rgba(65, 43, 29, 0.2);
  border-radius: 2px;
  outline: 0;
  font-size: 13px;
}

.auth-form input:focus {
  border-color: var(--jade);
  box-shadow: 0 0 0 3px rgba(47, 118, 106, 0.12);
}

.auth-submit {
  justify-content: space-between;
  min-height: 48px;
  padding: 0 14px;
  margin-top: 8px;
  color: var(--paper-bright);
  background: var(--cinnabar);
  font-size: 11px;
  font-weight: 700;
}

.auth-submit:hover {
  background: var(--cinnabar-dark);
}

.auth-message {
  min-height: 18px;
  margin: 12px 0 0;
  color: var(--cinnabar);
  font-size: 10px;
  line-height: 1.5;
}

.auth-message.is-success {
  color: var(--jade);
}

.auth-security-note {
  gap: 7px;
  padding-top: 15px;
  margin-top: 7px;
  color: var(--ink-muted);
  border-top: 1px solid rgba(65, 43, 29, 0.13);
  font-size: 9px;
  line-height: 1.45;
}

.auth-security-note [data-lucide] {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  color: var(--jade);
}

.footer-separator {
  flex: 1;
  max-width: 160px;
  height: 1px;
  margin: 0 24px;
  background: rgba(234, 216, 181, 0.15);
}

.scroll-cue {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  color: var(--gold);
}

.screen.game-screen,
.screen.result-screen {
  padding-top: 32px;
}

.match-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.match-title-group h1 {
  max-width: none;
  margin: 10px 0 0;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1;
}

.match-controls {
  gap: 10px;
}

.live-signal {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  color: rgba(234, 216, 181, 0.58);
  border: 1px solid rgba(79, 156, 157, 0.34);
  background: rgba(79, 156, 157, 0.08);
  font-size: 10px;
}

.live-signal [data-lucide] {
  width: 14px;
  height: 14px;
  color: var(--cyan);
}

.live-signal strong {
  color: #9fd3c8;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.phase-chip {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  min-height: 34px;
  padding: 0 11px;
  color: var(--gold);
  background: rgba(226, 174, 83, 0.1);
  border: 1px solid rgba(226, 174, 83, 0.32);
  font-size: 11px;
}

.phase-pulse {
  width: 6px;
  height: 6px;
  animation: pulse 1.6s infinite;
}

.icon-button {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(234, 216, 181, 0.22);
  border-radius: 50%;
}

.resource-strip {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, 1fr) 0.92fr;
  gap: 1px;
  overflow: hidden;
  background: rgba(234, 216, 181, 0.15);
  border: 1px solid rgba(234, 216, 181, 0.15);
}

.resource-card,
.territory-count {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 2px 8px;
  align-content: center;
  min-height: 84px;
  padding: 12px 14px;
  background: #2c201c;
}

.resource-card.resource-main {
  background: #3a2921;
}

.resource-icon {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: var(--gold);
  background: rgba(226, 174, 83, 0.1);
  border: 1px solid rgba(226, 174, 83, 0.22);
  border-radius: 50%;
}

.resource-icon [data-lucide] {
  width: 14px;
  height: 14px;
}

.resource-label,
.resource-sub {
  color: rgba(234, 216, 181, 0.5);
}

.resource-card strong {
  color: var(--paper-bright);
  font-size: 20px;
  line-height: 1;
}

.resource-sub {
  grid-column: 2;
  color: rgba(234, 216, 181, 0.37);
  letter-spacing: 0.03em;
  text-transform: none;
}

.resource-food {
  color: #d2aa54;
}

.resource-troops {
  color: #c87361;
}

.resource-prestige {
  color: #8fc0ad;
}

.resource-action {
  color: #80b4c1;
}

.territory-count {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 7px;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  text-align: center;
}

.territory-count span,
.territory-count small {
  color: rgba(234, 216, 181, 0.5);
  font-size: 10px;
}

.territory-count strong {
  font-family: var(--serif);
  font-size: 29px;
}

.territory-count small {
  width: 100%;
}

.game-layout {
  display: grid;
  grid-template-columns: 202px minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
  margin-top: 16px;
}

.intel-column,
.map-column,
.command-column {
  min-width: 0;
}

.intel-column {
  display: grid;
  gap: 16px;
}

.faction-card,
.event-card,
.legend-card,
.command-column {
  color: var(--ink);
  background: var(--paper);
}

.faction-card,
.event-card,
.legend-card {
  padding: 15px;
}

.card-overline {
  justify-content: space-between;
  min-height: 16px;
  color: var(--ink-muted);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.card-overline [data-lucide] {
  width: 15px;
  height: 15px;
}

.faction-emblem {
  width: 64px;
  height: 64px;
  margin: 20px auto 10px;
  color: var(--paper-bright);
  background: var(--cinnabar);
  border: 1px solid rgba(35, 27, 24, 0.22);
  border-radius: 3px;
  box-shadow: 5px 5px 0 rgba(183, 71, 63, 0.14);
  font-size: 37px;
}

.faction-name,
.faction-motto {
  display: block;
  text-align: center;
}

.faction-name {
  font-family: var(--serif);
  font-size: 19px;
}

.faction-motto {
  margin-top: 4px;
  color: var(--ink-muted);
  letter-spacing: 0.05em;
  text-transform: none;
}

.faction-meter {
  height: 5px;
  margin: 22px 0 8px;
  overflow: hidden;
  background: rgba(35, 27, 24, 0.12);
}

.faction-meter span {
  display: block;
  height: 100%;
  background: var(--cinnabar);
  transition: width 220ms ease;
}

.meter-caption {
  justify-content: space-between;
  color: var(--ink-muted);
  text-transform: none;
}

.meter-caption strong {
  color: var(--cinnabar);
  font-size: 10px;
}

.log-live {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  color: var(--jade);
}

.log-live span {
  width: 5px;
  height: 5px;
  box-shadow: none;
}

.battle-log {
  display: grid;
  gap: 12px;
  min-height: 154px;
  padding: 17px 0 3px 18px;
  margin: 0;
  color: var(--ink-soft);
  list-style: none;
}

.battle-log li {
  position: relative;
  padding-left: 0;
  font-size: 10px;
  line-height: 1.6;
}

.battle-log li::before {
  position: absolute;
  top: 6px;
  left: -13px;
  width: 5px;
  height: 5px;
  content: "";
  border: 1px solid var(--cinnabar);
  border-radius: 50%;
}

.battle-log li strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink-muted);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.legend-card {
  display: grid;
  gap: 11px;
}

.legend-item {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
  text-transform: none;
}

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-player {
  background: var(--cinnabar);
}

.legend-rival {
  background: var(--rival);
}

.legend-neutral {
  background: var(--neutral);
}

.map-column {
  min-width: 0;
}

.map-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  min-height: 45px;
  padding: 0 3px 10px;
  color: var(--paper);
}

.map-toolbar > div:first-child {
  display: grid;
  gap: 5px;
}

.map-toolbar strong {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
}

.map-toolbar-right {
  gap: 13px;
  color: rgba(234, 216, 181, 0.48);
  font-size: 10px;
}

.map-coordinates {
  color: var(--gold);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.map-frame {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid rgba(226, 174, 83, 0.5);
  box-shadow: var(--shadow);
}

.map-frame::before,
.map-frame::after {
  position: absolute;
  z-index: 2;
  width: 10px;
  height: 10px;
  content: "";
  pointer-events: none;
  border-color: var(--cinnabar);
  border-style: solid;
}

.map-frame::before {
  top: 10px;
  left: 10px;
  border-width: 1px 0 0 1px;
}

.map-frame::after {
  right: 10px;
  bottom: 10px;
  border-width: 0 1px 1px 0;
}

#game-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  height: auto;
  cursor: crosshair;
  touch-action: none;
}

.map-overlay {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  color: rgba(78, 63, 54, 0.6);
  font-family: var(--sans);
  font-size: 8px;
  letter-spacing: 0.14em;
}

.map-overlay-top {
  top: 16px;
  left: 18px;
}

.map-overlay-bottom {
  right: 18px;
  bottom: 15px;
}

.barrage-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow: hidden;
  pointer-events: none;
}

.map-frame.is-shaking {
  animation: map-shake-soft 300ms ease-in-out both;
}

.map-frame.is-shaking-hard {
  animation: map-shake-hard 460ms ease-in-out both;
}

.barrage-entry {
  position: absolute;
  left: 100%;
  display: flex;
  gap: 7px;
  align-items: center;
  max-width: min(78%, 360px);
  padding: 6px 9px;
  color: var(--ink);
  background: rgba(244, 232, 203, 0.93);
  border: 1px solid rgba(65, 43, 29, 0.2);
  box-shadow: 3px 4px 0 rgba(65, 43, 29, 0.13);
  font-size: 10px;
  white-space: nowrap;
  will-change: transform;
  animation: barrage-drift 8.2s linear both;
}

.barrage-entry.is-gift {
  color: #593323;
  border-color: rgba(183, 71, 63, 0.4);
  background: rgba(255, 244, 213, 0.96);
}

.barrage-author {
  flex: 0 0 auto;
  color: var(--cinnabar);
  font-weight: 700;
}

.barrage-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.barrage-gift {
  display: inline-flex;
  gap: 3px;
  align-items: center;
  flex: 0 0 auto;
  color: var(--gold);
  font-size: 9px;
  font-weight: 700;
}

.barrage-gift [data-lucide] {
  width: 12px;
  height: 12px;
}

.pause-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  color: var(--paper-bright);
  text-align: center;
  background: rgba(35, 27, 24, 0.68);
  backdrop-filter: blur(3px);
}

.pause-overlay [data-lucide] {
  width: 31px;
  height: 31px;
  color: var(--gold);
}

.pause-overlay strong {
  font-family: var(--serif);
  font-size: 24px;
}

.pause-overlay span {
  color: rgba(244, 232, 203, 0.58);
  font-size: 11px;
}

.map-footer {
  justify-content: space-between;
  gap: 12px;
  padding: 11px 3px 0;
  color: rgba(234, 216, 181, 0.48);
  text-transform: none;
}

.map-footer kbd {
  color: var(--paper-bright);
  background: rgba(234, 216, 181, 0.13);
  border-color: rgba(234, 216, 181, 0.21);
}

.command-column {
  padding: 19px;
}

.command-column .panel-index {
  color: var(--cinnabar);
}

.command-column h2 {
  color: var(--ink);
}

.selected-territory {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 15px 0;
  margin-top: 16px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.selected-mark {
  flex: 0 0 auto;
  width: 47px;
  height: 47px;
  color: var(--paper-bright);
  background: var(--cinnabar);
  border-radius: 3px;
  font-size: 25px;
}

.selected-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.selected-copy span,
.selected-copy small {
  color: var(--ink-muted);
  letter-spacing: 0.03em;
  text-transform: none;
}

.selected-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.territory-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 15px 0 11px;
}

.territory-facts div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.territory-facts span {
  color: var(--ink-muted);
  letter-spacing: 0.04em;
  text-transform: none;
}

.territory-facts strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.command-hint {
  min-height: 42px;
  padding: 10px;
  margin: 4px 0 17px;
  color: var(--ink-muted);
  line-height: 1.55;
  letter-spacing: 0.02em;
  text-transform: none;
  background: rgba(65, 43, 29, 0.06);
  border-left: 2px solid var(--gold);
}

.action-section {
  border-top: 1px solid var(--border);
}

.section-label {
  display: flex;
  justify-content: space-between;
  padding: 15px 0 10px;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
  text-transform: none;
}

.section-label span:first-child {
  color: var(--cinnabar);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.action-grid {
  display: grid;
  gap: 7px;
}

.action-button {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 52px;
  padding: 7px 9px;
  color: var(--ink);
  text-align: left;
  background: rgba(255, 249, 232, 0.5);
  border: 1px solid rgba(65, 43, 29, 0.16);
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.action-button:hover:not(:disabled) {
  background: rgba(255, 249, 232, 0.96);
  border-color: rgba(183, 71, 63, 0.55);
  transform: translateX(3px);
}

.action-button:disabled {
  color: rgba(78, 63, 54, 0.42);
  background: rgba(65, 43, 29, 0.04);
  border-color: rgba(65, 43, 29, 0.08);
}

.action-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 31px;
  height: 31px;
  color: var(--cinnabar);
  background: rgba(183, 71, 63, 0.1);
  border-radius: 3px;
}

.action-button:disabled .action-icon {
  color: rgba(78, 63, 54, 0.42);
  background: rgba(65, 43, 29, 0.08);
}

.action-icon [data-lucide] {
  width: 15px;
  height: 15px;
}

.action-button > span:last-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.action-button strong {
  font-size: 11px;
}

.action-button small {
  overflow: hidden;
  color: var(--ink-muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-button:disabled small {
  color: rgba(78, 63, 54, 0.36);
}

.command-footer {
  justify-content: space-between;
  gap: 8px;
  padding-top: 16px;
  margin-top: 17px;
  color: var(--ink-muted);
  border-top: 1px solid var(--border);
  font-size: 9px;
}

.wide-quiet-button {
  min-height: 32px;
  padding: 0 8px;
  color: var(--ink-muted);
  border: 1px solid rgba(65, 43, 29, 0.18);
  border-radius: 3px;
  font-size: 10px;
}

.live-interaction {
  display: grid;
  gap: 18px;
  padding: 20px;
  margin-top: 16px;
  color: var(--ink);
  background-color: var(--paper);
  background-image: linear-gradient(rgba(92, 59, 35, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(92, 59, 35, 0.035) 1px, transparent 1px);
  background-size: 28px 28px;
}

.live-interaction-heading {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border);
}

.live-room-title {
  min-width: 0;
}

.live-room-title h2 {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 7px 0 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 25px;
  line-height: 1;
}

.live-room-title h2 [data-lucide] {
  width: 20px;
  height: 20px;
  color: var(--cinnabar);
}

.live-room-title p {
  margin: 10px 0 0;
  color: var(--ink-muted);
  font-size: 11px;
  line-height: 1.6;
}

.gift-score {
  display: grid;
  grid-template-columns: auto auto auto;
  gap: 5px 7px;
  align-items: baseline;
  min-width: 116px;
  padding: 10px 12px;
  color: var(--ink-muted);
  text-align: right;
  border-left: 2px solid rgba(183, 71, 63, 0.52);
}

.gift-score span {
  grid-column: 1 / -1;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gift-score strong {
  color: var(--cinnabar);
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1;
}

.gift-score small {
  font-size: 10px;
}

.gift-score em {
  grid-column: 1 / -1;
  color: var(--jade);
  font-size: 9px;
  font-style: normal;
}

.live-interaction-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr);
  gap: 22px;
}

.audience-feed-wrap,
.gift-console {
  min-width: 0;
}

.gift-console {
  padding-left: 22px;
  border-left: 1px solid var(--border);
}

.feed-label {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  min-height: 19px;
  color: var(--ink-muted);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.feed-label > span:first-child {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--cinnabar);
  font-weight: 700;
}

.feed-label [data-lucide] {
  width: 14px;
  height: 14px;
}

.gift-local-note {
  color: var(--ink-muted);
  font-size: 8px;
  letter-spacing: 0;
  text-transform: none;
}

.audience-feed {
  display: grid;
  gap: 9px;
  min-height: 132px;
  padding: 12px 0 10px 15px;
}

.audience-message {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 8px;
  min-width: 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.45;
}

.audience-message::before {
  position: absolute;
  top: 6px;
  left: -12px;
  width: 5px;
  height: 5px;
  content: "";
  background: var(--cinnabar);
  border-radius: 50%;
}

.audience-message.is-gift::before {
  background: var(--gold);
}

.audience-message strong {
  overflow: hidden;
  color: var(--ink-muted);
  font-size: 9px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audience-message p {
  overflow: hidden;
  min-width: 0;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audience-message .audience-gift {
  display: inline-flex;
  grid-column: 1 / -1;
  gap: 4px;
  align-items: center;
  color: var(--cinnabar);
  font-size: 9px;
  font-weight: 700;
}

.audience-gift [data-lucide] {
  width: 12px;
  height: 12px;
}

.barrage-form {
  display: flex;
  gap: 7px;
  padding-top: 9px;
  border-top: 1px solid var(--border);
}

.barrage-form input {
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  color: var(--ink);
  background: rgba(255, 249, 232, 0.7);
  border: 1px solid rgba(65, 43, 29, 0.2);
  border-radius: 3px;
  outline: 0;
  font-size: 11px;
}

.barrage-form input:focus {
  border-color: var(--cinnabar);
  box-shadow: 0 0 0 2px rgba(183, 71, 63, 0.14);
}

.send-barrage {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 36px;
  height: 34px;
  color: var(--paper-bright);
  background: var(--ink);
  border-radius: 3px;
  transition: background 160ms ease, transform 160ms ease;
}

.send-barrage:hover {
  background: var(--cinnabar-dark);
  transform: translateY(-1px);
}

.send-barrage [data-lucide] {
  width: 15px;
  height: 15px;
}

.gift-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.gift-button {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  min-height: 54px;
  padding: 7px;
  color: var(--ink);
  text-align: left;
  background: rgba(255, 249, 232, 0.62);
  border: 1px solid rgba(65, 43, 29, 0.17);
  border-radius: 3px;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.gift-button:hover {
  background: rgba(255, 249, 232, 0.96);
  border-color: rgba(183, 71, 63, 0.55);
  transform: translateY(-2px);
}

.gift-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 29px;
  height: 29px;
  color: var(--cinnabar);
  background: rgba(183, 71, 63, 0.1);
  border-radius: 50%;
}

.gift-icon [data-lucide] {
  width: 15px;
  height: 15px;
}

.gift-button > span:last-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.gift-button strong,
.gift-button small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gift-button strong {
  font-size: 11px;
}

.gift-button small {
  color: var(--ink-muted);
  font-size: 9px;
}

.gift-reinforcement .gift-icon {
  color: var(--jade);
  background: rgba(47, 118, 106, 0.11);
}

.gift-strategist .gift-icon {
  color: #7b6592;
  background: rgba(123, 101, 146, 0.12);
}

.gift-fire .gift-icon {
  color: var(--cinnabar);
  background: rgba(183, 71, 63, 0.12);
}

.gift-hint {
  min-height: 31px;
  padding: 8px 9px;
  margin: 10px 0 0;
  color: var(--ink-muted);
  background: rgba(65, 43, 29, 0.06);
  border-left: 2px solid var(--gold);
  font-size: 10px;
  line-height: 1.45;
}

.site-footer {
  justify-content: space-between;
  min-height: 60px;
  padding: 16px 0;
  color: rgba(234, 216, 181, 0.33);
  border-top: 1px solid rgba(234, 216, 181, 0.13);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.result-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 80px;
  align-items: center;
  min-height: calc(100vh - 245px);
}

.result-copy h1 {
  max-width: 620px;
  margin-top: 24px;
  font-size: clamp(54px, 7.5vw, 110px);
}

.result-copy h1 span {
  display: inline;
  color: var(--cinnabar);
}

.result-copy > p {
  max-width: 440px;
  margin: 22px 0 42px;
  color: rgba(234, 216, 181, 0.6);
  font-size: 14px;
  line-height: 1.8;
}

.result-stat-row {
  display: flex;
  gap: 0;
}

.result-stat-row > div {
  display: grid;
  gap: 8px;
  min-width: 120px;
  padding-right: 25px;
  margin-right: 25px;
  border-right: 1px solid rgba(234, 216, 181, 0.19);
}

.result-stat-row > div:last-child {
  padding-right: 0;
  margin-right: 0;
  border-right: 0;
}

.result-stat-row span {
  color: rgba(234, 216, 181, 0.43);
  letter-spacing: 0.05em;
  text-transform: none;
}

.result-stat-row strong {
  color: var(--gold);
  font-family: var(--serif);
  font-size: 31px;
}

.result-actions {
  gap: 14px;
  max-width: 410px;
  margin-top: 44px;
}

.result-actions .cta-button {
  min-width: 205px;
  margin-top: 0;
}

.result-seal {
  display: grid;
  place-items: center;
  align-content: center;
  width: min(300px, 100%);
  aspect-ratio: 1;
  color: var(--cinnabar);
  border: 1px solid rgba(183, 71, 63, 0.7);
  outline: 1px solid rgba(183, 71, 63, 0.36);
  outline-offset: 12px;
  transform: rotate(-7deg);
}

.result-seal::before,
.result-seal::after {
  position: absolute;
  width: 27px;
  height: 27px;
  content: "";
  border-color: var(--cinnabar);
  border-style: solid;
}

.result-seal::before {
  top: -12px;
  left: -12px;
  border-width: 1px 0 0 1px;
}

.result-seal::after {
  right: -12px;
  bottom: -12px;
  border-width: 0 1px 1px 0;
}

.result-seal span {
  font-family: var(--serif);
  font-size: 55px;
  font-weight: 700;
  line-height: 0.98;
  text-align: center;
}

.result-seal small {
  margin-top: 14px;
  font-size: 9px;
  letter-spacing: 0.18em;
}

.rules-dialog {
  width: min(520px, calc(100% - 28px));
  padding: 24px;
  color: var(--ink);
  background: var(--paper-bright);
  border: 1px solid var(--paper-deep);
  box-shadow: var(--shadow);
}

.rules-dialog::backdrop {
  background: rgba(11, 7, 6, 0.73);
  backdrop-filter: blur(4px);
}

.dialog-heading h2 {
  margin: 8px 0 0;
  font-family: var(--serif);
  font-size: 28px;
}

.rules-body > p {
  margin: 25px 0 21px;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.65;
}

.rules-list {
  display: grid;
  gap: 12px;
}

.rules-list > div {
  display: grid;
  grid-template-columns: 29px 1fr;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.rule-number {
  color: var(--cinnabar);
  font-family: var(--serif);
  font-size: 17px;
}

.rules-list p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.65;
}

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

.dialog-confirm {
  width: 100%;
  margin-top: 25px;
  color: var(--paper-bright);
  background: var(--ink);
  border-color: var(--ink);
}

.dialog-confirm:hover {
  color: var(--paper-bright);
  background: var(--cinnabar-dark);
}

.noscript-warning {
  position: fixed;
  inset: 20px;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--paper-bright);
  background: var(--cinnabar-dark);
  border: 1px solid var(--gold);
}

@keyframes pulse {
  0%, 100% { opacity: 0.55; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.2); }
}

@keyframes barrage-drift {
  0% { opacity: 0; transform: translate3d(0, 0, 0); }
  4% { opacity: 1; }
  92% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(calc(-100% - 100vw), 0, 0); }
}

@keyframes map-shake-soft {
  0%, 100% { transform: translate3d(0, 0, 0); }
  25% { transform: translate3d(-2px, 1px, 0); }
  50% { transform: translate3d(2px, -1px, 0); }
  75% { transform: translate3d(-1px, -1px, 0); }
}

@keyframes map-shake-hard {
  0%, 100% { transform: translate3d(0, 0, 0); }
  15% { transform: translate3d(-5px, 2px, 0); }
  35% { transform: translate3d(4px, -3px, 0); }
  55% { transform: translate3d(-3px, 3px, 0); }
  75% { transform: translate3d(3px, -1px, 0); }
  90% { transform: translate3d(-1px, 1px, 0); }
}

@media (max-width: 1180px) {
  .game-layout {
    grid-template-columns: 180px minmax(0, 1fr) 270px;
  }

  .resource-strip {
    grid-template-columns: repeat(3, 1fr);
  }

  .territory-count {
    grid-column: span 3;
    min-height: 58px;
  }

  .territory-count small {
    width: auto;
  }
}

@media (max-width: 900px) {
  .topbar,
  main,
  .site-footer {
    width: min(100% - 32px, 720px);
  }

  .intro-grid {
    grid-template-columns: 1fr;
    gap: 46px;
    min-height: auto;
  }

  .intro-copy h1 {
    font-size: clamp(70px, 16vw, 122px);
  }

  .intro-panel {
    max-width: none;
  }

  .game-layout {
    grid-template-columns: 1fr 1fr;
  }

  .map-column {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .intel-column {
    grid-column: 1;
    grid-row: 2;
  }

  .command-column {
    grid-column: 2;
    grid-row: 2;
  }

  .result-grid {
    gap: 36px;
    grid-template-columns: 1fr 220px;
  }

  .result-seal span {
    font-size: 42px;
  }

  .live-interaction-grid {
    grid-template-columns: 1fr;
  }

  .gift-console {
    padding-top: 18px;
    padding-left: 0;
    border-top: 1px solid var(--border);
    border-left: 0;
  }
}

@media (max-width: 620px) {
  .topbar,
  main,
  .site-footer {
    width: calc(100% - 24px);
  }

  .topbar {
    min-height: 68px;
  }

  .brand-copy small,
  .local-badge {
    display: none;
  }

  .screen {
    min-height: calc(100vh - 128px);
    padding-top: 30px;
  }

  .intro-grid {
    gap: 35px;
  }

  .intro-copy h1 {
    margin-top: 20px;
    font-size: clamp(62px, 20vw, 98px);
  }

  .intro-lead {
    font-size: 22px;
  }

  .intro-note {
    margin-top: 18px;
    font-size: 12px;
  }

  .intro-stats {
    margin-top: 32px;
  }

  .intro-stat {
    min-width: 80px;
    padding-right: 12px;
    margin-right: 12px;
  }

  .intro-stat strong {
    font-size: 22px;
  }

  .intro-stat span {
    font-size: 9px;
  }

  .intro-panel {
    padding: 20px 16px;
  }

  .panel-heading h2,
  .command-header h2 {
    font-size: 23px;
  }

  .faction-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .faction-option {
    min-height: 59px;
    padding: 7px;
  }

  .faction-glyph {
    width: 31px;
    height: 31px;
    font-size: 18px;
  }

  .faction-option-copy strong {
    font-size: 13px;
  }

  .intro-footer {
    display: grid;
    gap: 7px;
    padding-top: 23px;
  }

  .footer-separator {
    display: none;
  }

  .scroll-cue {
    display: none;
  }

  .screen.game-screen,
  .screen.result-screen {
    padding-top: 24px;
  }

  .match-header {
    align-items: flex-start;
    margin-bottom: 16px;
  }

  .match-title-group h1 {
    font-size: 29px;
  }

  .match-controls {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .live-signal {
    min-height: 30px;
    padding: 0 8px;
  }

  .live-signal span {
    display: none;
  }

  .phase-chip {
    width: 100%;
    justify-content: center;
    font-size: 9px;
  }

  .resource-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .resource-card {
    min-height: 76px;
    padding: 10px;
  }

  .resource-card.resource-main {
    grid-column: span 2;
  }

  .territory-count {
    grid-column: span 2;
  }

  .game-layout {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .map-column {
    order: 1;
    width: 100%;
  }

  .intel-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    order: 2;
    width: 100%;
  }

  .command-column {
    order: 3;
    width: 100%;
    padding: 16px;
  }

  .legend-card {
    grid-column: 1 / -1;
  }

  .map-toolbar {
    display: grid;
    gap: 8px;
  }

  .map-toolbar-right {
    justify-content: space-between;
  }

  .map-footer {
    font-size: 9px;
  }

  .battle-log {
    min-height: 150px;
  }

  .live-interaction {
    padding: 16px;
  }

  .live-interaction-heading {
    gap: 12px;
  }

  .live-room-title h2 {
    font-size: 22px;
  }

  .gift-score {
    min-width: 88px;
    padding: 8px;
  }

  .gift-score strong {
    font-size: 24px;
  }

  .audience-feed {
    min-height: 120px;
  }

  .result-grid {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 46px;
    min-height: auto;
  }

  .result-copy h1 {
    font-size: 54px;
  }

  .result-copy > p {
    margin-bottom: 30px;
  }

  .result-stat-row {
    width: 100%;
  }

  .result-stat-row > div {
    min-width: 0;
    padding-right: 12px;
    margin-right: 12px;
  }

  .result-stat-row strong {
    font-size: 25px;
  }

  .result-actions {
    display: grid;
    width: 100%;
    margin-top: 30px;
  }

  .result-actions .cta-button {
    width: 100%;
  }

  .result-seal {
    align-self: center;
    width: 190px;
  }

  .result-seal span {
    font-size: 34px;
  }

  .site-footer {
    display: grid;
    gap: 5px;
    min-height: 68px;
    line-height: 1.5;
  }
}

@media (max-width: 370px) {
  .topbar-actions {
    gap: 6px;
  }

  .quiet-button {
    padding: 0 8px;
  }

  .quiet-button span {
    display: none;
  }

  .intro-copy h1 {
    font-size: 61px;
  }

  .faction-option {
    grid-template-columns: 28px 1fr;
    gap: 6px;
  }

  .faction-glyph {
    width: 28px;
    height: 28px;
  }

  .faction-option-copy small {
    font-size: 9px;
  }

  .intel-column {
    grid-template-columns: 1fr;
  }

  .live-interaction-heading {
    display: grid;
  }

  .gift-score {
    width: 100%;
    grid-template-columns: auto auto auto;
    justify-content: start;
    text-align: left;
    border-top: 1px solid var(--border);
    border-left: 0;
  }

  .gift-score span {
    grid-column: auto;
  }

  .legend-card {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media (max-width: 1180px) {
  .online-hub-grid {
    grid-template-columns: 1fr 1fr;
  }

  .online-room-list-wrap {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .online-hub {
    margin-top: 30px;
  }

  .online-hub-grid {
    grid-template-columns: 1fr;
  }

  .online-room-list-wrap {
    grid-column: auto;
  }

  .online-room-list {
    max-height: 180px;
  }
}

@media (max-width: 620px) {
  .online-hub {
    padding: 17px;
    margin-top: 26px;
  }

  .online-hub-heading {
    display: grid;
    gap: 12px;
  }

  .online-hub-heading h2 {
    font-size: 24px;
  }

  .online-hub-heading p {
    font-size: 10px;
  }

  .online-control-actions {
    grid-template-columns: 1fr;
  }

  .online-profile {
    padding: 12px;
  }

  .online-match-status {
    order: 3;
    width: 100%;
    justify-content: center;
  }
}
