:root {
  color-scheme: light;
  --bg: #f6efe5;
  --bg-accent: radial-gradient(circle at top right, #ffd7a8 0%, rgba(255, 215, 168, 0) 32%),
    linear-gradient(180deg, #fef9f3 0%, #f3eadf 100%);
  --card: rgba(255, 252, 247, 0.92);
  --line: rgba(117, 73, 27, 0.14);
  --text: #302112;
  --muted: #7f6a55;
  --accent: #bf5a2a;
  --accent-strong: #8e3e1a;
  --chip: #f6e2cf;
  --chip-on: #302112;
  --chip-on-bg: #ffd39a;
  --shadow: 0 18px 40px rgba(91, 53, 20, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "PingFang TC", "Noto Sans TC", sans-serif;
  background: var(--bg-accent);
  color: var(--text);
}

.app {
  width: min(920px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 20px 0 32px;
}

.hero {
  padding: 12px 4px 18px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

.hero h1 {
  margin: 0;
  font-size: clamp(28px, 7vw, 44px);
  line-height: 1.05;
}

.desc {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 16px;
  margin-top: 14px;
  backdrop-filter: blur(14px);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.panel-head h2 {
  margin: 0;
  font-size: 16px;
}

.sync-text,
.tip {
  color: var(--muted);
  font-size: 12px;
}

.filter-row input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 13px 14px;
  font-size: 16px;
  background: #fffdf9;
}

.chip-row,
.mode-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-row {
  margin-top: 12px;
}

.chip,
.mode-btn,
.ghost-btn,
.primary-btn {
  border: none;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
}

.chip,
.mode-btn,
.ghost-btn {
  background: var(--chip);
  color: var(--text);
}

.chip.active,
.mode-btn.active {
  background: var(--chip-on-bg);
  color: var(--chip-on);
  font-weight: 700;
}

.ghost-btn {
  color: var(--accent-strong);
}

.primary-btn {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.game-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.game-btn {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: #fffdf9;
  border-radius: 18px;
  padding: 14px;
  cursor: pointer;
}

.game-btn.active {
  border-color: rgba(191, 90, 42, 0.4);
  background: #fff3e5;
  box-shadow: inset 0 0 0 1px rgba(191, 90, 42, 0.14);
}

.game-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.game-id {
  font-weight: 800;
  font-size: 16px;
}

.game-meta {
  color: var(--muted);
  font-size: 12px;
}

.game-name {
  margin-top: 6px;
  font-size: 15px;
}

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

.lang-btn {
  border: 1px solid var(--line);
  background: #fffdf9;
  border-radius: 16px;
  padding: 12px;
  text-align: left;
  cursor: pointer;
}

.lang-btn.active {
  background: #fff3e5;
  border-color: rgba(191, 90, 42, 0.4);
}

.lang-code {
  font-weight: 800;
  font-size: 15px;
}

.lang-name {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.preview-panel {
  position: sticky;
  bottom: 12px;
}

.preview {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  background: #2f2114;
  color: #fff5e9;
  border-radius: 18px;
  padding: 16px;
  font-size: 16px;
  line-height: 1.6;
}

code {
  font-family: "SFMono-Regular", "Menlo", monospace;
}

@media (min-width: 760px) {
  .lang-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
