@font-face {
  font-family: "Baloo 2";
  src: url("/assets/Baloo2.ttf") format("truetype");
  font-weight: 400 800;
  font-display: swap;
}

:root {
  --cream: #f7f2e2;
  --paper: #fffbef;
  --ink: #12291f;
  --ink-soft: #3f5347;
  --green: #4f8143;
  --fairway: #a2d47a;
  --beer: #e39b2d;
  --beer-dark: #b8741a;
  --red: #d8443c;
  --water: #4e94c4;
  --line: #e2d8b9;
  --radius: 14px;
  --shadow: 0 1px 0 rgba(18, 41, 31, .06), 0 10px 30px -18px rgba(18, 41, 31, .35);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
h1, h2, h3, .brand, .price, .btn { font-family: "Baloo 2", system-ui, sans-serif; }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); line-height: 1.05; margin: 0 0 .4em; letter-spacing: -.01em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); line-height: 1.1; margin: 0 0 .5em; }
h3 { font-size: 1.25rem; margin: 0 0 .3em; }
a { color: var(--green); }
p { margin: 0 0 1em; }
.muted { color: var(--ink-soft); }
.small { font-size: .88rem; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* header */
.top { border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 10; }
.top .wrap { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; align-items: center; gap: 8px; font-size: 1.6rem; font-weight: 800; color: var(--ink); text-decoration: none; }
.brand img { height: 42px; }
.top nav { margin-left: auto; display: flex; gap: 20px; }
.top nav a { color: var(--ink); text-decoration: none; font-weight: 600; }
.top nav a:hover { color: var(--green); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--ink); color: var(--cream); border: 0; border-radius: 999px;
  padding: 12px 26px; font-size: 1.1rem; font-weight: 700; cursor: pointer; text-decoration: none;
}
.btn:hover { background: #1f4232; }
.btn.beer { background: var(--beer); color: var(--ink); }
.btn.beer:hover { background: #f0ac44; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.btn.small { padding: 6px 14px; font-size: .95rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* hero */
.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 32px; align-items: center; padding-top: 40px; padding-bottom: 24px; }
.hero .lead { font-size: 1.2rem; color: var(--ink-soft); max-width: 34em; }

/* search */
.search { position: relative; margin: 26px 0 8px; max-width: 520px; }
.search input {
  width: 100%; font-size: 1.1rem; padding: 15px 20px; border-radius: 999px;
  border: 2px solid var(--ink); background: var(--paper); color: var(--ink); outline: none;
}
.search input:focus { box-shadow: 0 0 0 4px rgba(227, 155, 45, .35); }
.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  list-style: none; margin: 0; padding: 6px; z-index: 5; max-height: 360px; overflow: auto;
}
.suggest:empty { display: none; }
.suggest a { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.suggest a:hover, .suggest a.on { background: #f3ead0; }
.suggest .where { color: var(--ink-soft); font-size: .88rem; }

/* status badges */
.badge { display: inline-block; font-size: .8rem; font-weight: 700; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.badge.ready { background: var(--fairway); color: var(--ink); }
.badge.started, .badge.orderable { background: #f6dfb2; color: #6a4410; }
.badge.unavailable { background: #e6e1d2; color: #6b6a60; }
.badge:not([class*=" "]) { background: #f6dfb2; color: #6a4410; }
.suggest li.head { padding: 10px 12px 2px; font-weight: 700; }
.suggest li.wish b { font-weight: 600; }
.results.wish a { background: transparent; }
.lead-sm { font-size: 1.08rem; }
.why { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px 34px; }
.why h3 { margin: 0 0 4px; }
.why p { margin: 0; }

/* glass viewer */
.viewer { position: relative; }
.glass-canvas { width: 100%; aspect-ratio: 1 / 1.05; cursor: grab; touch-action: pan-y; }
.glass-canvas:active { cursor: grabbing; }
.glass-canvas canvas { width: 100% !important; height: 100% !important; display: block; }
.viewer .tabs { display: flex; gap: 8px; justify-content: center; margin-top: 4px; flex-wrap: wrap; }
.viewer .tabs button {
  border: 2px solid var(--ink); background: transparent; color: var(--ink);
  border-radius: 999px; padding: 5px 14px; font-weight: 700; cursor: pointer; font-size: .92rem;
}
.viewer .tabs button.on { background: var(--ink); color: var(--cream); }
.level { display: flex; align-items: center; gap: 12px; justify-content: center; margin-top: 12px; font-size: .92rem; color: var(--ink-soft); }
.level input { width: 200px; accent-color: var(--beer); }
.hint { text-align: center; font-size: .82rem; color: var(--ink-soft); margin-top: 6px; }
.example-note {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--cream); font-size: .85rem; font-weight: 600;
  padding: 6px 14px; border-radius: 999px; white-space: nowrap; pointer-events: none;
}

/* sections */
section { padding: 44px 0; }
section.band { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.step { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
section.band .step { background: var(--cream); }
.step .n { font-family: "Baloo 2"; font-weight: 800; font-size: 2rem; color: var(--beer-dark); line-height: 1; }
.step img { height: 54px; float: right; margin-left: 10px; }

.rules { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
.rules ul { padding-left: 1.1em; margin: 0; }
.rules li { margin-bottom: .45em; }
.pen { display: inline-block; min-width: 2.2em; font-weight: 800; }

/* packages */
.packages { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.pkg {
  position: relative; display: block; cursor: pointer; background: var(--paper);
  border: 2px solid var(--line); border-radius: var(--radius); padding: 20px 22px;
}
.pkg input { position: absolute; opacity: 0; }
.pkg:has(input:checked) { border-color: var(--ink); box-shadow: var(--shadow); }
.pkg:has(input:focus-visible) { outline: 3px solid var(--beer); }
.pkg .price { font-size: 2.2rem; font-weight: 800; line-height: 1; margin: 6px 0 10px; }
.pkg .price small { font-size: 1rem; font-weight: 600; color: var(--ink-soft); }
.pkg ul { margin: 0; padding-left: 1.1em; color: var(--ink-soft); }
.pkg .tag { position: absolute; top: -12px; right: 16px; background: var(--red); color: #fff; font-size: .8rem; font-weight: 700; border-radius: 999px; padding: 3px 10px; }

/* course page */
.course { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; padding-top: 32px; padding-bottom: 32px; align-items: start; }
.course .meta { color: var(--ink-soft); margin-bottom: 14px; }
.notice { border-radius: var(--radius); padding: 14px 18px; margin: 16px 0; background: #f6dfb2; }
.notice.ok { background: #d9ecc7; }
.notice.warn { background: #f4d4cf; }
.buy { margin-top: 22px; }
.buy .btn { width: 100%; margin-top: 16px; padding: 15px; font-size: 1.25rem; }
.fine { font-size: .85rem; color: var(--ink-soft); margin-top: 10px; }
.flat { width: 100%; border-radius: 10px; background: #d7a24a; margin-top: 18px; display: block; }

/* search results */
.results { list-style: none; padding: 0; margin: 20px 0; display: grid; gap: 10px; }
.results a {
  display: flex; align-items: center; gap: 16px; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 18px; text-decoration: none; color: var(--ink);
}
.results a:hover { border-color: var(--ink); }
.results .name { font-weight: 700; }
.results .badge { margin-left: auto; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--ink); }
.card img { width: 100%; display: block; background: #d7a24a; aspect-ratio: 251 / 120; object-fit: cover; }
.card div { padding: 12px 16px; }

footer { padding: 36px 0 60px; color: var(--ink-soft); font-size: .9rem; border-top: 1px solid var(--line); margin-top: 30px; }

/* admin */
table { border-collapse: collapse; width: 100%; font-size: .9rem; background: var(--paper); }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 700; }
td pre { margin: 0; max-width: 460px; max-height: 110px; overflow: auto; font-size: .78rem; white-space: pre-wrap; }
.admin h2 { margin-top: 36px; }
.admin form { display: inline; }
.stat { display: inline-block; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px; margin: 0 10px 10px 0; }
.stat b { font-size: 1.4rem; font-family: "Baloo 2"; display: block; }

@media (max-width: 820px) {
  .why { grid-template-columns: 1fr; }
  .hero, .course, .rules { grid-template-columns: 1fr; }
  .hero { padding-top: 20px; }
  /* on a phone the course and the play button come before the 3D glass */
  .course > div:last-child { order: -1; }
  .steps, .packages { grid-template-columns: 1fr; }
  .top nav { gap: 14px; font-size: .95rem; }
  .top nav .hide-sm { display: none; }
  .glass-canvas { max-width: 440px; margin: 0 auto; }
}

/* QR landing: read on a phone, at a table, glass in the other hand */
.qr-home { max-width: 620px; padding-top: 24px; padding-bottom: 20px; }
.qr-home .kicker { margin: 0; font-weight: 700; color: var(--beer-dark); text-transform: uppercase; letter-spacing: .06em; font-size: .85rem; }
.qr-home h1 { margin-bottom: .1em; }
.qr-home section { padding: 22px 0 6px; }
.card-rules { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px !important; margin-top: 16px; }
.steps-compact { padding-left: 1.2em; margin: 0 0 .6em; }
.steps-compact li { margin-bottom: .5em; }
.reorder { display: grid; gap: 10px; }
.reorder-item { display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; text-decoration: none; color: var(--ink); }
.reorder-item:hover { border-color: var(--ink); }
.reorder-item span { color: var(--ink-soft); font-size: .92rem; }

/* admin: correcting a hole */
.hole-edit { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.hole-edit .pair { width: 100%; cursor: crosshair; border-radius: 8px; margin-top: 8px; }
.hole-edit label { margin-right: 14px; font-size: .92rem; white-space: nowrap; }
.hole-edit textarea { width: 100%; font: inherit; padding: 10px; border-radius: 10px; border: 1px solid var(--line); margin-bottom: 8px; }
@media (max-width: 820px) { .hole-edit { grid-template-columns: 1fr; } }

/* hole flags in admin */
.badge.flag { white-space: normal; margin: 2px 0; }
.badge.flag.fel { background: #f3c9c4; color: #7a1f16; }
.badge.flag.titta { background: #f6dfb2; color: #6a4410; }
form.inline { display: inline; }
.admin .toolbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 14px; }
.admin .flagrow .fixes { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.admin .modes label { margin-right: 10px; white-space: nowrap; }
.admin .pair { cursor: crosshair; }
.admin .need { border-top: 1px solid #e6e1d2; padding: 10px 0; }
.admin .need textarea { width: 100%; font-size: .85rem; }
.admin .upload { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; }
.admin .icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.admin .icon-grid figure { margin: 0; text-align: center; font-size: .78rem; background: #d6a550; border-radius: 8px; padding: 8px; }
.admin .icon-grid img { width: 72px; height: 72px; object-fit: contain; }
.admin .icon-grid figcaption { color: #2b2a24; }
.admin .icon-grid .muted { color: #5b4a2a; }
.admin .curio-row { display: flex; flex-wrap: wrap; gap: 8px; }
.admin .curio-row figure { margin: 0; text-align: center; font-size: .75rem; background: #d6a550; border-radius: 8px; padding: 6px; width: 86px; }
.admin .curio-row img { width: 52px; height: 52px; object-fit: contain; }
.admin section.layer { border: 1px solid #e6e1d2; border-radius: 10px; padding: 12px 14px; margin: 14px 0; }
.admin section.layer h2 { margin-top: 0; }
.linkish { background: none; border: 0; cursor: pointer; font-weight: 700; padding: 0 0 0 4px; color: inherit; }
.trivia { margin: 14px 0; } .trivia h3 { margin: 0 0 4px; font-size: 1rem; } .trivia ul { margin: 0; padding-left: 18px; }

/* ---- the game ------------------------------------------------------------ */
.game { max-width: 760px; margin: 0 auto; padding: 8px 12px 30px; position: relative; }
.game .controls { gap: 8px !important; }
.game .sizes button { padding: 6px 4px !important; }
.game .stage-wrap { position: relative; background: #f7f2e2; border-radius: 16px; overflow: hidden;
  box-shadow: 0 2px 14px rgba(0,0,0,.12); }
.game svg.stage { display: block; width: 100%; height: clamp(300px, calc(100svh - 400px), 640px); }
.game .hud { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; gap: 8px;
  align-items: flex-start; justify-content: space-between; pointer-events: none; font-size: .9rem; }
.game .hud > div:empty { display: none; }
.game .hud .sign { background: #8b5a2b; color: #fff8e6; border: 2px solid #12291f; border-radius: 8px;
  padding: 4px 10px; display: flex; flex-direction: column; line-height: 1.1; }
.game .hud .sign b { font-size: 1.15rem; }
.game .hud .now, .game .hud .tot { background: rgba(255,255,255,.88); border-radius: 8px; padding: 4px 8px; }
.game .msg { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%) scale(.8);
  background: #12291f; color: #fff; font-weight: 800; font-size: 1.3rem; padding: 10px 18px;
  border-radius: 999px; opacity: 0; transition: .25s; pointer-events: none; white-space: nowrap; }
.game .msg.show { opacity: .95; transform: translate(-50%, -50%) scale(1); }
.game .msg.bad { background: #b0412b; }
.game .msg.done { background: #2e7d32; }
.game .msg.refill { background: #c9781b; }
.game .card { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; margin: 10px 0; }
.game .card div { text-align: center; background: #fff; border-radius: 6px; padding: 3px 0; font-weight: 800; }
.game .card small { display: block; font-size: .65rem; color: #888; font-weight: 600; }
.game .card .now { outline: 2px solid #c9781b; }
.game .card .under { background: #d7ecd0; } .game .card .over { background: #f6d7cf; }
.game .controls { display: grid; gap: 10px; }
.game .sizes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.game .sizes button { border: 2px solid #12291f; background: #fff; border-radius: 10px; padding: 8px 4px;
  cursor: pointer; display: flex; flex-direction: column; align-items: center; font: inherit; }
.game .sizes button small { color: #6b6a60; font-size: .75rem; }
.game .sizes button.on { background: #f2b33d; }
.game .meter { position: relative; height: 34px; border-radius: 999px; overflow: hidden; border: 2px solid #12291f;
  background: linear-gradient(90deg, #e57361 0%, #f4c76a 30%, #8cc061 44%, #8cc061 56%, #f4c76a 70%, #e57361 100%); }
.game .meter .needle { position: absolute; top: -2px; bottom: -2px; width: 4px; margin-left: -2px; left: 50%;
  background: #12291f; border-radius: 2px; }
.game .meter i { position: absolute; top: 7px; font-size: .7rem; font-style: normal; color: #12291f; opacity: .7; }
.game .meter .l { left: 10px; } .game .meter .r { right: 10px; }
.game .meter.live { box-shadow: 0 0 0 3px #f2b33d; }
.game .go { font-size: 1.2rem; padding: 14px; width: 100%; }
.game .keys { margin: 0; text-align: center; }
.game .gone { display: none !important; }
.game .overlay { position: fixed; inset: 0; background: rgba(18,41,31,.55); display: flex;
  align-items: center; justify-content: center; padding: 16px; z-index: 20; }
.game .end { display: none; } .game .end.show { display: flex; }
.game .overlay .box { background: #fffdf6; border-radius: 16px; padding: 18px 20px; max-width: 460px; width: 100%;
  max-height: 92vh; overflow: auto; }
.game .overlay h1 { margin: 0 0 4px; font-size: 1.5rem; }
.game .overlay ul { padding-left: 18px; }
.game .overlay form { display: grid; gap: 8px; margin: 10px 0; }
.game .overlay input { padding: 10px; border-radius: 8px; border: 1px solid #ccc; font: inherit; width: 100%; }
.game .result { font-size: 1.2rem; }
.game .board ol { padding-left: 22px; margin: 6px 0; }
.game .board li { display: flex; gap: 8px; } .game .board li span { flex: 1; }
.game .board li small { color: #888; width: 2.5em; text-align: right; }
.game .board li.me { font-weight: 800; color: #c9781b; }
.game .buy { border-top: 1px solid #e6e1d2; margin-top: 12px; padding-top: 10px; }
.game .buy .btn { margin: 4px 4px 0 0; }
.playcta { background: #fff4d6; border: 2px solid #12291f; border-radius: 12px; padding: 10px 12px; margin: 12px 0; } .playcta .btn { margin: 6px 6px 0 0; }
.playcta.big { padding: 18px 20px; margin: 16px 0 22px; }
.playcta.big h2 { margin: 0 0 4px; font-size: 1.5rem; }
.playcta.big p { margin: 0 0 6px; }
