/* samy.cc – gemeinsames Design
   Farben aus dem Altglas-Container: Weißglas, Grünglas, Braunglas.
   Keine externen Schriften oder Dienste (Datenschutz). */

:root {
  --paper: #f5f8f4;
  --ink: #15241b;
  --ink-soft: #4a5a50;
  --bottle: #1d5c3a;
  --bottle-deep: #12402a;
  --amber: #8c4a1a;
  --clear: #d7ece6;
  --tag: #f3c63a;
  --line: #cfdcd3;
  --danger: #a3261b;
  --radius-lg: 22px;
  --radius-sm: 10px;
  --font-display: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", "Nunito", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.55;
}

img, svg, canvas { max-width: 100%; }

a { color: var(--bottle); text-underline-offset: 3px; }
a:hover { color: var(--bottle-deep); }

:focus-visible {
  outline: 3px solid var(--tag);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Kopfzeile ---------- */
.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
  padding-bottom: 18px;
}

.logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.logo-cells { display: inline-flex; gap: 3px; }
.logo-cells i {
  width: 10px; height: 10px; border-radius: 2px; display: block;
}
.logo-cells i:nth-child(1) { background: var(--clear); outline: 1px solid var(--line); }
.logo-cells i:nth-child(2) { background: var(--bottle); }
.logo-cells i:nth-child(3) { background: var(--amber); }

.site-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.site-nav a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 8px 12px;
  border-radius: 999px;
}
.site-nav a:hover { background: var(--clear); }
.site-nav a[aria-current="page"] { background: var(--ink); color: var(--paper); }

/* ---------- Typografie ---------- */
h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.12;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
  overflow-wrap: break-word;
  hyphens: auto;
}
h1 { font-size: clamp(2.4rem, 7vw, 4.4rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 800; }
h3 { font-size: 1.25rem; font-weight: 700; }
p { margin: 0 0 1em; max-width: 64ch; }
.lead { font-size: 1.2rem; color: var(--ink-soft); max-width: 46ch; }

/* ---------- Hero ---------- */
.hero { padding-top: 28px; padding-bottom: 8px; }
.hero h1 { max-width: 14ch; }

.glass-snake {
  display: block;
  width: 100%;
  height: 132px;
  margin: 26px 0 10px;
}

/* ---------- Zwei Bereiche ---------- */
.doors {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 18px;
  padding-top: 18px;
  padding-bottom: 40px;
}

.door {
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.door p { margin: 0; }

.door-service { background: var(--bottle); color: #fff; }
.door-service h2 { color: #fff; }
.door-service p { color: #e3f1e9; }

.door-lab {
  background-color: var(--ink);
  color: #e8efe9;
  background-image:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 22px 22px;
}
.door-lab h2 { color: #fff; }
.door-lab p { color: #c4d2c8; }

.prices { display: flex; gap: 10px; flex-wrap: wrap; }
.price {
  background: var(--tag);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-weight: 700;
  line-height: 1.2;
}
.price b { font-family: var(--font-display); font-size: 1.5rem; display: block; }

.door .btn { margin-top: auto; align-self: flex-start; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 0;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.btn-light { background: #fff; color: var(--bottle-deep); }
.btn-light:hover { background: var(--clear); color: var(--bottle-deep); }
.btn-tag { background: var(--tag); color: var(--ink); }
.btn-tag:hover { background: #ffd95c; color: var(--ink); }
.btn-green { background: var(--bottle); color: #fff; }
.btn-green:hover { background: var(--bottle-deep); color: #fff; }
.btn[disabled] { opacity: .6; cursor: progress; }

/* ---------- Ablauf ---------- */
.steps-section { padding-top: 8px; padding-bottom: 48px; }
.steps {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  counter-reset: step;
}
.steps li {
  counter-increment: step;
  border-top: 3px solid var(--ink);
  padding-top: 14px;
}
.steps li::before {
  content: counter(step);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2rem;
  color: var(--bottle);
  display: block;
  line-height: 1;
  margin-bottom: 8px;
}
.steps p { margin: 0; color: var(--ink-soft); }

.note-band {
  background: var(--clear);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  margin-bottom: 48px;
}
.note-band p { margin: 0; }

/* ---------- Unterseiten ---------- */
.page { padding-top: 20px; padding-bottom: 56px; }
.page-narrow { max-width: 720px; }

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 18px 0 28px;
}
.fact {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.fact strong { display: block; font-family: var(--font-display); font-size: 1.15rem; }
.fact span { color: var(--ink-soft); font-size: .95rem; }

/* ---------- Formular ---------- */
.form-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px;
}
fieldset { border: 0; padding: 0; margin: 0 0 22px; }
legend {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  margin-bottom: 10px;
  padding: 0;
}
.field { margin-bottom: 16px; }
.field label, .label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}
.hint { display: block; font-weight: 400; color: var(--ink-soft); font-size: .92rem; }

input[type="text"], input[type="email"], input[type="tel"], select, textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  min-height: 48px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--bottle); outline: none; box-shadow: 0 0 0 3px rgba(29,92,58,.18); }
[aria-invalid="true"] { border-color: var(--danger) !important; }

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.stepper {
  display: flex;
  align-items: center;
  gap: 10px;
}
.stepper button {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--paper);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
}
.stepper button:hover { background: var(--clear); }
.stepper output {
  min-width: 2ch;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
}

.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span {
  display: inline-block;
  padding: 10px 16px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  cursor: pointer;
  font-weight: 600;
}
.choice input:checked + span { background: var(--bottle); border-color: var(--bottle); color: #fff; }
.choice input:focus-visible + span { outline: 3px solid var(--tag); outline-offset: 2px; }

.total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  background: var(--tag);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin: 6px 0 22px;
  font-weight: 700;
}
.total output { font-family: var(--font-display); font-size: 1.6rem; }

.check { display: flex; gap: 12px; align-items: flex-start; }
.check input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--bottle); flex: none; }

.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-msg {
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-top: 16px;
  font-weight: 600;
}
.form-msg[hidden] { display: none; }
.form-msg.err { background: #fbe7e4; color: var(--danger); }

.success {
  background: var(--bottle);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 30px;
}
.success h2 { color: #fff; }
.success p { color: #e3f1e9; }

/* ---------- Spiele-Labor ---------- */
.lab-head {
  background-color: var(--ink);
  color: #e8efe9;
  background-image:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 22px 22px;
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  margin-bottom: 24px;
}
.lab-head h1 { color: #fff; font-size: clamp(2rem, 6vw, 3.2rem); }
.lab-head p { color: #c4d2c8; margin: 0; }

.games {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}
.game {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.game-thumb { background: #000; display: block; aspect-ratio: 16 / 9; width: 100%; }
.game-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.game-body h2 { font-size: 1.35rem; margin: 0; }
.game-body p { margin: 0; color: var(--ink-soft); }
.game-body .btn { align-self: flex-start; margin-top: 8px; }
.game-meta { font-size: .9rem; color: var(--ink-soft); }
.game-soon {
  border: 2px dashed var(--line);
  background: transparent;
  justify-content: center;
}
.game-soon .game-body { justify-content: center; }

/* ---------- Snake-Spielseite ---------- */
.play {
  display: grid;
  grid-template-columns: minmax(0, 480px) 1fr;
  gap: 28px;
  align-items: start;
}
.play canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 14px;
  display: block;
  touch-action: none;
  background: #000;
}
.pad {
  display: grid;
  grid-template-columns: repeat(3, 64px);
  grid-template-rows: repeat(3, 64px);
  gap: 8px;
  margin-top: 16px;
}
.pad button {
  border: 0;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  touch-action: manipulation;
}
.pad button:active { background: var(--bottle); }
.pad [data-key="38"] { grid-column: 2; grid-row: 1; }
.pad [data-key="37"] { grid-column: 1; grid-row: 2; }
.pad [data-key="39"] { grid-column: 3; grid-row: 2; }
.pad [data-key="40"] { grid-column: 2; grid-row: 3; }

kbd {
  font-family: inherit;
  font-weight: 700;
  border: 1.5px solid var(--line);
  border-bottom-width: 3px;
  border-radius: 6px;
  padding: 0 6px;
  background: #fff;
}

/* ---------- Rechtstexte ---------- */
.legal h2 { font-size: 1.35rem; margin-top: 1.6em; }
.legal ul { padding-left: 1.2em; max-width: 64ch; }
.todo { background: #fff3c4; padding: 0 4px; border-radius: 4px; }

/* ---------- Fußzeile ---------- */
.site-foot {
  border-top: 1px solid var(--line);
  padding: 22px 0 34px;
  color: var(--ink-soft);
  font-size: .95rem;
}
.site-foot .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.site-foot nav { display: flex; gap: 16px; }
.site-foot a { color: var(--ink-soft); }

/* ---------- Mobil ---------- */
@media (max-width: 760px) {
  .doors { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .play { grid-template-columns: 1fr; }
  .row-2 { grid-template-columns: 1fr; }
  .door, .form-card { padding: 22px; }
  .glass-snake { height: 96px; margin-top: 18px; }
  .site-nav a { padding: 8px 10px; }
}

@media (max-width: 420px) {
  .site-head { flex-direction: column; align-items: flex-start; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

/* Formular-Feinheiten */
.hint-below { margin-top: 8px; }
p.hint { margin: 0 0 12px; }
.check label { font-weight: 400; margin: 0; }

/* Regeln: Was darf rein? */
.rules { margin: 8px 0 28px; }
.rules-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.rules-col { border-radius: var(--radius-sm); padding: 16px 18px; }
.rules-col h3 { margin-bottom: 8px; }
.rules-col ul { margin: 0; padding-left: 1.1em; }
.rules-col li { margin-bottom: 4px; }
.rules-yes { background: var(--clear); }
.rules-yes h3 { color: var(--bottle-deep); }
.rules-no { background: #fbe7e4; }
.rules-no h3 { color: var(--danger); }
.rules-tips { list-style: none; padding: 0; margin: 0 0 12px; }
.rules-tips li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.rules-tips li:last-child { border-bottom: 0; }
@media (max-width: 760px) { .rules-grid { grid-template-columns: 1fr; } }

/* Snake auf dem Handy: Spielfeld und Pfeile zusammen sichtbar */
.pad { margin-left: auto; margin-right: auto; width: max-content; user-select: none; -webkit-user-select: none; }
.pad button { -webkit-tap-highlight-color: transparent; }
@media (max-width: 760px) {
  .game-back { display: none; }
  .game-title { font-size: 1.6rem; margin-bottom: 8px; }
  .page:has(.play) { padding-top: 4px; }
  .play { gap: 18px; }
  .play canvas { max-width: min(100%, 46vh); margin: 0 auto; }
  .pad { grid-template-columns: repeat(3, 60px); grid-template-rows: repeat(3, 46px); gap: 6px; margin-top: 10px; }
}

.site-foot nav { margin-left: auto; }
