:root {
  --bg: #1a1a1e;
  --surface: #25252b;
  --text: #e8e6e3;
  --muted: #9a9690;
  --accent: #c9a227;
  --danger: #c44;
  --btn-h: 44px;
  --sub-btn-h: 40px;
  --header-h: 2.75rem;
}

html {
  font-size: 18px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  font-family: system-ui, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

#app {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  height: 100dvh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0.75rem;
  padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
}

.app-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 2.1rem;
  margin-bottom: 0.25rem;
  padding: 0 0.1rem;
}

.header-left {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.app-header h1 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.account-badge {
  flex-shrink: 1;
  font-size: 0.65rem;
  padding: 0.2rem 0.4rem;
  border-radius: 999px;
  border: 1px solid var(--muted);
  color: var(--muted);
  white-space: nowrap;
  max-width: 4.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.account-badge:hover {
  color: var(--fg, #eee);
  border-color: currentColor;
}

.session-id {
  margin-left: 0.4rem;
  font-size: 0.6rem;
  color: var(--muted);
  white-space: nowrap;
  opacity: 0.7;
  user-select: all;
}

.session-id:hover {
  opacity: 1;
}

.header-world-select {
  flex: 0 1 5.5rem;
  min-width: 0;
  max-width: 6.5rem;
  text-overflow: ellipsis;
}

.header-btn {
  flex-shrink: 0;
  font-size: 0.75rem;
  padding: 0.35rem 0.55rem;
  min-height: 2rem;
  border-radius: 6px;
  border: 1px solid var(--muted);
  background: var(--surface);
  color: var(--muted);
}

.header-icon-btn {
  padding: 0.3rem 0.45rem;
  min-width: 2rem;
  font-size: 0.95rem;
  line-height: 1;
  text-align: center;
}

.header-btn-danger {
  border-color: #8b3a3a;
  color: #c96;
}

/* Minimal play-mode header menu */
.header-menu {
  position: relative;
}

.header-menu-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 9rem;
  background: var(--surface);
  border: 1px solid var(--muted);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
  z-index: 100;
  padding: 0.25rem 0;
}

.menu-item {
  display: block;
  width: 100%;
  padding: 0.45rem 0.85rem;
  font-size: 0.9rem;
  color: var(--text);
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
}

.menu-item:hover {
  background: #33333a;
}

.menu-item-danger {
  color: #c96;
}

.menu-divider {
  height: 1px;
  background: var(--muted);
  margin: 0.25rem 0.5rem;
  opacity: 0.4;
}

.menu-select {
  width: 100%;
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
  border: none;
  background: transparent;
  color: var(--muted);
}

.hidden { display: none !important; }

#error-banner,
#loading-banner {
  flex-shrink: 0;
}

#app-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* 2/3 — scrollable story */
#narrative-pane {
  flex: 2 1 0;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.35rem;
}

#narrative-block {
  min-height: 100%;
}

#narrative {
  white-space: pre-wrap;
  background: var(--surface);
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 0.95rem;
}

.narrative-player-action {
  color: var(--accent);
  font-size: 0.88rem;
  margin-bottom: 0.35rem;
  line-height: 1.4;
}

.narrative-beat-body {
  line-height: 1.55;
}

.narrative-beat-gap {
  height: 0.85rem;
}

#narrative-hud {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.35rem;
  padding: 0 0.15rem;
}

.narrative-graph-feed {
  margin-top: 0.45rem;
  padding: 0.45rem 0.55rem;
  border-left: 2px solid var(--accent);
  background: rgba(120, 180, 255, 0.06);
  border-radius: 0 6px 6px 0;
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", monospace;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #9ec8ff;
}

.graph-feed-line {
  white-space: pre-wrap;
}

.graph-feed-line + .graph-feed-line {
  margin-top: 0.18rem;
}

.graph-feed-summary {
  color: #c5d4e8;
  font-weight: 600;
  margin-bottom: 0.15rem;
  padding-bottom: 0.2rem;
  border-bottom: 1px solid rgba(158, 200, 255, 0.22);
}

.graph-feed-add {
  color: #7ddea0;
}

.graph-feed-upd {
  color: #9ec8ff;
}

.graph-feed-rm {
  color: #f0a0a0;
}

.graph-feed-delta {
  color: #e6c07b;
}

#narrative-options {
  margin-top: 0.5rem;
  background: var(--surface);
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  font-size: 0.92rem;
}

.choice-read-item {
  margin-bottom: 0.55rem;
  white-space: pre-wrap;
  line-height: 1.45;
}

.choice-read-item:last-child {
  margin-bottom: 0;
}

.choice-num {
  color: var(--accent);
  font-weight: 600;
  margin-right: 0.2rem;
}

/* 1/3 — fixed system chrome */
#system-pane {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  border-top: 1px solid #3a3a42;
  padding-top: 0.45rem;
  background: var(--bg);
}

#setup-actions {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

#tab-bar {
  flex-shrink: 0;
  display: flex;
  gap: 0.25rem;
}

#tab-bar button {
  flex: 1;
  min-height: var(--sub-btn-h);
}

#tab-bar button[aria-pressed="true"] {
  border-color: var(--accent);
  background: #33302a;
}

/* Foreground sheets (物品／技能／產業 — separate overlays) */
.sheet-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  pointer-events: none;
}

.sheet-overlay:not(.hidden) {
  pointer-events: auto;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  cursor: pointer;
}

.sheet-window {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  max-height: 82vh;
  background: var(--bg);
  border-radius: 12px 12px 0 0;
  border-top: 1px solid #444;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.45);
}

.sheet-window-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid #3a3a42;
}

.sheet-window-header h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.sheet-close-btn {
  flex-shrink: 0;
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 0.25rem;
  font-size: 1rem;
  line-height: 1;
  color: var(--muted);
}

.sheet-window-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.5rem 0.75rem 0.85rem;
}

.panel {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 0.35rem;
}

.sub-actions {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px solid #333;
}

button {
  background: var(--surface);
  color: var(--text);
  border: 1px solid #444;
  border-radius: 6px;
  padding: 0.45rem 0.65rem;
  font-size: 0.88rem;
  cursor: pointer;
  touch-action: manipulation;
}

button.selected {
  border-color: var(--accent);
  background: #33302a;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.choice-num-btn {
  flex: 1 1 2.75rem;
  min-width: 2.5rem;
  max-width: 3.25rem;
  min-height: var(--btn-h);
  padding: 0.35rem;
  font-weight: 700;
  font-size: 1.05rem;
  text-align: center;
}

.choice-start-btn {
  flex: 1 1 100%;
  min-height: var(--btn-h);
  padding: 0.55rem 1rem;
  font-weight: 600;
  font-size: 1rem;
}

#panel-choices {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
}

#panel-text {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

#input-text {
  width: 100%;
  background: var(--surface);
  color: var(--text);
  border: 1px solid #444;
  border-radius: 6px;
  padding: 0.45rem;
  font-size: 0.95rem;
  resize: none;
  min-height: 2.5rem;
  max-height: 4.5rem;
}

#btn-submit {
  width: 100%;
  min-height: var(--sub-btn-h);
  background: #2a3a2a;
}

.item-btn, .skill-btn, .prod-btn {
  min-height: var(--sub-btn-h);
}

.prod-sub {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
}

#error-banner {
  background: #3a1a1a;
  border: 1px solid var(--danger);
  padding: 0.5rem;
  border-radius: 6px;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.test-env-banner {
  flex-shrink: 0;
  background: #2c2612;
  border: 1px solid #7a651f;
  color: #d9b95c;
  padding: 0.2rem 0.15rem 0.2rem 0.55rem;
  border-radius: 5px;
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  font-size: 0.68rem;
  line-height: 1.2;
  white-space: nowrap;
}

.test-env-banner span {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.test-env-banner button {
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: inherit;
  opacity: 0.7;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
}

.test-env-banner button:hover {
  opacity: 1;
}

.test-env-banner.hidden {
  display: none;
}

#loading-banner {
  padding: 0.55rem 0.75rem 0.65rem;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--bg) 88%, var(--accent) 12%),
    color-mix(in srgb, var(--bg) 96%, var(--accent) 4%)
  );
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
}

.beat-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.beat-progress-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
}

.beat-progress-meta-right {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex: 0 0 auto;
}

.beat-progress-elapsed {
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  white-space: nowrap;
}

#loading-text {
  font-size: 0.82rem;
  color: var(--accent);
  letter-spacing: 0.03em;
  text-align: left;
  flex: 1;
}

.beat-progress-pct {
  flex: 0 0 auto;
  min-width: 2.25rem;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  color: color-mix(in srgb, var(--accent) 75%, var(--text));
  text-align: right;
}

.beat-progress {
  width: 100%;
}

.beat-progress-track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 55%, var(--bg));
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.beat-progress-track::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent,
    transparent calc(25% - 1px),
    color-mix(in srgb, var(--accent) 8%, transparent) calc(25% - 1px),
    color-mix(in srgb, var(--accent) 8%, transparent) 25%
  );
  pointer-events: none;
  opacity: 0.55;
}

.beat-progress-track.is-active .beat-progress-shine {
  display: block;
}

.beat-progress-track.is-complete .beat-progress-fill {
  box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 55%, transparent);
}

.beat-progress-track.indeterminate .beat-progress-fill {
  width: 42% !important;
  animation: beat-progress-indeterminate 1.35s ease-in-out infinite;
}

@keyframes beat-progress-indeterminate {
  0% { transform: translateX(-130%); }
  100% { transform: translateX(320%); }
}

.beat-progress-fill {
  position: relative;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--accent) 55%, #6b5010),
    var(--accent) 42%,
    color-mix(in srgb, var(--accent) 88%, #fff 12%)
  );
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 35%, transparent);
}

.beat-progress-shine {
  display: none;
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 38%,
    rgba(255, 255, 255, 0.28) 50%,
    transparent 62%
  );
  animation: beat-progress-shine 2.4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes beat-progress-shine {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(220%); }
}

.beat-phase-rail {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-top: 0.55rem;
  padding: 0 0.1rem;
  position: relative;
}

.beat-phase-rail::before {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  top: 0.42rem;
  height: 2px;
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  z-index: 0;
}

.beat-phase-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.28rem;
  flex: 1;
  z-index: 1;
  min-width: 0;
}

.beat-phase-dot {
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--accent) 32%, transparent);
  background: var(--bg);
  transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.beat-phase-label {
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.25s ease;
}

.beat-phase-node.done .beat-phase-dot {
  background: var(--accent);
  border-color: var(--accent);
}

.beat-phase-node.done .beat-phase-label {
  color: color-mix(in srgb, var(--accent) 72%, var(--text));
}

.beat-phase-node.active .beat-phase-dot {
  background: color-mix(in srgb, var(--accent) 28%, var(--bg));
  border-color: var(--accent);
  box-shadow: 0 0 9px color-mix(in srgb, var(--accent) 48%, transparent);
  transform: scale(1.18);
}

.beat-phase-node.active .beat-phase-label {
  color: var(--accent);
  font-weight: 600;
}

.empty-hint {
  color: var(--muted);
  font-size: 0.85rem;
  padding: 0.5rem;
}

.sheet-section-title {
  width: 100%;
  flex-basis: 100%;
  margin: 0.25rem 0 0.1rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.05em;
}

.industry-card {
  width: 100%;
  flex-basis: 100%;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-height: auto;
  padding: 0.5rem 0.6rem;
}

.industry-title {
  font-weight: 600;
  font-size: 0.92rem;
}

#narrative-party {
  background: linear-gradient(165deg, #2a2924 0%, var(--surface) 42%, #1f1f24 100%);
  padding: 0.85rem 0.8rem 1rem;
  border-radius: 10px;
  border: 1px solid #3a3830;
  font-size: 0.95rem;
  animation: party-panel-in 0.28s ease-out;
}

@keyframes party-panel-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.narrative-party-title {
  margin: 0 0 0.65rem;
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.party-ui-note {
  width: 100%;
  flex-basis: 100%;
  margin: 0 0 0.65rem;
  padding: 0.5rem 0.6rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #d4c48a;
  background: rgba(201, 162, 39, 0.08);
  border-left: 2px solid var(--accent);
  border-radius: 0 6px 6px 0;
  white-space: pre-wrap;
}

.party-member-picker {
  width: 100%;
  flex-basis: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.7rem;
}

.party-member-btn {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.2rem;
  width: 100%;
  min-height: auto;
  padding: 0.55rem 0.7rem;
  text-align: left;
  background: #1c1c20;
  border: 1px solid #3a3a42;
  border-radius: 8px;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.party-member-btn.selected {
  border-color: var(--accent);
  background: #2e2b22;
  transform: translateX(2px);
}

.party-member-btn-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.party-member-btn-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.party-member-btn-cue {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.party-member-btn-cue--idle {
  opacity: 0.65;
}

.party-role-badge {
  flex-shrink: 0;
  padding: 0.1rem 0.4rem;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: #1a1a1e;
  background: var(--accent);
  border-radius: 3px;
  font-weight: 600;
}

.party-role-badge--sm {
  font-size: 0.65rem;
  padding: 0.08rem 0.35rem;
}

.party-member-detail-host {
  width: 100%;
  flex-basis: 100%;
}

.party-member-detail {
  width: 100%;
  padding-top: 0.15rem;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.party-member-detail--in {
  opacity: 1;
  transform: translateY(0);
}

.party-member-hero {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.55rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid #3a3830;
}

.party-member-name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
  color: var(--text);
}

.party-task-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0 0 0.55rem;
}

.party-task {
  padding: 0.45rem 0.55rem;
  background: #1c1c20;
  border-radius: 6px;
  border: 1px solid #333338;
}

.party-task-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.party-task-goal {
  font-size: 0.9rem;
  font-weight: 550;
}

.party-task-progress {
  margin: 0.25rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}

.party-status {
  flex-shrink: 0;
  padding: 0.08rem 0.35rem;
  font-size: 0.65rem;
  letter-spacing: 0.03em;
  border-radius: 3px;
  font-weight: 600;
  background: #3a3a42;
  color: var(--text);
}

.party-status--running {
  background: rgba(201, 162, 39, 0.22);
  color: #e6c96a;
}

.party-status--blocked {
  background: rgba(196, 68, 68, 0.2);
  color: #e08888;
}

.party-status--done {
  background: rgba(90, 140, 90, 0.25);
  color: #9bc49b;
}

.party-status--expired {
  background: rgba(120, 120, 130, 0.35);
  color: #b0b0b8;
}

.party-attr-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem 0.55rem;
  margin: 0 0 0.55rem;
}

.party-attr {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
  padding: 0.3rem 0.4rem;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 5px;
}

.party-attr-label {
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.03em;
}

.party-attr-value {
  font-size: 0.88rem;
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.party-bullet-list {
  margin: 0 0 0.55rem;
  padding-left: 1.1rem;
  font-size: 0.88rem;
}

.party-bullet-list li {
  margin: 0.15rem 0;
}

.party-actions {
  margin-top: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.party-actions button,
.party-action-btn {
  width: 100%;
  min-height: var(--sub-btn-h);
  text-align: left;
}

.party-line {
  margin: 0.15rem 0 0.35rem;
  font-size: 0.9rem;
  padding-left: 0.15rem;
}

.party-rel-dim {
  margin: 0.1rem 0;
  font-size: 0.85rem;
  color: var(--text);
}

.party-rel-negative {
  color: #c45c5c;
}

.party-rel-hint {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  color: var(--muted, #8a8578);
}

.party-rel-note {
  margin: 0.2rem 0 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(10, 10, 12, 0.92);
}

.auth-overlay.hidden {
  display: none;
}

.auth-card {
  width: min(100%, 22rem);
  padding: 1.5rem 1.25rem;
  border-radius: 12px;
  background: var(--surface);
  text-align: center;
}

.auth-card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
}

.auth-card p {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

#google-signin-btn {
  display: flex;
  justify-content: center;
  min-height: 44px;
}

.auth-error {
  margin: 0.75rem 0 0;
  color: var(--danger);
  font-size: 0.88rem;
}

.auth-error.hidden {
  display: none;
}

.world-dir-section {
  margin-bottom: 1rem;
}

.world-dir-section h3 {
  margin: 0 0 0.45rem;
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 600;
}

.world-dir-seed {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem;
  margin-bottom: 0.35rem;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.world-dir-seed-title {
  font-size: 0.92rem;
}

.world-dir-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.55rem;
  margin-bottom: 0.25rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.world-dir-row.active {
  border: 1px solid var(--accent, #6a8);
}

.world-dir-row-main {
  flex: 1;
  min-width: 0;
  text-align: left;
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  padding: 0.15rem 0;
}

.world-dir-row-title {
  font-size: 0.9rem;
}

.world-dir-row-meta {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.1rem;
}

.world-dir-row-actions {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}

.world-dir-row-actions button {
  font-size: 0.72rem;
  padding: 0.25rem 0.45rem;
  min-height: 1.75rem;
}

.world-pick-dimmed {
  visibility: hidden;
  pointer-events: none;
}

body.world-pick-active #world-dir-backdrop {
  display: none;
}

body.world-pick-active #world-dir-overlay .sheet-window {
  max-height: min(88vh, 680px);
  border-radius: 12px;
  margin: auto 0.5rem max(0.5rem, env(safe-area-inset-bottom));
}

body.world-pick-active #world-dir-overlay:not(.hidden) {
  justify-content: center;
}
