:root {
  --font-main: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --text: #f8f6ff;
  --text-dim: rgba(248, 246, 255, 0.72);
  --glass: rgba(18, 16, 28, 0.52);
  --glass-border: rgba(255, 255, 255, 0.14);
  --accent: #ff8fab;
  --accent-soft: #ffc2d4;
  --shadow: 0 18px 48px rgba(8, 6, 18, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-main);
  color: var(--text);
  background: #0e0c14;
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
  color: inherit;
  border: none;
  background: none;
  cursor: pointer;
}

ul {
  list-style: none;
}

#app-shell .screen {
  position: fixed;
  inset: 0;
}

.screen {
  position: fixed;
  inset: 0;
  z-index: 2;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.55s var(--ease-out), visibility 0.55s;
}

#screen-game {
  z-index: 3;
  background: #0a0810;
}

.screen--active {
  opacity: 1;
  visibility: visible;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(6, 5, 12, 0.62);
  backdrop-filter: blur(10px);
  animation: overlay-in 0.35s var(--ease-out);
}

.overlay[hidden] {
  display: none;
}

@keyframes overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.overlay-panel {
  width: min(520px, 100%);
  max-height: min(78vh, 640px);
  display: flex;
  flex-direction: column;
  background: linear-gradient(145deg, rgba(32, 28, 48, 0.94), rgba(22, 20, 34, 0.96));
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.overlay-header h2 {
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.12em;
}

.overlay-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--text-dim);
  transition: background 0.2s, color 0.2s;
}

.overlay-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.overlay-body {
  padding: 16px 20px 22px;
  overflow-y: auto;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 200;
  transform: translateX(-50%) translateY(12px);
  padding: 10px 18px;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  color: var(--text);
  background: rgba(24, 20, 36, 0.88);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s var(--ease-out);
}

.toast--show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.save-slots {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.save-slot {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding: 14px 16px;
  text-align: left;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  border-radius: 10px;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.save-slot:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 143, 171, 0.35);
  transform: translateX(4px);
}

.save-slot--empty {
  opacity: 0.55;
}

.save-slot--empty:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.save-slot__title {
  font-size: 0.95rem;
  font-weight: 500;
}

.save-slot__meta {
  grid-column: 1;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.save-slot__action {
  grid-row: 1 / span 2;
  align-self: center;
  font-size: 0.82rem;
  color: var(--accent-soft);
}

.options-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.options-row label {
  font-size: 0.92rem;
  color: var(--text-dim);
}

.options-row input[type="range"] {
  width: 160px;
  accent-color: var(--accent);
}

.options-row select {
  padding: 6px 10px;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--text);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
