﻿:root {
  --bg: #f3efe7;
  --ink: #1a1d1a;
  --muted: #5c5a54;
  --accent: #0f3b2f;
  --accent-soft: #d1e2d2;
  --card: #ffffff;
  --shadow: rgba(14, 18, 16, 0.12);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", system-ui, sans-serif;
  background:
    radial-gradient(circle at 20% 20%, #f6f1e8 0%, #f3efe7 45%, #e6e2d6 100%);
  color: var(--ink);
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 48px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 32px;
  align-items: stretch;
}

.hero__brand h1 {
  font-family: "Fraunces", serif;
  font-size: clamp(2.2rem, 3vw, 3.1rem);
  margin: 16px 0 12px;
}

.hero__brand p {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.hero__actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

button,\na.primary,\na.ghost {
  border: none;
  padding: 12px 18px;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

button:hover,\na.primary:hover,\na.ghost:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px var(--shadow);
}

button.primary,\na.primary {
  background: var(--accent);
  color: #fff;
}

button.ghost,\na.ghost {
  background: #fff;
  color: var(--accent);
  border: 1px solid rgba(15, 59, 47, 0.18);
}

.hero__meta {
  display: flex;
  gap: 18px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.hero__panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ad-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  border: 1px dashed rgba(15, 59, 47, 0.3);
  box-shadow: 0 12px 24px var(--shadow);
}

.ad-card--slim {
  padding: 14px;
}

.ad-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
}

.ad-copy {
  color: var(--muted);
  font-size: 0.95rem;
}

.tips {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 12px 24px var(--shadow);
}

.tips h3 {
  margin-top: 0;
}

.tips ul {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

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

.mode-switch {
  display: inline-flex;
  background: var(--card);
  border-radius: 999px;
  padding: 6px;
  gap: 6px;
  box-shadow: 0 8px 20px var(--shadow);
}

.tab {
  background: transparent;
  color: var(--muted);
}

.tab.active {
  background: var(--accent);
  color: #fff;
}

.game {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 0.8fr);
  gap: 24px;
}

.panel {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 20px 40px var(--shadow);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

.panel__header h2 {
  margin: 0;
  font-family: "Fraunces", serif;
}

.panel__stats {
  display: flex;
  gap: 16px;
  color: var(--muted);
}

.panel__body {
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.panel__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--muted);
}

.control-group select {
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(15, 59, 47, 0.2);
  background: #fff;
  font-family: inherit;
}

.best {
  margin-left: auto;
  display: flex;
  gap: 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

.board {
  display: grid;
  gap: 8px;
}

.board--logic {
  grid-template-columns: repeat(6, 1fr);
}

.tile {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: #f7f4ee;
  border: 1px solid rgba(15, 59, 47, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
  user-select: none;
  touch-action: manipulation;
}

.tile.revealed {
  background: var(--accent-soft);
  cursor: default;
}

.tile.flagged {
  background: #f3d7d7;
  color: #7a1c1c;
}

.board--matching {
  grid-template-columns: repeat(4, 1fr);
}

.board--lights {
  grid-template-columns: repeat(5, 1fr);
}

.board--order {
  grid-template-columns: repeat(4, 1fr);
}

.board--sum {
  grid-template-columns: repeat(5, 1fr);
}

.board--sequence {
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.card {
  width: 88px;
  height: 116px;
  border-radius: 16px;
  background: linear-gradient(145deg, #f5f1ea, #e5decf);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid rgba(15, 59, 47, 0.1);
  cursor: pointer;
  transition: transform 0.15s ease;
  touch-action: manipulation;
}

.card.flipped {
  background: #fff;
  box-shadow: inset 0 0 0 2px rgba(15, 59, 47, 0.2);
}

.card.matched {
  background: var(--accent-soft);
  cursor: default;
}

.tile.light {
  background: #f0ede5;
}

.tile.light.on {
  background: #ffd66d;
  box-shadow: inset 0 0 0 2px rgba(15, 59, 47, 0.2);
}

.tile.order {
  font-size: 1.2rem;
}

.tile.sum {
  background: #f6f1ea;
  font-size: 1.05rem;
}

.tile.sum.selected {
  background: var(--accent-soft);
}

.sequence-pad {
  width: 140px;
  height: 140px;
  border-radius: 20px;
  border: 2px solid rgba(15, 59, 47, 0.15);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.sequence-pad:active {
  transform: scale(0.98);
}

.sequence-pad.pad-0 {
  background: #f06a6a;
}

.sequence-pad.pad-1 {
  background: #f6b55f;
}

.sequence-pad.pad-2 {
  background: #6bbf8a;
}

.sequence-pad.pad-3 {
  background: #6f91f0;
}

.sequence-pad.active {
  box-shadow: 0 0 0 4px rgba(15, 59, 47, 0.2);
}

.panel__footer {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status {
  margin-left: auto;
  color: var(--muted);
}

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

.sidebar__section {
  background: var(--card);
  padding: 18px;
  border-radius: var(--radius);
  box-shadow: 0 12px 24px var(--shadow);
}

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

.content div {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 12px 24px var(--shadow);
}

.footer {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}

.hidden {
  display: none;
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .game {
    grid-template-columns: 1fr;
  }

  .board--logic {
    grid-template-columns: repeat(6, 50px);
  }

  .tile {
    width: 50px;
    height: 50px;
  }

  .sequence-pad {
    width: 120px;
    height: 120px;
  }

  .best {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 700px) {
  .content {
    grid-template-columns: 1fr;
  }

  .board--matching {
    grid-template-columns: repeat(3, 1fr);
  }

  .card {
    width: 80px;
    height: 104px;
  }

  .footer {
    flex-direction: column;
    gap: 6px;
  }
}


a.primary,
a.ghost {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
