:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --surface2: #243044;
  --border: #2d3a4f;
  --text: #e8eef7;
  --muted: #8b9bb4;
  --accent: #5b9fd4;
  --accent2: #7dd3a0;
  --warn: #e8b86d;
  --danger: #e07a7a;
  --radius: 12px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

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

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

header.site {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

header.site h1 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

header.site .tag {
  color: var(--muted);
  font-size: 0.95rem;
}

.nav-home {
  margin-left: auto;
  font-size: 0.9rem;
}

.cards {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: border-color 0.15s, transform 0.15s;
}

.card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.card h2 { font-size: 1.2rem; }
.card .mech {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent2);
  font-weight: 600;
}
.card p { color: var(--muted); font-size: 0.95rem; flex: 1; }
.card .play {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.55rem 1rem;
  background: var(--accent);
  color: #0a1220;
  font-weight: 650;
  border-radius: 8px;
  text-decoration: none;
  text-align: center;
}
.card .play:hover { filter: brightness(1.08); text-decoration: none; }

.game-shell {
  max-width: 640px;
  margin: 0 auto;
  padding: 1.25rem 1rem 2.5rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
}

.toolbar .level-label {
  font-weight: 600;
  margin-right: 0.25rem;
}

button, .btn {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  touch-action: manipulation;
  user-select: none;
}

button:hover, .btn:hover { border-color: var(--accent); }
button:active { transform: scale(0.98); }
button.primary {
  background: var(--accent);
  color: #0a1220;
  border-color: transparent;
  font-weight: 650;
}
button:disabled { opacity: 0.45; cursor: not-allowed; }

.status {
  min-height: 1.5rem;
  margin: 0.75rem 0 1rem;
  font-size: 0.95rem;
  color: var(--muted);
}
.status.win {
  color: var(--accent2);
  font-weight: 650;
  font-size: 1.05rem;
}

.hint {
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 1rem;
}

.board-wrap {
  display: flex;
  justify-content: center;
  touch-action: manipulation;
}

footer.note {
  margin-top: 2rem;
  color: var(--muted);
  font-size: 0.85rem;
}


/* --- Shared: ads, daily, achievements --- */
.opp-ad-banner {
  margin: 1rem 0 0;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.opp-ad-mock, .opp-ad-live {
  width: 100%;
  max-width: 320px;
  min-height: 50px;
  border: 1px dashed var(--border);
  background: #152030;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
  padding: 0.55rem;
  border-radius: 8px;
  line-height: 1.35;
}
.opp-ad-interstitial {
  position: fixed; inset: 0; background: rgba(0,0,0,0.72);
  display: flex; align-items: center; justify-content: center;
  z-index: 10000; padding: 1rem;
}
.opp-ad-interstitial__card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 1.25rem; width: min(360px, 100%);
  text-align: center; display: flex; flex-direction: column; gap: 0.75rem;
}
.opp-ad-interstitial__note { color: var(--muted); font-size: 0.88rem; }

.opp-daily {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.9rem 1rem; margin: 1rem 0;
}
.opp-daily__head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 0.45rem; gap: 0.5rem;
}
.opp-daily__streak { color: var(--warn); font-size: 0.85rem; font-weight: 600; }
.opp-daily__list { list-style: none; color: var(--muted); font-size: 0.92rem; }
.opp-daily__list li { padding: 0.2rem 0; }
.opp-daily__list li.done { color: var(--accent2); }

.home-actions {
  display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0 0 1.25rem;
}
.home-actions a.btn, .home-actions .btn {
  text-decoration: none; display: inline-block;
}
.ach-list { list-style: none; display: grid; gap: 0.65rem; }
.ach-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 0.85rem 1rem;
}
.ach-item.unlocked { border-color: var(--accent2); }
.ach-item h3 { font-size: 1rem; margin-bottom: 0.2rem; }
.ach-item p { color: var(--muted); font-size: 0.88rem; }
.ach-item .meta { font-size: 0.75rem; color: var(--accent2); margin-top: 0.35rem; }

.site-footer-links {
  margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--border);
  color: var(--muted); font-size: 0.88rem;
  display: flex; flex-wrap: wrap; gap: 0.5rem 1rem;
}
