:root {
  --deep-blue: #073b67;
  --ocean-blue: #0877d1;
  --bright-blue: #1498ee;
  --sky-blue: #dff3ff;
  --ice-blue: #f2faff;
  --surface: #ffffff;
  --ink: #102f49;
  --muted: #58748a;
  --line: #c8e4f4;
  --success: #0a8f6a;
  --danger: #c43d4d;
  --shadow: 0 18px 48px rgba(18, 96, 149, 0.14);
  --soft-shadow: 0 8px 24px rgba(20, 91, 137, 0.1);
  --radius-large: 26px;
  --radius-medium: 18px;
  color-scheme: light;
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
  min-height: 100%;
  background: var(--ice-blue);
}

body {
  min-width: 0;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background-color: var(--ice-blue);
  background-image:
    linear-gradient(rgba(8, 119, 209, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(8, 119, 209, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 92% 4%, rgba(80, 190, 247, 0.24), transparent 28rem);
  background-size: 22px 22px, 22px 22px, auto;
}

.connection-notice {
  position: fixed;
  z-index: 80;
  top: max(10px, env(safe-area-inset-top));
  left: 50%;
  width: min(calc(100% - 24px), 560px);
  padding: 11px 15px;
  transform: translateX(-50%);
  border: 1px solid #f0b5bf;
  border-radius: 14px;
  color: #7f2534;
  background: rgba(255, 243, 245, 0.97);
  box-shadow: 0 12px 34px rgba(89, 24, 37, 0.18);
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.5;
  text-align: center;
}

.connection-notice[data-state="online"] {
  border-color: #a9dcc7;
  color: #126342;
  background: rgba(238, 251, 245, 0.97);
}

button,
input,
textarea {
  font: inherit;
}

button,
input,
textarea,
select {
  min-height: 48px;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled,
textarea:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.66;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
dialog:focus-visible {
  outline: 3px solid rgba(20, 152, 238, 0.42);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.app-shell {
  width: min(100%, 920px);
  max-width: 920px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: calc(18px + env(safe-area-inset-top)) 14px calc(108px + env(safe-area-inset-bottom));
}

.page {
  display: grid;
  gap: 16px;
  animation: page-in 260ms ease-out both;
}

.console-card,
.workspace-card,
.account-card,
.settings-card {
  border: 1px solid rgba(116, 186, 226, 0.54);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  overflow: hidden;
  padding: 22px 18px 20px;
  border-radius: var(--radius-large);
}

.hero::before {
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  content: "";
  background: linear-gradient(90deg, var(--deep-blue) 0 24%, var(--bright-blue) 24% 78%, #65c7f4 78%);
}

.hero::after {
  position: absolute;
  right: -50px;
  bottom: -58px;
  width: 170px;
  height: 170px;
  border: 18px solid rgba(20, 152, 238, 0.07);
  border-radius: 38px;
  content: "";
  transform: rotate(24deg);
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.eyebrow,
.section-kicker {
  margin: 0 0 7px;
  color: var(--ocean-blue);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1,
h2 {
  margin: 0;
  color: var(--deep-blue);
  line-height: 1.25;
}

.hero h1 {
  max-width: 13em;
  font-size: clamp(1.42rem, 6vw, 2.45rem);
  letter-spacing: -0.035em;
}

.hello-text {
  min-height: 1.4em;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.hero-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}

.action-button {
  min-width: 78px;
  min-height: 48px;
  padding: 0 12px;
  border-radius: 14px;
  font-size: 0.84rem;
  font-weight: 800;
  box-shadow: var(--soft-shadow);
}

.checkin-button {
  color: #fff;
  background: var(--ocean-blue);
}

.credits-button {
  border: 1px solid var(--line);
  color: var(--deep-blue);
  background: var(--surface);
}

.intro {
  margin: 0;
  padding: 0 8px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.75;
}

.workspace-card {
  display: grid;
  min-height: min(58dvh, 610px);
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  border-radius: var(--radius-large);
}

.workspace-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, #fff, var(--ice-blue));
}

.workspace-heading h2,
.settings-card h2 {
  font-size: 1.03rem;
}

.server-light {
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(10, 143, 106, 0.13);
}

.messages {
  display: flex;
  min-width: 0;
  min-height: 250px;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  overflow-y: auto;
  background-image: linear-gradient(180deg, rgba(223, 243, 255, 0.38), transparent 34%);
}

.message {
  width: fit-content;
  max-width: min(88%, 44rem);
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  box-shadow: 0 5px 14px rgba(7, 59, 103, 0.06);
}

.message-user {
  align-self: flex-end;
  border-radius: 17px 6px 17px 17px;
  color: #fff;
  background: var(--ocean-blue);
}

.message-assistant {
  width: min(88%, 44rem);
  align-self: flex-start;
  border-radius: 6px 17px 17px;
  background: var(--surface);
}

.message-text {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  line-height: 1.65;
}

.answer-badge {
  width: fit-content;
  margin: 0 0 9px;
  padding: 4px 9px;
  border: 1px solid rgba(8, 119, 209, 0.18);
  border-radius: 999px;
  color: var(--ocean-blue);
  background: var(--sky-blue);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.message-notice {
  align-self: center;
  max-width: min(92%, 38rem);
  margin: 0;
  padding: 9px 13px;
  border: 1px solid rgba(196, 61, 77, 0.2);
  border-radius: 12px;
  color: #8e2d3a;
  background: #fff3f5;
  font-size: 0.83rem;
  line-height: 1.55;
  text-align: center;
}

.thinking-message {
  width: fit-content;
  display: inline-flex;
  gap: 9px;
  align-items: center;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.thinking-dots {
  display: inline-flex;
  gap: 4px;
}

.thinking-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--bright-blue);
  animation: thinking-bounce 900ms ease-in-out infinite;
}

.thinking-dot:nth-child(2) { animation-delay: 130ms; }
.thinking-dot:nth-child(3) { animation-delay: 260ms; }

.answer-commands {
  display: grid;
  min-width: 0;
  gap: 9px;
  margin-top: 13px;
}

.command-item {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(7, 59, 103, 0.14);
  border-radius: 13px;
  background: #082f4e;
}

.command-description {
  margin: 0;
  padding: 9px 11px;
  color: #cfeeff;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.78rem;
  line-height: 1.5;
}

.command-row {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 9px;
}

.command-code {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #f2fbff;
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 0.78rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.copy-command {
  min-width: 54px;
  min-height: 48px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  color: #fff;
  background: #0b79bd;
  font-size: 0.76rem;
  font-weight: 900;
}

.answer-notes {
  display: grid;
  gap: 5px;
  margin: 12px 0 0;
  padding-left: 1.2rem;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.55;
}

.answer-diagram,
.diagram-plan {
  min-width: 0;
  max-width: 100%;
}

.answer-diagram {
  display: grid;
  gap: 15px;
  margin-top: 14px;
}

.diagram-plan {
  overflow: hidden;
  border: 1px solid rgba(7, 59, 103, 0.16);
  border-radius: 16px;
  background: #f8fcff;
}

.diagram-plan[data-rank="fallback"] {
  border-style: dashed;
  background: #fffdf7;
}

.diagram-heading {
  display: flex;
  gap: 9px;
  align-items: center;
  justify-content: space-between;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(120deg, #e5f6ff, #fff);
}

.plan-label {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  color: #fff;
  background: var(--success);
  font-size: 0.7rem;
  font-weight: 900;
}

[data-rank="fallback"] .plan-label {
  background: #9a6a1e;
}

.diagram-view {
  margin: 0;
  color: var(--deep-blue);
  font-size: 0.84rem;
}

.performance-notes,
.pulse-details {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.5;
}

.performance-notes p,
.pulse-details p {
  margin: 0;
}

.performance-warning {
  color: #9a4d18;
  font-weight: 800;
}

.pulse-details {
  color: #405c72;
  background: #eff9ff;
}

.diagram-scroller {
  width: 100%;
  max-width: 100%;
  padding: 12px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-color: var(--bright-blue) var(--sky-blue);
}

.diagram-scroller:focus-visible {
  outline: 3px solid rgba(20, 152, 238, 0.42);
  outline-offset: -3px;
}

.diagram-stage {
  min-width: 760px;
}

.diagram-grid {
  display: grid;
  gap: 10px;
  align-items: stretch;
}

.diagram-node {
  min-width: 0;
  padding: 9px;
  overflow: hidden;
  border: 2px solid rgba(7, 59, 103, 0.18);
  border-radius: 13px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 5px 13px rgba(7, 59, 103, 0.09);
}

.command-block-node.is-first {
  border: 3px solid #e6a020;
  box-shadow: 0 0 0 3px rgba(230, 160, 32, 0.18), 0 6px 16px rgba(7, 59, 103, 0.1);
}

.node-title {
  margin: 0 0 8px;
  color: var(--deep-blue);
  font-size: 0.75rem;
  line-height: 1.35;
}

.command-block-cube {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px;
  border: 3px solid rgba(255, 255, 255, 0.48);
  border-radius: 10px;
  color: #fff;
  box-shadow: inset 0 0 0 2px rgba(6, 33, 54, 0.18);
  font-weight: 900;
}

.command-impulse { background-color: #e78324; }
.command-repeat { background-color: #6554c0; }
.command-chain { background-color: #269b55; }

.cube-index {
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 0.82rem;
}

.direction-arrow {
  font-size: 1.4rem;
}

.node-settings {
  display: grid;
  gap: 3px;
  margin: 8px 0 0;
  padding: 0;
  color: var(--muted);
  font-size: 0.67rem;
  line-height: 1.35;
  list-style: none;
}

.diagram-command {
  display: block;
  margin-top: 8px;
  padding: 6px;
  overflow-wrap: anywhere;
  border-radius: 6px;
  color: #e9f8ff;
  background: #0a3555;
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 0.64rem;
  line-height: 1.4;
  white-space: pre-wrap;
}

.component-symbol {
  display: grid;
  min-height: 58px;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: #5f7890;
  font-size: 1.55rem;
  font-weight: 900;
}

.component-redstone_dust .component-symbol,
.component-redstone_torch .component-symbol { background: #b63e3e; }
.component-button .component-symbol,
.component-lever .component-symbol,
.component-pressure_plate .component-symbol { background: #7c6a54; }
.component-repeater .component-symbol,
.component-comparator .component-symbol,
.component-observer .component-symbol { background: #6a5b7d; }
.component-solid_block .component-symbol { background: #71828b; }
.component-label .component-symbol { color: var(--deep-blue); background: var(--sky-blue); }

.component-air_gap {
  border-style: dashed;
  border-color: #7598ad;
  background: repeating-linear-gradient(135deg, #fff, #fff 8px, #eef6fa 8px, #eef6fa 16px);
}

.component-air_gap .component-symbol {
  color: var(--muted);
  background: transparent;
}

.diagram-label {
  margin: 7px 0 0;
  overflow-wrap: anywhere;
  color: var(--deep-blue);
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1.4;
}

.edge-track {
  display: flex;
  gap: 7px;
  margin-top: 10px;
  padding: 9px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #edf8ff;
}

.diagram-edge {
  display: grid;
  min-width: 120px;
  gap: 3px;
  padding: 7px 9px;
  border-left: 4px solid var(--ocean-blue);
  border-radius: 8px;
  color: var(--deep-blue);
  background: #fff;
  font-size: 0.65rem;
}

.edge-redstone { border-left-color: #b63e3e; }
.edge-placement { border-left-color: #73899a; border-left-style: dashed; }
.edge-meta { color: var(--muted); }

.diagram-legend,
.placement-steps {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 10px 14px 12px 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.5;
}

.placement-steps {
  color: var(--ink);
  background: #fff;
}

@keyframes thinking-bounce {
  0%, 65%, 100% { opacity: 0.35; transform: translateY(0); }
  32% { opacity: 1; transform: translateY(-4px); }
}

.empty-message {
  width: fit-content;
  max-width: 88%;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px 17px 17px 17px;
  color: var(--muted);
  background: var(--surface);
  font-size: 0.9rem;
  line-height: 1.6;
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: #fff;
}

textarea,
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: #fff;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

textarea {
  min-height: 52px;
  max-height: 150px;
  resize: vertical;
  padding: 13px 14px;
  line-height: 1.5;
}

input {
  padding: 0 13px;
}

input:focus,
textarea:focus {
  border-color: var(--bright-blue);
  box-shadow: 0 0 0 4px rgba(20, 152, 238, 0.1);
}

.composer button,
.primary-button {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--ocean-blue), var(--bright-blue));
  font-weight: 800;
  box-shadow: 0 9px 18px rgba(8, 119, 209, 0.2);
}

.page-heading {
  padding: 14px 6px 2px;
}

.page-heading h1 {
  font-size: clamp(1.8rem, 8vw, 2.7rem);
}

.account-card {
  display: grid;
  gap: 14px;
  align-items: center;
  padding: 18px;
  border-radius: var(--radius-large);
  grid-template-columns: auto minmax(0, 1fr);
}

.account-mark {
  display: grid;
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 17px;
  color: #fff;
  background: var(--ocean-blue);
  font-size: 1.4rem;
  font-weight: 900;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.18);
}

.account-card strong {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: var(--deep-blue);
  font-size: 1.12rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-identity {
  min-width: 0;
}

.xuid-line {
  display: flex;
  min-width: 0;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.identity-label {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.xuid-line code {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-button {
  min-width: 48px;
  min-height: 44px;
  flex: 0 0 auto;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ocean-blue);
  background: var(--ice-blue);
  font-weight: 800;
}

.account-facts {
  display: grid;
  margin: 2px 0 0;
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.account-facts div {
  min-width: 0;
  padding: 13px 7px 0;
  text-align: center;
}

.account-facts dt {
  color: var(--muted);
  font-size: 0.72rem;
}

.account-facts dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  color: var(--deep-blue);
  font-weight: 900;
}

.muted {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.6;
}

.settings-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: var(--radius-large);
}

.secondary-button,
.text-button,
.danger-button {
  min-height: 48px;
  border-radius: 14px;
  font-weight: 800;
}

.danger-outline {
  border-color: #f3b8c1;
  color: var(--danger);
  background: #fff8f9;
}

.secondary-button {
  padding: 0 15px;
  border: 1px solid var(--line);
  color: var(--deep-blue);
  background: var(--ice-blue);
}

.text-button {
  padding: 0 12px;
  color: var(--ocean-blue);
  background: transparent;
}

.danger-button {
  color: var(--danger);
  background: #fff2f4;
}

.bottom-nav {
  position: fixed;
  z-index: 20;
  right: 10px;
  bottom: max(10px, env(safe-area-inset-bottom));
  left: 10px;
  display: grid;
  width: min(calc(100% - 20px), 520px);
  min-height: 68px;
  margin: 0 auto;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 7px;
  border: 1px solid rgba(126, 191, 227, 0.62);
  border-radius: 23px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 44px rgba(7, 59, 103, 0.2);
  backdrop-filter: blur(18px);
}

.nav-button {
  display: flex;
  min-width: 0;
  min-height: 52px;
  gap: 7px;
  align-items: center;
  justify-content: center;
  border-radius: 17px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
}

.nav-button.is-current {
  color: var(--ocean-blue);
  background: var(--sky-blue);
}

.nav-icon {
  font-size: 1.15rem;
}

dialog {
  width: min(calc(100% - 24px), 460px);
  max-width: 460px;
  max-height: min(90dvh, 760px);
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 27px;
  color: var(--ink);
  background: transparent;
  box-shadow: 0 28px 80px rgba(7, 59, 103, 0.32);
}

dialog::backdrop {
  background: rgba(5, 40, 68, 0.5);
  backdrop-filter: blur(8px);
}

#adminCreditsDialog {
  width: min(calc(100% - 16px), 780px);
  max-width: 780px;
  max-height: min(94dvh, 900px);
}

.dialog-card {
  display: grid;
  gap: 11px;
  margin: 0;
  padding: 20px;
  border: 1px solid rgba(144, 204, 237, 0.7);
  border-radius: 27px;
  background: linear-gradient(165deg, #fff 0 66%, #edf8ff 100%);
}

.admin-sheet {
  gap: 14px;
  background:
    linear-gradient(90deg, rgba(20, 152, 238, 0.05) 1px, transparent 1px),
    linear-gradient(#fff 0 68%, #edf8ff 100%);
  background-size: 24px 24px, auto;
}

.admin-panel {
  display: grid;
  min-width: 0;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
}

.admin-panel h3 {
  margin: 0;
  color: var(--deep-blue);
  font-size: 0.96rem;
}

.inline-search,
#adminCreditsForm {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.inline-search > div {
  display: grid;
  min-width: 0;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.admin-player-results,
.admin-ledger {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.admin-player-results {
  max-height: 280px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.admin-player-option {
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 52px;
  gap: 8px;
  align-items: center;
  padding: 9px 11px;
  grid-template-columns: minmax(0, 1fr) auto;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: #f8fcff;
  text-align: left;
}

.admin-player-option.is-selected {
  border-color: var(--bright-blue);
  background: var(--sky-blue);
  box-shadow: inset 4px 0 0 var(--ocean-blue);
}

.admin-player-identity {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.admin-player-identity strong,
.admin-player-identity code,
.selected-player-card strong,
.ledger-row p {
  overflow-wrap: anywhere;
}

.admin-player-identity code,
.admin-security-state,
.ledger-metadata {
  color: var(--muted);
  font-size: 0.72rem;
}

.admin-security-state {
  white-space: nowrap;
}

.pager {
  display: grid;
  min-width: 0;
  align-items: center;
  grid-template-columns: minmax(88px, 1fr) auto minmax(88px, 1fr);
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

.selected-player-card {
  display: grid;
  min-width: 0;
  gap: 4px 10px;
  padding: 12px;
  grid-template-columns: auto minmax(0, 1fr);
  border-radius: 14px;
  background: var(--ice-blue);
}

.selected-player-card span {
  color: var(--muted);
  font-size: 0.72rem;
}

.selected-player-card strong {
  min-width: 0;
  color: var(--deep-blue);
  font-size: 0.84rem;
}

.ledger-row {
  display: grid;
  min-width: 0;
  gap: 10px;
  align-items: start;
  padding: 11px;
  grid-template-columns: auto minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fbfdff;
}

.ledger-delta {
  min-width: 48px;
  padding: 6px 8px;
  border-radius: 10px;
  text-align: center;
}

.ledger-delta.is-positive {
  color: var(--success);
  background: #e9faf2;
}

.ledger-delta.is-negative {
  color: var(--danger);
  background: #fff0f3;
}

.ledger-detail,
.ledger-metadata {
  margin: 0;
}

.ledger-detail {
  color: var(--ink);
  font-weight: 800;
}

.ledger-metadata {
  margin-top: 5px;
  line-height: 1.5;
}

.admin-empty {
  padding: 12px;
  text-align: center;
}

.danger-note {
  margin: 0;
  padding: 11px;
  border: 1px solid #ffd3da;
  border-radius: 13px;
  color: var(--danger);
  background: #fff2f4;
  font-size: 0.84rem;
  font-weight: 800;
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.dialog-heading h2 {
  font-size: 1.34rem;
}

.close-button {
  width: 48px;
  min-width: 48px;
  min-height: 48px;
  border-radius: 15px;
  color: var(--muted);
  background: var(--ice-blue);
  font-size: 1.45rem;
  line-height: 1;
}

.dialog-intro {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.7;
}

.dialog-card label {
  color: var(--deep-blue);
  font-size: 0.84rem;
  font-weight: 800;
}

.form-status {
  min-height: 1.5em;
  margin: 0;
  color: var(--danger);
  font-size: 0.83rem;
  line-height: 1.5;
}

.form-status.is-success {
  color: var(--success);
}

.dialog-links,
.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: center;
}

.question-box,
.code-result {
  margin: 0;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--deep-blue);
  background: var(--ice-blue);
  font-size: 0.86rem;
  line-height: 1.6;
}

.code-result strong {
  display: block;
  margin-top: 5px;
  color: var(--ocean-blue);
  font-size: 1.35rem;
  letter-spacing: 0.08em;
  overflow-wrap: anywhere;
}

.blocking-dialog .dialog-card {
  justify-items: center;
  text-align: center;
}

.ban-symbol {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 18px;
  color: #fff;
  background: var(--danger);
  font-size: 1.7rem;
  font-weight: 900;
}

.toast {
  position: fixed;
  z-index: 50;
  right: 16px;
  bottom: calc(92px + env(safe-area-inset-bottom));
  left: 16px;
  width: fit-content;
  max-width: min(calc(100% - 32px), 440px);
  margin: 0 auto;
  padding: 11px 15px;
  border-radius: 14px;
  color: #fff;
  background: var(--deep-blue);
  box-shadow: var(--shadow);
  font-size: 0.86rem;
  line-height: 1.5;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 520px) {
  .app-shell {
    padding-right: 22px;
    padding-left: 22px;
  }

  .hero {
    padding: 26px;
  }

  .hero-actions {
    flex-direction: row;
  }

  .action-button {
    min-width: 94px;
  }

  .settings-card {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .settings-card > div,
  .settings-card > .danger-button {
    grid-column: 1 / -1;
  }
}

@media (min-width: 860px) {
  .app-shell {
    padding-top: 34px;
  }

  .hero,
  .workspace-card,
  .account-card,
  .settings-card {
    border-radius: 30px;
  }

  .workspace-card {
    min-height: 580px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .thinking-dot {
    animation: none !important;
  }
}
