:root {
  --bg: linear-gradient(145deg, #f9eef6, #f2f7ff);
  --card: rgba(255, 255, 255, 0.86);
  --card-muted: rgba(255, 255, 255, 0.72);
  --text: #1c1f2a;
  --muted: #5f6473;
  --accent: #f28fb8;
  --accent-strong: #ec6fa3;
  --outline: rgba(255, 255, 255, 0.65);
  --shadow: 0 20px 60px rgba(42, 31, 57, 0.08);
  --border: #e8eaf2;
  --success: #3cba92;
  --danger: #d95f82;
  --font: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

.background {
  position: fixed;
  inset: 0;
  background: radial-gradient(120% 120% at 10% 10%, rgba(242, 143, 184, 0.24), transparent),
    radial-gradient(120% 120% at 90% 0%, rgba(115, 162, 250, 0.16), transparent),
    var(--bg);
  z-index: -1;
}

.app {
  max-width: 520px;
  margin: 0 auto;
  padding: 24px 20px 40px;
}

.hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.hero__text h1 {
  margin: 4px 0 8px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

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

.hero__pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  border: 1px solid var(--outline);
  box-shadow: var(--shadow);
  color: var(--muted);
  font-size: 13px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  display: inline-block;
}

.panel {
  background: var(--card);
  border-radius: 20px;
  padding: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
  border: 1px solid var(--outline);
}

.panel + .panel {
  margin-top: 14px;
}

.panel--muted {
  background: var(--card-muted);
}

.panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.panel__label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.02em;
}

.mode-toggle {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  background: rgba(242, 143, 184, 0.08);
  padding: 6px;
  border-radius: 14px;
}

.mode-toggle__btn {
  border: none;
  background: transparent;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s ease;
}

.mode-toggle__btn.is-active {
  background: linear-gradient(135deg, #fbd7e8, #f2e8ff);
  color: var(--text);
  box-shadow: 0 12px 25px rgba(242, 143, 184, 0.22);
}

.status {
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--outline);
  font-weight: 600;
  color: var(--accent-strong);
  box-shadow: var(--shadow);
}

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

.cell {
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), var(--shadow);
  font-size: 30px;
  font-weight: 700;
  color: var(--text);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.cell:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.06);
}

.cell:active:not(:disabled) {
  transform: translateY(0);
}

.cell:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.cell--x {
  color: var(--accent-strong);
}

.cell--o {
  color: #7a8fd8;
}

.actions {
  margin-top: 16px;
  text-align: center;
}

.actions--inline {
  display: flex;
  gap: 10px;
  justify-content: center;
}

button.primary,
button.ghost {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 14px 16px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

button.primary {
  background: linear-gradient(135deg, #f28fb8, #f6b5d5);
  color: #1f1a2a;
  box-shadow: 0 12px 32px rgba(242, 143, 184, 0.3);
}

button.primary:hover {
  transform: translateY(-1px);
}

button.ghost {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border);
  color: var(--text);
}

.notice {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 16px;
  color: var(--text);
}

.notice__title {
  font-weight: 700;
  margin-bottom: 6px;
}

.notice__text {
  margin: 0;
  color: var(--muted);
}

.result {
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 10px;
  color: var(--text);
}

.promo {
  background: linear-gradient(135deg, #f7ecff, #f9f4ff);
  border-radius: 16px;
  padding: 14px;
  border: 1px dashed rgba(242, 143, 184, 0.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  text-align: center;
}

.promo__label {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.promo__code {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--accent-strong);
}

.promo__hint {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

@media (max-width: 480px) {
  .hero {
    flex-direction: column;
  }

  .panel__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .status {
    width: 100%;
    text-align: center;
  }
}
