:root {
  --bg: #0b0b0b;
  --fg: #e8e8e8;
  --accent: #00e5ff;
  --panel: #151515;
  --line: #262626;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: 'VT323', 'Courier New', Courier, monospace;
  font-size: 30px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

header {
  padding: 0.35em 1em;
  text-align: center;
  border-bottom: 1px solid var(--line);
  flex: none;
}

.pagetitle {
  margin: 0;
  font-size: 1.5em;
  font-weight: normal;
  letter-spacing: 1px;
}

.content {
  position: relative;
  flex: 1;
  overflow: hidden;
}

/* ---------- 分页 ---------- */

.page {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2em 1.5em;
  text-align: center;
  animation: fade 0.18s ease;
}

.page[data-current="true"] { display: flex; }

@keyframes fade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.title { font-size: 1.3em; margin-bottom: 0.7em; }
.subtitle { opacity: 0.65; font-size: 0.85em; margin: -0.4em 0 0.8em; }

/* ---------- 选项 ---------- */

.options {
  display: flex;
  flex-wrap: wrap;
  gap: 1em 1.2em;
  justify-content: center;
  align-items: center;
  max-width: 900px;
}

.opt {
  display: flex;
  padding: 10px;
  background: none;
  border: 2px solid transparent;
  border-radius: 12px;
  color: var(--fg);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.opt:hover { transform: scale(1.12); }
.opt:active { transform: scale(0.92); }

.opt[data-selected="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.35);
}

.glyph {
  width: 74px;
  height: 74px;
  transform: rotate(var(--rot, 0deg));
  filter: url(#wobble);
}

.glyph path {
  fill: none;
  stroke: currentColor;
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- 底部翻页控件 ---------- */

.controls {
  flex: none;
  display: flex;
  justify-content: space-between;
  padding: 0.2em 1em;
  font-size: 2.2em;
  line-height: 1;
}

.controls button {
  background: none;
  border: none;
  color: var(--fg);
  cursor: pointer;
  font: inherit;
  transition: color 0.12s ease, opacity 0.12s ease;
}

.controls button:disabled { opacity: 0.12; cursor: default; }
.controls button:not(:disabled):hover { color: var(--accent); }

/* ---------- 结果页 ---------- */

.final .pop {
  font-size: 2.6em;
  color: var(--accent);
  margin: 0.15em 0;
  text-transform: capitalize;
}

.final .subtitle {
  max-width: 640px;
  line-height: 1.25;
  margin-bottom: 0;
}

.final canvas {
  display: none;
  margin-top: 1em;
  width: 100%;
  max-width: 500px;
  background: #fff;
  border-radius: 8px;
  image-rendering: pixelated;
}

.final canvas[data-ready="true"] { display: block; }

.final .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8em;
  justify-content: center;
  margin-top: 1.1em;
}

.final .actions button {
  font: inherit;
  font-size: 0.85em;
  color: var(--fg);
  background: var(--panel);
  border: 1px solid #333;
  border-radius: 8px;
  padding: 0.25em 0.9em;
  cursor: pointer;
  transition: color 0.12s ease, border-color 0.12s ease;
}

.final .actions button:hover { color: var(--accent); border-color: var(--accent); }
