:root {
  --ink: #17241e;
  --muted: #667168;
  --cream: #f4f1e8;
  --paper: #fbfaf5;
  --green: #1f5a42;
  --lime: #d5f067;
  --coral: #f46f55;
  --line: rgba(23, 36, 30, .14);
  --cell: 34px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: Manrope, sans-serif;
  min-height: 100vh;
}
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
.noise {
  position: fixed; inset: 0; pointer-events: none; z-index: 10; opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}
.site-header {
  height: 76px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(22px, 5vw, 72px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; gap: 11px; align-items: center; color: inherit; text-decoration: none; font-weight: 800; letter-spacing: -.03em; }
.brand-mark { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 50%; background: var(--green); color: var(--lime); }
.sound-toggle { border: 0; background: transparent; color: var(--muted); cursor: pointer; display: flex; gap: 8px; align-items: center; font-size: 13px; }
main { overflow: hidden; }
.hero {
  min-height: calc(100vh - 76px); max-width: 1400px; margin: 0 auto; padding: 70px clamp(24px, 7vw, 105px);
  display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 7vw;
}
.eyebrow { text-transform: uppercase; letter-spacing: .18em; font-size: 11px; font-weight: 800; color: var(--green); margin: 0 0 20px; }
h1 { font-size: clamp(52px, 6vw, 92px); line-height: .96; letter-spacing: -.065em; margin: 0; font-weight: 700; }
h1 em { font-family: Georgia, serif; font-weight: 400; color: var(--green); }
.intro { max-width: 540px; margin: 28px 0 32px; line-height: 1.7; color: var(--muted); font-size: 17px; }
.start-button {
  border: 0; border-radius: 3px; background: var(--ink); color: white; padding: 17px 19px 17px 25px;
  display: inline-flex; align-items: center; gap: 34px; cursor: pointer; font-weight: 700; box-shadow: 6px 6px 0 var(--lime);
  transition: transform .2s, box-shadow .2s;
}
.start-button:hover { transform: translate(2px, 2px); box-shadow: 4px 4px 0 var(--lime); }
.button-arrow { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--lime); color: var(--ink); }
.tiny-note { font-size: 11px; color: #8b938d; margin-top: 25px; display: flex; gap: 8px; align-items: center; }
.tiny-note span { color: var(--coral); font-size: 8px; }
.hero-art { position: relative; aspect-ratio: 1; max-width: 530px; justify-self: end; width: 100%; display: grid; place-items: center; }
.sun { position: absolute; width: 80%; height: 80%; border-radius: 50%; background: var(--lime); opacity: .72; }
.art-grid { width: 68%; display: grid; grid-template-columns: repeat(6, 1fr); transform: rotate(-7deg); box-shadow: 24px 25px 0 rgba(31,90,66,.12); z-index: 1; }
.art-cell { aspect-ratio: 1; display: grid; place-items: center; background: var(--paper); border: 1px solid #b8bcae; font: 700 clamp(12px, 2vw, 24px) DM Mono, monospace; color: var(--green); }
.art-cell.cover { background: var(--green); border-color: rgba(255,255,255,.13); }
.art-cell.mine { background: var(--coral); color: white; }
.float-card { position: absolute; z-index: 2; background: var(--paper); padding: 14px 18px; border: 1px solid var(--line); box-shadow: 8px 8px 0 rgba(23,36,30,.08); display: flex; flex-direction: column; }
.float-card strong { font: 500 24px DM Mono, monospace; }
.float-card span { font-size: 10px; color: var(--muted); }
.card-one { left: 0; top: 19%; transform: rotate(-4deg); }
.card-two { right: -2%; bottom: 16%; transform: rotate(5deg); }
.game-section { background: var(--green); color: white; padding: 90px clamp(20px, 7vw, 100px); min-height: 100vh; }
.game-section > * { max-width: 1120px; margin-left: auto; margin-right: auto; }
.game-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 30px; }
.game-section .eyebrow { color: var(--lime); }
.game-heading h2 { margin: 0; font-size: clamp(30px, 4vw, 48px); letter-spacing: -.045em; }
.game-hint { color: rgba(255,255,255,.6); font-size: 12px; margin: 0 0 5px; }
.mobile-hint { display: none; }
.difficulty-tabs { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid rgba(255,255,255,.2); margin-bottom: 18px; }
.difficulty { border: 0; border-right: 1px solid rgba(255,255,255,.2); color: rgba(255,255,255,.58); background: transparent; padding: 17px 20px; cursor: pointer; text-align: left; }
.difficulty:last-child { border-right: 0; }
.difficulty span { display: block; font-weight: 700; }
.difficulty small { display: block; margin-top: 3px; font: 10px DM Mono, monospace; }
.difficulty.active { background: var(--lime); color: var(--ink); }
.game-shell { background: var(--paper); color: var(--ink); border-radius: 3px; padding: clamp(13px, 2vw, 25px); box-shadow: 14px 14px 0 rgba(0,0,0,.15); }
.scorebar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 4px 17px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.metric { display: flex; flex-direction: column; }
.metric-label { color: var(--muted); text-transform: uppercase; letter-spacing: .14em; font-size: 9px; font-weight: 800; }
.metric strong { font: 500 25px DM Mono, monospace; margin-top: 2px; }
.align-right { align-items: end; }
.restart-button { width: 44px; height: 44px; border: 1px solid var(--line); background: var(--cream); border-radius: 50%; cursor: pointer; font-size: 20px; transition: transform .15s; }
.restart-button:active { transform: scale(.9); }
.board-wrap { position: relative; overflow: auto; overscroll-behavior: contain; border: 1px solid #aeb6ad; background: #cad0c7; }
.board { display: grid; width: max-content; min-width: 100%; justify-content: center; touch-action: manipulation; user-select: none; }
.cell {
  width: var(--cell); height: var(--cell); border: 0; border-right: 1px solid rgba(255,255,255,.17); border-bottom: 1px solid rgba(255,255,255,.17);
  background: #7b9989; color: var(--ink); padding: 0; cursor: pointer; display: grid; place-items: center;
  font: 700 calc(var(--cell) * .48) DM Mono, monospace; position: relative;
}
.cell:hover:not(.revealed) { background: #91aa9c; }
.cell.revealed { background: #e5e5dc; cursor: default; animation: reveal .18s ease-out both; }
.cell.flagged::after { content: "⚑"; color: var(--lime); font-size: calc(var(--cell) * .53); filter: drop-shadow(1px 1px 0 rgba(0,0,0,.25)); }
.cell.mine.revealed { background: var(--coral); }
.cell.mine.revealed::after { content: "✹"; color: var(--ink); }
.cell.exploded { animation: boom .36s ease-out both; z-index: 2; }
.cell.wrong::after { content: "×"; color: var(--coral); font-size: calc(var(--cell) * .7); }
.cell[data-value="1"] { color: #1768a6; }.cell[data-value="2"] { color: #28834f; }.cell[data-value="3"] { color: #d34c3e; }
.cell[data-value="4"] { color: #574493; }.cell[data-value="5"] { color: #8e392f; }.cell[data-value="6"] { color: #14878b; }
@keyframes reveal { from { transform: scale(.82); opacity: .4; } to { transform: scale(1); opacity: 1; } }
@keyframes boom { 50% { transform: scale(1.35) rotate(8deg); } }
.result-overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(23,36,30,.78); backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity .25s; padding: 20px; }
.result-overlay.show { opacity: 1; pointer-events: auto; }
.result-card { background: var(--paper); padding: 32px; text-align: center; width: min(350px, 100%); color: var(--ink); box-shadow: 9px 9px 0 var(--lime); transform: translateY(15px); transition: transform .3s; }
.result-overlay.show .result-card { transform: translateY(0); }
.result-icon { font-size: 35px; display: block; margin-bottom: 14px; }
.result-card .eyebrow { margin-bottom: 9px; color: var(--green); }
.result-card h3 { margin: 0; font-size: 28px; letter-spacing: -.04em; }
.result-card p:not(.eyebrow) { color: var(--muted); font-size: 13px; }
.result-card button { border: 0; background: var(--ink); color: white; padding: 12px 17px; cursor: pointer; font-weight: 700; margin-top: 8px; }
.result-card button span { color: var(--lime); margin-left: 10px; }
.records { margin-top: 28px; border-top: 1px solid rgba(255,255,255,.2); border-bottom: 1px solid rgba(255,255,255,.2); padding: 25px 0; display: grid; grid-template-columns: 1.2fr 2fr; align-items: center; gap: 30px; }
.records-title { display: flex; align-items: center; gap: 17px; }
.record-mark { width: 48px; height: 48px; border: 1px solid rgba(255,255,255,.25); border-radius: 50%; display: grid; place-items: center; color: var(--lime); font-size: 24px; }
.records .eyebrow { margin-bottom: 3px; font-size: 9px; }
.records h3 { margin: 0; font-size: 18px; }
.record-list { display: grid; grid-template-columns: repeat(3, 1fr); }
.record-list div { padding: 0 24px; border-left: 1px solid rgba(255,255,255,.18); display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.record-list span { font-size: 11px; color: rgba(255,255,255,.57); }
.record-list strong { font: 500 17px DM Mono, monospace; color: var(--lime); }
footer { display: flex; justify-content: space-between; padding: 25px clamp(22px, 5vw, 72px); font-size: 11px; color: var(--muted); background: var(--cream); }
@media (max-width: 800px) {
  .hero { grid-template-columns: 1fr; padding-top: 55px; }
  .hero-art { max-width: 430px; justify-self: center; }
  .game-heading { align-items: start; flex-direction: column; gap: 14px; }
  .desktop-hint { display: none; } .mobile-hint { display: inline; }
  .records { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .site-header { height: 64px; } .sound-label { display: none; }
  .hero { min-height: calc(100vh - 64px); padding: 50px 24px; }
  h1 { font-size: 51px; }
  .hero-art { margin-top: 15px; }
  .game-section { padding: 65px 14px; }
  .difficulty { padding: 13px 8px; text-align: center; }
  .difficulty small { display: none; }
  .game-shell { padding: 10px; }
  :root { --cell: 32px; }
  .record-list { grid-template-columns: 1fr; gap: 12px; }
  .record-list div { border-left: 0; border-bottom: 1px solid rgba(255,255,255,.12); padding: 0 0 10px; }
  footer { flex-direction: column; gap: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
