:root {
  --blue: #12a0dc;
  --blue-dark: #0b6aa6;
  --banana: #ffd23f;
  --banana-dark: #c98a00;
  --leaf: #6cc24a;
  --leaf-light: #9ee07a;
  --cream: #f6fbf1;
  --ink: #17313f;
  --muted: #4c6170;
  --radius: 22px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand, .cta, .play, .start-btn, .tag, .chip, .toolbar button, .back {
  font-family: 'Fredoka', 'Nunito', system-ui, sans-serif;
}

a { color: var(--blue-dark); }

img { display: block; max-width: 100%; }

/* ---------- Startsidan ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(56px, 9vw, 110px) 20px clamp(120px, 16vw, 190px);
  background: linear-gradient(180deg, #5cc8f5 0%, #9fe0fb 55%, #d8f4ff 100%);
  text-align: center;
}

.sky span { position: absolute; display: block; }

.sun {
  top: 34px;
  right: 8%;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #fff6b0, var(--banana) 60%);
  box-shadow: 0 0 0 14px rgba(255, 226, 90, 0.35), 0 0 60px 30px rgba(255, 220, 80, 0.45);
}

.cloud {
  height: 38px;
  border-radius: 40px;
  background: #fff;
  opacity: 0.95;
  animation: drift 38s linear infinite;
}
.cloud::before, .cloud::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: #fff;
}
.cloud::before { width: 54%; height: 160%; left: 14%; bottom: 30%; }
.cloud::after { width: 38%; height: 120%; right: 14%; bottom: 40%; }
.c1 { top: 70px; left: 6%; width: 150px; }
.c2 { top: 150px; left: 64%; width: 120px; animation-duration: 46s; animation-delay: -12s; }
.c3 { top: 46px; left: 38%; width: 96px; opacity: 0.8; animation-duration: 54s; animation-delay: -30s; }

@keyframes drift {
  0% { transform: translateX(-30px); }
  50% { transform: translateX(30px); }
  100% { transform: translateX(-30px); }
}

.hero-inner { position: relative; z-index: 1; max-width: 860px; margin: 0 auto; }

.kicker {
  display: inline-block;
  margin: 0 0 18px;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--blue-dark);
  font-weight: 800;
  font-size: 0.95rem;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.7rem, 8vw, 5.4rem);
  font-weight: 700;
  line-height: 1.02;
  color: #fff;
  letter-spacing: 0.5px;
  text-shadow: 0 5px 0 var(--blue-dark), 0 14px 26px rgba(11, 106, 166, 0.3);
}
.hero h1 span {
  display: block;
  color: var(--banana);
  text-shadow: 0 5px 0 var(--banana-dark), 0 14px 26px rgba(150, 100, 0, 0.25);
}

.lead {
  max-width: 640px;
  margin: 26px auto 30px;
  font-size: clamp(1.05rem, 2vw, 1.22rem);
  font-weight: 600;
  color: #0b3d5a;
}

.cta {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  padding: 14px 28px;
  border-radius: 999px;
  background: var(--banana);
  color: #3b2a00;
  font-size: 1.2rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 6px 0 var(--banana-dark);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.cta:hover { transform: translateY(-2px); box-shadow: 0 8px 0 var(--banana-dark); }
.cta:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--banana-dark); }

.hills {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: clamp(90px, 14vw, 200px);
}

.section { max-width: 1180px; margin: 0 auto; padding: 34px 22px 18px; }

.section h2 {
  margin: 0 0 4px;
  font-size: clamp(1.9rem, 4vw, 2.5rem);
  color: #2f7d1d;
}

.section-lead { margin: 0 0 26px; color: var(--muted); font-weight: 600; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
}

.card {
  --c: var(--blue);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 3px solid var(--c);
  border-radius: var(--radius);
  background: #fff;
  color: inherit;
  text-decoration: none;
  box-shadow: 0 8px 0 color-mix(in srgb, var(--c) 70%, #000);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card:hover, .card:focus-visible {
  transform: translateY(-5px);
  box-shadow: 0 13px 0 color-mix(in srgb, var(--c) 70%, #000);
  outline: none;
}

.thumb {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: color-mix(in srgb, var(--c) 18%, #fff);
  border-bottom: 3px solid var(--c);
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.35s ease;
}
.card:hover .thumb img { transform: scale(1.05); }

.card-body { display: flex; flex: 1; flex-direction: column; padding: 18px 22px 22px; }

.tag {
  align-self: flex-start;
  padding: 3px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--c, var(--blue)) 16%, #fff);
  color: color-mix(in srgb, var(--c, var(--blue)) 80%, #000);
  font-size: 0.85rem;
  font-weight: 600;
}

.card h3 { margin: 10px 0 6px; font-size: 1.55rem; line-height: 1.15; }
.card p { margin: 0 0 18px; color: var(--muted); }

.play {
  align-self: flex-start;
  margin-top: auto;
  padding: 8px 20px;
  border-radius: 999px;
  background: var(--c);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
}

.grid-bonus { grid-template-columns: repeat(auto-fill, minmax(300px, 380px)); }

.about {
  margin-top: 26px;
  margin-bottom: 30px;
  padding: 28px 30px;
  border-radius: var(--radius);
  background: #fff;
  border: 3px dashed #bfe3a9;
}
.about h2 { font-size: 1.7rem; }
.about p { margin: 10px 0 0; max-width: 780px; }
.fineprint { color: var(--muted); font-size: 0.92rem; }

.footer {
  padding: 26px 20px 34px;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}

/* ---------- Spelsidan ---------- */

.play-page { background: linear-gradient(180deg, #e7f6fe 0%, var(--cream) 420px); }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px clamp(14px, 3vw, 28px);
  background: linear-gradient(180deg, var(--blue), #0d8cc6);
  box-shadow: 0 4px 0 var(--blue-dark);
}

.back {
  padding: 7px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}
.back:hover { background: rgba(255, 255, 255, 0.3); }

.brand { color: #fff; font-size: 1.3rem; font-weight: 700; text-decoration: none; }
.brand span { color: var(--banana); }

.player { max-width: 1240px; margin: 0 auto; padding: 18px clamp(12px, 3vw, 28px) 10px; }

.title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 14px; }
.title-row h1 { margin: 0; font-size: clamp(1.6rem, 3.6vw, 2.3rem); line-height: 1.1; }

.stage {
  --w: 4;
  --h: 3;
  position: relative;
  width: min(100%, calc((100svh - 240px) * var(--w) / var(--h)));
  min-width: min(100%, 340px);
  aspect-ratio: var(--w) / var(--h);
  margin: 0 auto;
  overflow: hidden;
  border: 4px solid var(--c, var(--blue));
  border-radius: 18px;
  background: #0d2233;
  box-shadow: 0 9px 0 color-mix(in srgb, var(--c, var(--blue)) 70%, #000);
}

.stage:fullscreen {
  width: 100vw;
  height: 100vh;
  min-width: 0;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  background: #000;
  box-shadow: none;
}

.start {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: #000;
  cursor: pointer;
}
.start img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.72) saturate(1.05);
  transition: filter 0.2s ease, transform 0.4s ease;
}
.start:hover img { filter: brightness(0.85) saturate(1.1); transform: scale(1.02); }

.start-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 0.65em 1.4em;
  border-radius: 999px;
  background: var(--banana);
  color: #3b2a00;
  font-size: clamp(1.2rem, 3vw, 2rem);
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 6px 0 var(--banana-dark), 0 18px 40px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease;
}
.start:hover .start-btn { transform: translate(-50%, -50%) scale(1.06); }

.stage.running .start { display: none; }

.stage .ruffle {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.missing {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 20px;
  color: #fff;
  font-weight: 700;
  text-align: center;
}
.missing a { color: var(--banana); }
.stage-missing { aspect-ratio: 16 / 7; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 12px;
  margin: 24px 0 6px;
}
.toolbar button {
  padding: 8px 18px;
  border: 2px solid var(--c, var(--blue));
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.toolbar button:hover:not(:disabled) { background: color-mix(in srgb, var(--c, var(--blue)) 14%, #fff); }
.toolbar button:disabled { opacity: 0.45; cursor: default; }
.controls { color: var(--muted); font-weight: 700; }

.touch-note {
  max-width: 640px;
  margin: 10px auto 0;
  padding: 10px 16px;
  border-radius: 14px;
  background: #fff4cc;
  color: #6b4d00;
  font-weight: 600;
  text-align: center;
}

.info { max-width: 760px; margin: 18px auto 0; text-align: center; }
.info p { margin: 0; font-size: 1.08rem; }
.tips { display: inline-block; margin: 12px 0 0; padding: 0; list-style: none; text-align: left; color: var(--muted); }
.tips li { position: relative; margin: 4px 0; padding-left: 28px; }
.tips li::before { content: '🍌'; position: absolute; left: 0; }

.more { max-width: 1000px; margin: 34px auto 0; text-align: center; }
.more h2 { margin: 0 0 14px; font-size: 1.5rem; color: #2f7d1d; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px 6px 6px;
  border: 2px solid var(--c);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 0 color-mix(in srgb, var(--c) 70%, #000);
  transition: transform 0.15s ease;
}
.chip:hover { transform: translateY(-2px); }
.chip img { width: 46px; height: 32px; border-radius: 999px; object-fit: cover; object-position: center top; }

@media (max-width: 560px) {
  .brand { font-size: 1.05rem; }
  .grid, .grid-bonus { grid-template-columns: 1fr; }
  .sun { width: 64px; height: 64px; right: 5%; }
}

@media (prefers-reduced-motion: reduce) {
  .cloud { animation: none; }
  .card, .cta, .chip, .thumb img, .start img { transition: none; }
}

/* ---------- Mikrofon, meddelanden, pekskärm, jingelpost ---------- */

.mic {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: #fff;
  border: 2px solid #f2a516;
  font-weight: 700;
}
.mic[hidden] { display: none; }
.mic-meter {
  width: 70px;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #ffe9b8;
}
.mic-meter span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #6cc24a, #f2a516, #e5484d);
  transition: width 0.08s linear;
}

.notice {
  max-width: 680px;
  margin: 12px auto 0;
  padding: 10px 16px;
  border-radius: 14px;
  background: #e3f4fd;
  color: #0b4f78;
  font-weight: 700;
  text-align: center;
}
.notice-warn { background: #fff4cc; color: #6b4d00; }

.touchpad {
  display: grid;
  grid-template-columns: repeat(3, 64px) 1fr 96px;
  grid-template-areas:
    '. up . . jump'
    'left down right . jump';
  gap: 8px;
  max-width: 420px;
  margin: 18px auto 0;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.touchpad[hidden] { display: none; }
.key {
  height: 60px;
  border: 0;
  border-radius: 16px;
  background: var(--c, var(--blue));
  color: #fff;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  box-shadow: 0 5px 0 color-mix(in srgb, var(--c, var(--blue)) 65%, #000);
  touch-action: none;
}
.key.down { transform: translateY(4px); box-shadow: 0 1px 0 color-mix(in srgb, var(--c, var(--blue)) 65%, #000); }
.key-ArrowUp { grid-area: up; }
.key-ArrowLeft { grid-area: left; }
.key-ArrowDown { grid-area: down; }
.key-ArrowRight { grid-area: right; }
.key-Space { grid-area: jump; height: auto; font-size: 1.15rem; background: var(--banana); color: #3b2a00; box-shadow: 0 5px 0 var(--banana-dark); }

.share {
  width: min(92vw, 520px);
  padding: 26px 26px 22px;
  border: 4px solid var(--blue);
  border-radius: 22px;
  color: var(--ink);
  box-shadow: 0 10px 0 var(--blue-dark), 0 30px 80px rgba(0, 0, 0, 0.35);
}
.share::backdrop { background: rgba(10, 40, 60, 0.55); }
.share h2 { margin: 0 0 8px; font-size: 1.7rem; }
.share p { margin: 0 0 14px; font-weight: 600; }
.share-link { display: block; font-weight: 800; font-size: 0.9rem; color: var(--muted); }
.share-link input {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 2px solid #bfe3f6;
  border-radius: 12px;
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
}
.share-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 6px; }
.share-actions button, .share-actions .button, .share-close {
  padding: 9px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-family: 'Fredoka', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.share-actions .button + .button { background: var(--leaf); }
.share-close { margin-top: 8px; background: #e7eef2; color: var(--ink); }

.print-frame { position: fixed; width: 0; height: 0; border: 0; left: -9999px; }
