/* Färger från fondueboden.se */
:root {
  --gold: #d6971c;
  --gold-2: #d6b31c;
  --yellow: #f2cb1d;
  --red: #a92026;
  --cream: #f0e7d8;
  --wood: #3a2414;
  --ink: #14100c;
  --chip: clamp(64px, 11vmin, 130px);
  --serif: "Alice", Georgia, serif;
  --sans: "Lato", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--ink);
  color: var(--cream);
  font-family: var(--sans);
  font-weight: 300;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  display: flex;
  flex-direction: column;
  height: 100dvh;
}

.bg {
  position: fixed; inset: -30px;
  background: url(img/lokal.jpg) center 40% / cover;
  filter: blur(7px) saturate(1.1) brightness(.42);
  z-index: -2;
}
.bg::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 45%, transparent 20%, rgba(10,6,3,.85) 85%);
}
.lampglow {
  position: fixed; left: 50%; top: 45%;
  width: 90vmin; height: 90vmin;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(214,151,28,.28), rgba(214,151,28,0) 65%);
  z-index: -1;
  animation: glow 6s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes glow { from { opacity: .75; } to { opacity: 1; } }

/* ---------- header ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: clamp(10px, 2vh, 22px) clamp(14px, 3vw, 40px) 0;
}
.brand h1 {
  font-family: var(--serif); font-weight: 400;
  color: var(--gold);
  font-size: clamp(26px, 4.4vmin, 48px);
  margin: 0; letter-spacing: .02em;
  text-shadow: 0 2px 18px rgba(214,151,28,.35);
}
.brand p {
  margin: 2px 0 0; font-size: clamp(12px, 1.6vmin, 16px);
  letter-spacing: .14em; text-transform: uppercase; opacity: .7;
}
.tools { display: flex; gap: 10px; }
.tool {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(214,151,28,.5);
  background: rgba(20,16,12,.6); color: var(--gold);
  font-size: 20px; cursor: pointer;
}
.tool[aria-pressed="false"] { opacity: .45; }

/* ---------- layout ---------- */
.stage {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(0, 2.4fr) minmax(200px, 1fr);
  gap: clamp(8px, 2vw, 30px);
  padding: clamp(8px, 2vh, 24px) clamp(14px, 3vw, 40px) clamp(14px, 3vh, 30px);
}
.col { min-height: 0; display: flex; flex-direction: column; }
.col h2 {
  font-family: var(--serif); font-weight: 400;
  color: var(--gold); margin: 0 0 12px;
  font-size: clamp(18px, 2.6vmin, 28px);
  display: flex; align-items: center; gap: 12px;
}
.col h2::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, rgba(214,151,28,.7), transparent);
}

/* ---------- menu buttons ---------- */
.menu { display: flex; flex-direction: column; gap: clamp(8px, 1.6vh, 16px); }
.food {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 16px 10px 10px;
  border-radius: 999px;
  border: 1px solid rgba(214,151,28,.45);
  background: linear-gradient(100deg, rgba(58,36,20,.88), rgba(25,17,11,.78));
  color: var(--cream); cursor: pointer; text-align: left;
  box-shadow: 0 6px 22px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.06);
  transition: transform .15s, border-color .2s, box-shadow .2s;
  font: inherit;
}
.food:hover { border-color: var(--yellow); box-shadow: 0 6px 26px rgba(214,151,28,.25); }
.food:active { transform: scale(.96); }
.food img {
  width: clamp(54px, 8.5vmin, 92px); aspect-ratio: 1; border-radius: 50%;
  object-fit: cover; flex: none;
  border: 2px solid var(--gold);
  box-shadow: 0 0 0 4px rgba(0,0,0,.35);
}
.food b {
  display: block; font-family: var(--serif); font-weight: 400;
  font-size: clamp(18px, 2.7vmin, 28px);
}
.food span { color: var(--yellow); font-weight: 700; letter-spacing: .05em; font-size: clamp(13px, 1.8vmin, 17px); }

/* ---------- pot ---------- */
.center { align-items: center; justify-content: center; }
.pot-wrap {
  position: relative;
  width: min(100%, calc((100dvh - 150px) * 600 / 560));
  aspect-ratio: 600 / 560;
  margin-top: auto; margin-bottom: auto;
}
.pot { width: 100%; height: 100%; display: block; filter: drop-shadow(0 30px 40px rgba(0,0,0,.6)); }
.fl { transform-box: fill-box; transform-origin: 50% 100%; animation: flick 1.1s ease-in-out infinite alternate; }
.f2 { animation-duration: .8s; } .f3 { animation-duration: 1.3s; } .f4 { animation-duration: .95s; }
@keyframes flick { from { transform: scaleY(.82) skewX(-3deg); } to { transform: scaleY(1.08) skewX(3deg); } }
.flameglow { filter: blur(14px); animation: flameglow 1.4s ease-in-out infinite alternate; }
@keyframes flameglow { from { opacity: .25; } to { opacity: .45; } }
.shimmer { animation: shimmer 3s ease-in-out infinite alternate; }
@keyframes shimmer { from { opacity: .5; } to { opacity: 1; } }

.bubble { animation: bub var(--d, 1.6s) ease-in forwards; transform-box: fill-box; transform-origin: center; }
@keyframes bub {
  0% { transform: scale(.2); opacity: 0; }
  30% { opacity: .9; }
  85% { transform: scale(1); opacity: .9; }
  100% { transform: scale(1.4); opacity: 0; }
}
.ripple { fill: none; stroke: #f2cb1d; stroke-width: 3; animation: rip 1.2s ease-out forwards; transform-box: fill-box; transform-origin: center; }
@keyframes rip { from { transform: scale(.2); opacity: .9; } to { transform: scale(2.6); opacity: 0; } }

.steam { position: absolute; left: 30%; right: 30%; top: -4%; height: 40%; pointer-events: none; }
.steam i {
  position: absolute; bottom: 0; width: 26%; height: 70%;
  background: radial-gradient(ellipse at 50% 70%, rgba(240,231,216,.22), transparent 70%);
  filter: blur(10px);
  animation: steam 6s ease-in infinite;
  opacity: 0;
}
.steam i:nth-child(1) { left: 5%; }
.steam i:nth-child(2) { left: 30%; animation-delay: 1.5s; }
.steam i:nth-child(3) { left: 55%; animation-delay: 3s; }
.steam i:nth-child(4) { left: 75%; animation-delay: 4.5s; }
@keyframes steam {
  0% { transform: translateY(40%) scaleX(.8); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translateY(-60%) scaleX(1.5) rotate(8deg); opacity: 0; }
}

.pot-hint {
  position: absolute; left: 0; right: 0; top: 52%;
  text-align: center; margin: 0;
  font-family: var(--serif); font-size: clamp(14px, 2.2vmin, 22px);
  color: rgba(240,231,216,.55);
  transition: opacity .4s;
}
.pot-hint.hide { opacity: 0; }

/* ---------- forks in the pot ---------- */
.forks { position: absolute; inset: 0; pointer-events: none; }
.fork {
  position: absolute; left: 0; top: 0;
  width: var(--chip);
  display: flex; flex-direction: column; align-items: center;
  transform: translate(calc(var(--x) - 50%), calc(var(--y) - 50%));
  transition: transform .6s cubic-bezier(.3,1.4,.5,1);
  pointer-events: auto;
}
.fork.hidden { visibility: hidden; }
.fork .stick {
  position: absolute; left: 50%; top: 50%;
  width: 4px; height: var(--stick, 60px);
  margin-left: -2px;
  background: linear-gradient(90deg, #6b6b6b, #e6e6e6 45%, #8a8a8a);
  border-radius: 2px; z-index: -1;
}
.fork .face {
  position: relative; width: var(--chip); aspect-ratio: 1;
  border-radius: 50%;
  cursor: pointer;
}
.fork .face img {
  position: absolute; inset: 9%; width: 82%; height: 82%;
  border-radius: 50%; object-fit: cover;
  box-shadow: 0 4px 14px rgba(0,0,0,.6);
}
.fork svg.ring { position: absolute; inset: 0; transform: rotate(-90deg); overflow: visible; }
.ring .trk { fill: rgba(20,16,12,.85); stroke: rgba(240,231,216,.15); stroke-width: 7; }
.ring .bar { fill: none; stroke: var(--yellow); stroke-width: 7; stroke-linecap: round; filter: drop-shadow(0 0 4px rgba(242,203,29,.7)); transition: stroke-dashoffset .3s linear; }
.fork .tag {
  margin-top: -10px; position: relative;
  padding: 3px 12px 4px; border-radius: 999px;
  background: rgba(20,16,12,.9);
  border: 1px solid rgba(214,151,28,.6);
  font-family: var(--serif);
  font-size: clamp(16px, 2.6vmin, 26px);
  color: var(--cream);
  font-variant-numeric: tabular-nums;
  display: flex; align-items: center; gap: 7px; white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0,0,0,.5);
}
.dot { width: .55em; height: .55em; border-radius: 50%; background: var(--fork); box-shadow: 0 0 0 2px rgba(0,0,0,.4); flex: none; }
.fork .x {
  position: absolute; right: -4px; top: -4px;
  width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid rgba(214,151,28,.6);
  background: rgba(20,16,12,.9); color: var(--cream);
  font-size: 15px; line-height: 1; cursor: pointer;
  opacity: 0; transition: opacity .2s;
}
.fork:hover .x, .fork.armed .x { opacity: 1; }
.fork.armed .face { outline: 2px dashed var(--red); outline-offset: 3px; }


/* ---------- done ---------- */
.done { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; min-height: 0; padding: 4px; }
.plate {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 14px 8px 8px; border-radius: 999px;
  background: linear-gradient(100deg, rgba(240,231,216,.12), rgba(240,231,216,.04));
  border: 1px solid rgba(240,231,216,.22);
  cursor: pointer; flex: none;
  transition: opacity .3s, transform .3s;
}
.plate.hidden { visibility: hidden; }
.plate.gone { opacity: 0; transform: translateX(40px); }
.plate img { width: clamp(44px, 6.5vmin, 70px); aspect-ratio: 1; border-radius: 50%; object-fit: cover; border: 2px solid var(--yellow); flex: none; }
.plate b { display: flex; align-items: center; gap: 8px; font-family: var(--serif); font-weight: 400; font-size: clamp(16px, 2.3vmin, 24px); }
.plate small { display: block; opacity: .65; font-size: clamp(12px, 1.6vmin, 15px); }
.empty { opacity: .45; font-family: var(--serif); font-size: clamp(14px, 2vmin, 18px); }
.clear {
  margin-top: 12px; align-self: flex-start;
  background: none; border: 1px solid rgba(169,32,38,.8); color: var(--cream);
  padding: 8px 16px; border-radius: 999px; font: inherit; cursor: pointer;
}
.clear:hover { background: var(--red); }

.flyer {
  position: fixed; left: 0; top: 0; z-index: 50;
  border-radius: 50%; object-fit: cover;
  border: 2px solid var(--gold);
  box-shadow: 0 10px 30px rgba(0,0,0,.6), 0 0 24px rgba(242,203,29,.4);
  pointer-events: none;
}

/* ---------- portrait / mobile ---------- */
@media (orientation: portrait), (max-width: 760px) {
  body { overflow-y: auto; height: auto; min-height: 100dvh; }
  .stage {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "pot pot" "left right";
    align-items: start;
  }
  .center { grid-area: pot; }
  .left { grid-area: left; }
  .right { grid-area: right; }
  .pot-wrap { width: min(100%, 62dvh); }
  .food { padding-right: 10px; gap: 10px; }
  .done { overflow: visible; }
}
@media (prefers-reduced-motion: reduce) {
  .steam, .fl, .lampglow { animation: none; }
}
