:root {
  --ink: #2b211b;
  --panel: #fff8e8;
  --panel-border: #e6b96a;
  --sea: #4db5c9;
  --sea-dark: #1b8298;
  --sky: #8fd6ef;
  --sand: #f2c66e;
  --sand-dark: #d99a42;
  --toffi: #54301f;
  --toffi-dark: #2f1b13;
  --collar: #d92d2d;
  --pig: #f3a1b1;
  --pig-dark: #c86f83;
  --straw: #d8b35a;
  --shorts: #2ba6c8;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: #f5ead1;
  color: var(--ink);
  font-family: "Trebuchet MS", Verdana, sans-serif;
}

button {
  font: inherit;
}

.game-shell {
  width: min(1120px, calc(100vw - 28px));
  margin: 18px auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 12px;
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #7a4b20;
}

h1 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.6rem);
  line-height: 1;
}

.stage {
  position: relative;
  overflow: hidden;
  min-height: 640px;
  border: 4px solid #7a4b20;
  border-radius: 8px;
  background: var(--sky);
  box-shadow: 0 12px 0 rgba(69, 38, 16, 0.15);
}

.scene {
  display: none;
  position: absolute;
  inset: 0;
}

.scene-active {
  display: block;
}

.asset-image {
  display: none;
  pointer-events: none;
  user-select: none;
}

.asset-loaded > .asset-image[src] {
  display: block;
}

.hub-bg-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.character-image,
.object-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.toffi.asset-loaded,
.grisen.asset-loaded,
.bucket-hotspot.asset-loaded,
.sandhouse.asset-loaded,
.postcard.asset-loaded,
.drink-table.asset-loaded,
.parasol.asset-loaded,
.volley-ball-hotspot.asset-loaded {
  overflow: hidden;
}

.toffi.asset-loaded .toffi-image,
.grisen.asset-loaded .grisen-image {
  position: absolute;
  top: 0;
  right: auto;
  bottom: auto;
  width: 200%;
  height: 100%;
  max-width: none;
  object-fit: fill;
}

.toffi.asset-loaded .toffi-image {
  left: 0;
}

.grisen.asset-loaded .grisen-image {
  left: -100%;
}

.hub-layer {
  position: absolute;
  inset: 0;
}

.hub-background {
  z-index: 1;
  pointer-events: none;
}

.hub-objects {
  z-index: 2;
}

.hub-characters {
  z-index: 3;
  pointer-events: none;
}

.hub-ui {
  z-index: 4;
  pointer-events: none;
}

.hub-characters .character,
.hub-ui .speech,
.hub-sound-toggle {
  pointer-events: auto;
}

.hub-sound-toggle {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  min-width: 92px;
  padding: 8px 12px;
  border: 3px solid #7a4b20;
  border-radius: 8px;
  background: rgba(255, 248, 232, 0.94);
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(83, 45, 18, 0.18);
}

.hub-sound-toggle[aria-pressed="false"] {
  background: rgba(255, 236, 196, 0.94);
}

.hub-sound-toggle:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 rgba(83, 45, 18, 0.18);
}

.object-note {
  position: absolute;
  z-index: 4;
  max-width: 180px;
  padding: 8px 12px;
  border: 3px solid #7a4b20;
  border-radius: 8px;
  background: #fff4ba;
  color: #5e3217;
  font-weight: 800;
  text-align: center;
  pointer-events: none;
  transform: translate(-50%, -100%) rotate(-1deg);
  box-shadow: 0 6px 0 rgba(83, 45, 18, 0.18);
}

.object-note::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -10px;
  width: 14px;
  height: 14px;
  border-right: 3px solid #7a4b20;
  border-bottom: 3px solid #7a4b20;
  background: #fff4ba;
  transform: translateX(-50%) rotate(45deg);
}

.object-note.object-note-below {
  transform: translateX(-50%);
}

.object-note.object-note-below::after {
  top: -10px;
  bottom: auto;
  border-right: 0;
  border-bottom: 0;
  border-left: 3px solid #7a4b20;
  border-top: 3px solid #7a4b20;
}

.hotspot,
.character,
.bucket-hotspot {
  position: absolute;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.hub-clickable {
  transition: filter 150ms ease, transform 150ms ease;
}

.hub-clickable:hover,
.hub-clickable:focus-visible {
  filter: drop-shadow(0 0 10px rgba(255, 245, 160, 0.95));
}

.hotspot:focus-visible,
.character:focus-visible,
.bucket-hotspot:focus-visible,
.hub-sound-toggle:focus-visible,
.game-actions button:focus-visible,
.game-overlay button:focus-visible,
.volley-top-controls button:focus-visible,
.volley-overlay button:focus-visible,
.volley-pause-card button:focus-visible,
.parasol-overlay button:focus-visible {
  outline: 4px solid #fff;
  outline-offset: 4px;
}

.toffi {
  left: 18%;
  bottom: 72px;
  width: 256px;
  height: 164px;
}

.toffi.asset-loaded {
  left: 25%;
  bottom: 92px;
  width: 288px;
  height: 318px;
}

.toffi:hover,
.toffi:focus-visible {
  transform: translateY(-4px) scale(1.03);
}

.grisen {
  left: 52%;
  bottom: 82px;
  width: 142px;
  height: 138px;
  transform: rotate(-5deg);
}

.grisen.asset-loaded {
  left: 46%;
  bottom: 96px;
  width: 232px;
  height: 260px;
  transform: rotate(-3deg);
}

.grisen:hover,
.grisen:focus-visible {
  transform: translateY(-4px) rotate(-5deg) scale(1.03);
}

.grisen.asset-loaded:hover,
.grisen.asset-loaded:focus-visible {
  transform: translateY(-4px) rotate(-3deg) scale(1.03);
}

.bucket-hotspot {
  left: 68%;
  right: auto;
  bottom: 42px;
  width: 150px;
  height: 170px;
}

.bucket-hotspot.asset-loaded {
  left: 68%;
  right: auto;
  bottom: 42px;
  width: 150px;
  height: 170px;
}

.bucket-hotspot:hover,
.bucket-hotspot:focus-visible {
  filter: drop-shadow(0 0 13px rgba(255, 245, 160, 0.98));
  transform: translateY(-6px) scale(1.045);
}

.sandhouse {
  left: 80%;
  bottom: 70px;
  width: 172px;
  height: 142px;
}

.sandhouse:hover,
.sandhouse:focus-visible {
  filter: drop-shadow(0 0 10px rgba(255, 245, 160, 0.92));
  transform: translateY(-5px) scale(1.04);
}

.postcard {
  left: 12%;
  bottom: 34px;
  width: 170px;
  height: 112px;
  transform: rotate(-8deg);
}

.postcard:hover,
.postcard:focus-visible {
  filter: drop-shadow(0 0 11px rgba(255, 245, 160, 0.94));
  transform: translateY(-5px) rotate(-8deg) scale(1.04);
}

.drink-table {
  left: 2%;
  bottom: 136px;
  width: 314px;
  height: 222px;
  transform: rotate(4deg);
}

.drink-table-image {
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.drink-table:hover,
.drink-table:focus-visible {
  filter: drop-shadow(0 0 11px rgba(255, 245, 160, 0.94));
  transform: translateY(-5px) rotate(4deg) scale(1.04);
}

.parasol {
  right: 6%;
  bottom: 202px;
  width: 170px;
  height: 150px;
}

.parasol.asset-loaded {
  right: 5%;
  bottom: 200px;
  width: 190px;
  height: 170px;
}

.parasol:hover,
.parasol:focus-visible {
  transform: translateY(-4px) scale(1.03);
}

.volley-ball-hotspot {
  left: 67%;
  bottom: 278px;
  width: 128px;
  height: 122px;
  animation: volley-hub-float 4.8s ease-in-out infinite;
}

.volley-ball-image {
  left: 50%;
  top: 4px;
  width: 92px;
  height: 72px;
  transform: translateX(-50%);
}

.volley-ball-hotspot:hover,
.volley-ball-hotspot:focus-visible {
  animation-play-state: paused;
  transform: translateY(-5px) rotate(-3deg) scale(1.05);
}

@keyframes volley-hub-float {
  0%,
  100% {
    transform: translateY(0) rotate(-2deg);
  }
  50% {
    transform: translateY(-8px) rotate(2deg);
  }
}

.speech {
  position: absolute;
  left: 50%;
  width: min(760px, calc(100% - 48px));
  top: 18px;
  bottom: auto;
  min-height: 64px;
  max-height: none;
  display: flex;
  align-items: center;
  border: 3px solid #7a4b20;
  border-radius: 8px;
  background: rgba(255, 248, 232, 0.96);
  padding: 12px 18px;
  font-size: 1.05rem;
  line-height: 1.25;
  font-weight: 700;
  overflow: visible;
  overflow-wrap: anywhere;
  transform: translateX(-50%);
}

.speech-long {
  align-items: flex-start;
  font-size: 0.98rem;
}

.speech-character {
  width: min(430px, calc(100% - 32px));
  min-height: 58px;
  transform: translate(-50%, -100%);
  z-index: 4;
}

.speech-character::before,
.speech-character::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 0;
  height: 0;
  transform: translateX(-50%);
}

.speech-character::before {
  bottom: -17px;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-top: 17px solid #7a4b20;
}

.speech-character::after {
  bottom: -12px;
  border-left: 11px solid transparent;
  border-right: 11px solid transparent;
  border-top: 13px solid rgba(255, 248, 232, 0.96);
}

.postcard-modal {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(43, 33, 27, 0.34);
  pointer-events: auto;
}

.postcard-modal[hidden] {
  display: none;
}

.postcard-card {
  width: min(780px, calc(100% - 24px));
  min-height: 340px;
  padding: 28px 30px 24px;
  border: 4px solid #b97844;
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.45), transparent 34%),
    #fff2ce;
  color: #4d2c19;
  text-align: center;
  box-shadow: 0 16px 0 rgba(83, 45, 18, 0.2);
}

.postcard-card h2 {
  margin: 0 0 18px;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
}

.postcard-tabs,
.postcard-subtabs {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.postcard-tabs {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 0;
}

.postcard-tab {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 44px;
  border-radius: 8px;
  line-height: 1.12;
  white-space: normal;
  transform: none;
}

.postcard-tab:nth-child(2) {
  transform: none;
}

.postcard-tab:nth-child(3) {
  transform: none;
}

.postcard-tab.is-selected {
  background: #f7c254;
  transform: none;
  z-index: 1;
  box-shadow:
    0 4px 0 #8f5727,
    inset 0 0 0 2px rgba(77, 44, 25, 0.22);
}

.postcard-subtabs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.postcard-subtab {
  display: grid;
  place-items: center;
  padding: 8px 10px;
  font-size: 0.88rem;
  min-height: 38px;
  line-height: 1.12;
  white-space: normal;
}

.postcard-subtab.is-selected {
  background: #f7c254;
  box-shadow:
    0 4px 0 #b87835,
    0 0 0 2px rgba(122, 75, 32, 0.22);
}

.postcard-panels {
  margin-bottom: 18px;
}

.postcard-panel {
  width: min(480px, 100%);
  min-height: 190px;
  margin: 0 auto;
  padding: 14px;
  border: 3px solid rgba(122, 75, 32, 0.62);
  border-radius: 8px;
  background: rgba(255, 248, 232, 0.44);
}

.postcard-panel[hidden] {
  display: none;
}

.postcard-panel h3,
.score-heading {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 900;
}

.postcard-score-list {
  display: grid;
  gap: 8px;
  margin: 0 auto 10px;
  padding: 0;
  list-style-position: inside;
  font-size: 1.08rem;
  font-weight: 900;
  text-align: center;
}

.postcard-score-list li {
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(255, 248, 232, 0.68);
}

.postcard-sandcastle-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(122px, 1fr));
  gap: 12px;
  align-items: start;
}

.postcard-sandcastle-empty {
  margin: 22px 0 12px;
  padding: 16px;
  border: 2px dashed rgba(122, 75, 32, 0.45);
  border-radius: 8px;
  background: rgba(255, 248, 232, 0.58);
  font-weight: 900;
}

.postcard-sandcastle-card {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 8px 8px 10px;
  border: 3px solid #7a4b20;
  border-radius: 4px;
  background: #fff8e8;
  color: #4d2c19;
  font: inherit;
  cursor: pointer;
  box-shadow: 0 5px 0 rgba(83, 45, 18, 0.18);
  transform: rotate(-1deg);
}

.postcard-sandcastle-card:nth-child(even) {
  transform: rotate(1deg);
}

.postcard-sandcastle-card img {
  width: 100%;
  aspect-ratio: 900 / 451;
  object-fit: contain;
  border: 2px solid rgba(122, 75, 32, 0.36);
  border-radius: 3px;
  background: #fff8e8;
}

.postcard-sandcastle-meta {
  display: grid;
  gap: 2px;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.12;
}

.postcard-sandcastle-viewer {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: 18px;
  border-radius: 8px;
  background: rgba(77, 44, 25, 0.34);
}

.postcard-sandcastle-viewer[hidden] {
  display: none;
}

.postcard-sandcastle-viewer-card {
  width: min(660px, 96%);
  padding: 16px;
  border: 4px solid #7a4b20;
  border-radius: 8px;
  background: #fff8e8;
  box-shadow: 0 12px 0 rgba(83, 45, 18, 0.2);
}

.postcard-sandcastle-viewer-card h3 {
  margin: 0 0 10px;
}

.postcard-sandcastle-viewer-card img {
  width: 100%;
  aspect-ratio: 900 / 451;
  object-fit: contain;
  border: 3px solid rgba(122, 75, 32, 0.46);
  border-radius: 4px;
  background: #fff8e8;
}

.postcard-sandcastle-viewer-card p {
  margin: 8px 0 12px;
  font-weight: 900;
}

.today-score {
  display: none;
}

.score-today-row {
  margin-top: 8px;
  padding-top: 12px !important;
  border-top: 2px dashed rgba(122, 75, 32, 0.42);
  list-style: none;
  font-weight: 900;
  color: #5e3217;
}

.score-heading {
  display: none !important;
}

.postcard-card button {
  border: 3px solid #7a4b20;
  border-radius: 8px;
  background: #fff8e8;
  color: var(--ink);
  padding: 10px 14px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 0 #b87835;
}

.postcard-card .postcard-sandcastle-card {
  display: grid;
  width: 100%;
  padding: 8px 8px 10px;
  border-radius: 4px;
  background: #fff8e8;
  color: #4d2c19;
  box-shadow: 0 5px 0 rgba(83, 45, 18, 0.18);
}

.canvas-wrap {
  position: relative;
  width: min(960px, calc(100% - 24px));
  margin: 18px auto 0;
  aspect-ratio: 16 / 9;
  border: 4px solid #7a4b20;
  border-radius: 8px;
  overflow: hidden;
  background: #8fd6ef;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.game-hud {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

.game-hud > span,
.life-row {
  min-width: 92px;
  border: 2px solid #7a4b20;
  border-radius: 8px;
  background: rgba(255, 248, 232, 0.92);
  padding: 8px 10px;
  font-weight: 800;
  text-align: center;
}

.life-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 128px;
}

.life-head {
  position: relative;
  display: inline-block;
  width: 24px;
  height: 20px;
  border: 3px solid #2f1b13;
  border-radius: 50% 48% 45% 45%;
  background: #54301f;
}

.life-head::before {
  content: "";
  position: absolute;
  left: 2px;
  top: -8px;
  width: 9px;
  height: 15px;
  border-radius: 999px;
  background: #2f1b13;
  transform: rotate(-26deg);
}

.life-head::after {
  content: "";
  position: absolute;
  right: -4px;
  top: 6px;
  width: 8px;
  height: 6px;
  border-radius: 50%;
  background: #120d0a;
}

.life-head.is-off {
  background: #17120f;
  border-color: #17120f;
  opacity: 0.72;
  filter: grayscale(1);
}

.life-head.is-off::before,
.life-head.is-off::after {
  background: #17120f;
}

.life-icons-loaded .life-head {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  background-image: var(--life-icons-image);
  background-repeat: no-repeat;
  background-size: 200% 100%;
  filter: none;
  opacity: 1;
}

.life-icons-loaded .life-head::before,
.life-icons-loaded .life-head::after {
  display: none;
}

.life-icons-loaded .life-head.is-lit {
  background-position: 0 0;
}

.life-icons-loaded .life-head.is-off {
  background-position: 100% 0;
}

.pause-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(43, 33, 27, 0.18);
  pointer-events: none;
}

.pause-overlay[hidden] {
  display: none;
}

.pause-card {
  width: min(620px, calc(100% - 20px));
  padding: 16px 18px;
  border: 4px solid #7a4b20;
  border-radius: 8px;
  background: rgba(255, 248, 232, 0.96);
  color: var(--ink);
  box-shadow: 0 8px 0 rgba(83, 45, 18, 0.2);
  pointer-events: auto;
}

.pause-card h2 {
  margin: 0 0 10px;
  text-align: center;
}

.pause-score-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 10px;
}

.pause-score-grid h3 {
  margin: 0 0 6px;
  font-size: 0.95rem;
}

.pause-score-grid ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
  font-size: 0.86rem;
  font-weight: 800;
}

.game-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 12px;
  text-align: center;
  padding: 24px;
  background: rgba(43, 33, 27, 0.46);
  color: #fff8e8;
}

.game-over-overlay {
  background: transparent;
  grid-template-columns: minmax(220px, 320px);
}

.game-overlay[hidden] {
  display: none;
}

.game-overlay h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.game-overlay p {
  max-width: 520px;
  margin: 0;
  font-weight: 700;
}

.game-over-overlay p {
  display: none;
}

.highscore-form {
  display: grid;
  gap: 10px;
  justify-items: center;
}

.highscore-form[hidden],
.highscore-list[hidden] {
  display: none;
}

.highscore-form input {
  width: min(240px, 76vw);
  border: 3px solid #7a4b20;
  border-radius: 8px;
  background: #fff8e8;
  color: var(--ink);
  padding: 10px 12px;
  font: inherit;
  font-weight: 800;
  text-align: center;
}

.highscore-list {
  width: min(248px, 76vw);
  margin: 0 auto;
  padding: 10px 18px;
  border: 3px solid #7a4b20;
  border-radius: 8px;
  background: rgba(255, 248, 232, 0.95);
  color: var(--ink);
  text-align: center;
  font-weight: 900;
  list-style-position: inside;
}

.highscore-list li {
  padding: 3px 0;
}

.highscore-list .score-today-row {
  margin-left: -18px;
  margin-right: -18px;
}

.game-overlay button,
.game-actions button {
  border: 3px solid #7a4b20;
  border-radius: 8px;
  background: #fff8e8;
  color: var(--ink);
  padding: 10px 14px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 0 #b87835;
}

.game-over-overlay #startBucketGame {
  width: 132px;
  justify-self: center;
  padding-left: 10px;
  padding-right: 10px;
}

.game-overlay button:active,
.game-actions button:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #b87835;
}

.game-overlay button:disabled,
.game-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

.game-actions {
  width: min(960px, calc(100% - 24px));
  margin: 12px auto;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

#volleyScene {
  background: #80dfff;
}

.volley-top-controls {
  position: relative;
  z-index: 4;
  width: min(960px, calc(100% - 28px));
  min-height: 58px;
  margin: 12px auto 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.volley-wrap {
  position: relative;
  width: min(960px, 100%);
  height: calc(100% - 82px);
  min-height: 500px;
  margin: 0 auto;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: #80dfff url("assets/backgrounds/beach-volley-background-codex-v1.png") center / cover no-repeat;
  box-shadow: none;
}

#volleyCanvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.volley-top-controls span,
.volley-top-controls button,
.volley-overlay {
  border: 3px solid #7a4b20;
  border-radius: 8px;
  background: rgba(255, 248, 232, 0.94);
  color: var(--ink);
  font-weight: 900;
  box-shadow: 0 5px 0 rgba(83, 45, 18, 0.18);
}

.volley-top-controls span,
.volley-top-controls button {
  padding: 8px 12px;
}

.volley-top-controls button {
  cursor: pointer;
}

.volley-overlay {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  width: min(430px, calc(100% - 32px));
  padding: 18px;
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
  transform: translate(-50%, -50%);
}

.volley-overlay[hidden] {
  display: none;
}

.volley-pause-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(43, 33, 27, 0.18);
}

.volley-pause-overlay[hidden] {
  display: none;
}

.volley-pause-card {
  width: min(460px, calc(100% - 28px));
  display: grid;
  gap: 12px;
  justify-items: center;
  padding: 18px;
  border: 3px solid #7a4b20;
  border-radius: 8px;
  background: rgba(255, 248, 232, 0.96);
  color: var(--ink);
  font-weight: 900;
  text-align: center;
  box-shadow: 0 7px 0 rgba(83, 45, 18, 0.18);
}

.volley-pause-card h2,
.volley-pause-card p {
  margin: 0;
}

.volley-pause-card button {
  border: 3px solid #7a4b20;
  border-radius: 8px;
  background: #ffe38a;
  color: var(--ink);
  padding: 10px 16px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 0 #b87835;
}

.volley-overlay h2,
.volley-overlay p {
  margin: 0;
}

.volley-choice-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.volley-choice-row[hidden] {
  display: none;
}

.volley-choice-row button {
  width: 150px;
  display: grid;
  gap: 7px;
  justify-items: center;
  padding: 8px 10px 10px;
  line-height: 1.05;
}

.volley-select-image {
  width: 118px;
  height: 126px;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 5px 0 rgba(83, 45, 18, 0.18));
}

.volley-overlay button {
  border: 3px solid #7a4b20;
  border-radius: 8px;
  background: #ffe38a;
  color: var(--ink);
  padding: 10px 16px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 0 #b87835;
}

#parasolScene {
  background: #f2c66e url("assets/backgrounds/beach-background-simple-v1.png") center / cover no-repeat;
}

.parasol-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #f2c66e;
}

.parasol-scene-bg {
  position: absolute;
  inset: 0;
  background: #f2c66e url("assets/backgrounds/beach-background-simple-v1.png") center / cover no-repeat;
}

.parasol-scene-bg::after {
  content: "";
  position: absolute;
  inset: 50% 0 0;
  opacity: 0.12;
  background-image:
    radial-gradient(circle, rgba(122, 75, 32, 0.2) 0 2px, transparent 3px);
  background-size: 38px 28px;
}

.parasol-status {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}

.parasol-status span {
  border: 3px solid #7a4b20;
  border-radius: 8px;
  background: rgba(255, 248, 232, 0.95);
  padding: 8px 12px;
  font-weight: 900;
  box-shadow: 0 4px 0 rgba(83, 45, 18, 0.16);
}

.parasol-board-panel {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 8px;
  width: min(500px, calc(100% - 28px));
  margin: 50px auto 0;
  padding: 12px;
  border: 4px solid #7a4b20;
  border-radius: 8px;
  background: rgba(255, 248, 232, 0.74);
  box-shadow: 0 8px 0 rgba(83, 45, 18, 0.18);
}

.parasol-board-panel.is-hidden {
  visibility: hidden;
}

.parasol-board-panel.is-revealing {
  background: rgba(255, 248, 232, 0.88);
}

.parasol-board-panel.is-revealing .parasol-help {
  max-width: 460px;
  padding: 8px 12px;
  border: 3px solid #7a4b20;
  border-radius: 8px;
  background: #fff8e8;
  color: #4b2a17;
}

.parasol-board-panel h2 {
  margin: 0;
  font-size: 1.32rem;
}

.parasol-grid {
  display: grid;
  grid-template-columns: repeat(9, 42px);
  gap: 4px;
  touch-action: manipulation;
}

.parasol-cell {
  width: 42px;
  height: 42px;
  border: 3px solid #7a4b20;
  border-radius: 7px;
  background: #d99a42;
  color: #2b211b;
  font-weight: 900;
  font-size: 1.16rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: inset 0 -5px 0 rgba(122, 75, 32, 0.24);
}

.parasol-cell:hover,
.parasol-cell:focus-visible {
  filter: drop-shadow(0 0 8px rgba(255, 245, 160, 0.94));
}

.parasol-cell.is-open {
  background: #f6d88d;
  box-shadow: inset 0 2px 0 rgba(255, 248, 232, 0.45);
  cursor: default;
}

.parasol-cell.is-flagged {
  background: #f7c254;
}

.parasol-cell.is-danger {
  background: #f6d88d;
}

.parasol-cell.is-triggered-danger {
  border-color: #d12d22;
  box-shadow:
    0 0 0 3px rgba(255, 248, 232, 0.95),
    0 0 18px rgba(209, 45, 34, 0.72),
    inset 0 2px 0 rgba(255, 248, 232, 0.45);
  animation: parasolDangerShake 320ms ease-in-out 0s 3;
}

.parasol-cell.is-wrong-flag {
  background: #d6c1a0;
  opacity: 0.82;
}

.parasol-danger-icon {
  width: 32px;
  height: 32px;
  display: block;
  align-self: center;
  justify-self: center;
  background-image: url("assets/parasol/parasol-hazards-v1.png");
  background-repeat: no-repeat;
  background-size: 300% 100%;
  background-position-y: 50%;
  transform-origin: center;
  filter: drop-shadow(0 2px 0 rgba(83, 45, 18, 0.2));
}

.parasol-danger-cat {
  width: 30px;
  height: 30px;
  background-image: url("assets/parasol/parasol-cat-head-v1.png");
  background-size: contain;
  background-position: center;
  transform: none;
}

.parasol-danger-pit {
  background-position: 50% 50%;
  transform: scale(1.02);
}

.parasol-danger-lettuce {
  background-position: 100% 50%;
  transform: scale(1.02);
}

.parasol-flag-icon {
  position: relative;
  display: block;
  align-self: center;
  justify-self: center;
  width: 32px;
  height: 32px;
  transform: rotate(-8deg);
}

.parasol-flag-icon::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 24px;
  height: 13px;
  border: 3px solid #7a4b20;
  border-bottom: 0;
  border-radius: 18px 18px 2px 2px;
  background:
    linear-gradient(90deg, #fff4ba 0 33%, #e73c3c 33% 66%, #fff4ba 66% 100%);
  box-shadow: inset 0 -3px 0 rgba(122, 75, 32, 0.12);
}

.parasol-flag-icon::after {
  content: "";
  position: absolute;
  left: 15px;
  top: 16px;
  width: 4px;
  height: 14px;
  border-radius: 4px;
  background: #7a4b20;
  box-shadow: 4px 11px 0 -1px #7a4b20;
}

.parasol-cell[data-count="1"] { color: #1f6fb2; }
.parasol-cell[data-count="2"] { color: #248348; }
.parasol-cell[data-count="3"] { color: #c0392b; }
.parasol-cell[data-count="4"],
.parasol-cell[data-count="5"],
.parasol-cell[data-count="6"],
.parasol-cell[data-count="7"],
.parasol-cell[data-count="8"] { color: #7a2d8f; }

.parasol-help {
  margin: 0;
  max-width: 390px;
  font-size: 0.84rem;
  font-weight: 800;
  text-align: center;
}

.parasol-reveal-continue {
  border: 3px solid #7a4b20;
  border-radius: 8px;
  background: #fff8e8;
  color: var(--ink);
  padding: 10px 16px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 0 #b87835;
}

.parasol-reveal-continue:hover,
.parasol-reveal-continue:focus-visible {
  transform: translateY(-2px);
  filter: drop-shadow(0 0 8px rgba(255, 245, 160, 0.94));
}

@keyframes parasolDangerShake {
  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-2px);
  }

  75% {
    transform: translateX(2px);
  }
}

.parasol-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(43, 33, 27, 0.28);
  text-align: center;
  overflow: auto;
}

.parasol-overlay[hidden] {
  display: none;
}

.parasol-card {
  width: min(660px, calc(100% - 24px));
  display: grid;
  justify-items: center;
  gap: 12px;
}

#parasolIntro .parasol-card {
  position: relative;
  min-height: 410px;
  align-content: start;
  padding-bottom: 150px;
}

.parasol-card h2,
.parasol-card p,
.parasol-bubble {
  margin: 0;
  border: 3px solid #7a4b20;
  border-radius: 8px;
  background: rgba(255, 248, 232, 0.96);
  color: var(--ink);
  box-shadow: 0 6px 0 rgba(83, 45, 18, 0.18);
}

.parasol-card h2 {
  padding: 12px 18px;
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.parasol-card p,
.parasol-bubble {
  max-width: 520px;
  padding: 12px 16px;
  font-weight: 900;
  line-height: 1.25;
  white-space: pre-line;
}

.parasol-bubble {
  position: relative;
  --tail-left: 62px;
}

.parasol-bubble::before,
.parasol-bubble::after {
  content: "";
  position: absolute;
  left: var(--tail-left);
  width: 0;
  height: 0;
  transform: translateX(-50%);
}

.parasol-bubble::before {
  bottom: -17px;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-top: 17px solid #7a4b20;
}

.parasol-bubble::after {
  bottom: -12px;
  border-left: 11px solid transparent;
  border-right: 11px solid transparent;
  border-top: 13px solid rgba(255, 248, 232, 0.96);
}

.parasol-difficulty {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 560px;
}

.parasol-difficulty-button {
  position: relative;
  min-width: 142px;
}

.parasol-difficulty-button.is-selected {
  background: #f4b846;
  border-color: #4d2c19;
  box-shadow:
    0 5px 0 #8f5727,
    0 0 14px rgba(184, 120, 53, 0.48);
  transform: translateY(-2px);
}

.parasol-difficulty-button.is-selected::before {
  content: none;
}

.parasol-grisen {
  width: 222px;
  aspect-ratio: 560 / 640;
  background-image: url("assets/characters/shade-sprites-v3.png");
  background-repeat: no-repeat;
  background-size: 400% 100%;
  background-position: 0 50%;
  filter: drop-shadow(0 7px 0 rgba(83, 45, 18, 0.2));
}

#parasolIntro .parasol-bubble,
#parasolIntro .parasol-difficulty,
#parasolIntro #startParasolGame {
  position: relative;
  z-index: 2;
}

#parasolIntro .parasol-grisen {
  position: absolute;
  left: 50%;
  bottom: 6px;
  z-index: 1;
  transform: translateX(-50%);
}

.parasol-overlay button {
  border: 3px solid #7a4b20;
  border-radius: 8px;
  background: #fff8e8;
  color: var(--ink);
  padding: 10px 16px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 0 #b87835;
}

.parasol-result-scene {
  width: min(520px, 100%);
  aspect-ratio: 16 / 10;
  min-height: 180px;
  border: 3px solid #7a4b20;
  border-radius: 8px;
  background-color: rgba(255, 239, 180, 0.9);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  box-shadow: 0 6px 0 rgba(83, 45, 18, 0.18);
}

.parasol-result-scene.result-win {
  background-image: url("assets/end-scenes/parasollroj-end-victory-toffi-safe-v1.png");
}

.parasol-result-scene.result-cat {
  background-image: url("assets/end-scenes/parasollroj-end-loss-cat-v1.png");
}

.parasol-result-scene.result-pit {
  background-image: url("assets/end-scenes/parasollroj-end-loss-hole-v2.png");
}

.parasol-result-scene.result-lettuce {
  background-image: url("assets/end-scenes/parasollroj-end-loss-salad-v3.png");
}

.parasol-result-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.parasol-result .parasol-card {
  max-height: 100%;
  overflow: auto;
  gap: 8px;
  padding: 4px 0;
}

.parasol-result .score-heading,
.parasol-result .today-score {
  margin-top: 2px;
}

.parasol-result .highscore-list {
  max-height: 118px;
  overflow: auto;
}

.parasol-result.is-win-score .parasol-card {
  width: min(520px, calc(100% - 24px));
  gap: 12px;
}

.parasol-result.is-win-score .highscore-list {
  max-height: 180px;
}

.parasol-result.is-win-scene .parasol-card {
  width: min(720px, calc(100% - 24px));
}

.parasol-result.is-win-scene .parasol-result-scene {
  width: min(640px, 100%);
  aspect-ratio: 16 / 9;
}

.drink-wrap {
  --drink-grisen-left: 58%;
  --drink-grisen-top: 34%;
  --drink-grisen-width: min(250px, 24vw);
  --drink-toffi-left: 3.5%;
  --drink-toffi-bottom: -28px;
  --drink-toffi-width: min(285px, 27vw);
  --drink-counter-height: 46%;
  --drink-board-bottom: 96px;
  --drink-slot-icon-bottom: -15px;
  position: relative;
  width: min(1060px, calc(100% - 24px));
  height: calc(100% - 76px);
  min-height: 560px;
  margin: 12px auto 0;
  overflow: hidden;
  border: 4px solid #7a4b20;
  border-radius: 8px;
  background: #f3c96e;
}

.drink-scene-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.drink-character-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.drink-grisen-shaker {
  position: absolute;
  left: var(--drink-grisen-left);
  top: var(--drink-grisen-top);
  z-index: 1;
  width: var(--drink-grisen-width);
  aspect-ratio: 640 / 816;
  background-image: url("assets/characters/drink-grisen-shaker-retro-v3.png");
  background-repeat: no-repeat;
  background-size: 300% 100%;
  background-position: 0 0;
  transform: translateX(-50%);
}

.drink-grisen-shaker[data-frame="1"] {
  background-position: 50% 0;
}

.drink-grisen-shaker[data-frame="2"] {
  background-position: 100% 0;
}

.drink-toffi-reaction {
  position: absolute;
  left: var(--drink-toffi-left);
  bottom: var(--drink-toffi-bottom);
  z-index: 3;
  width: var(--drink-toffi-width);
  aspect-ratio: 440 / 802;
  overflow: hidden;
  filter: drop-shadow(0 8px 0 rgba(83, 45, 18, 0.2));
}

.drink-toffi-sheet {
  position: absolute;
  top: 0;
  left: 0;
  width: 500%;
  height: 100%;
  max-width: none;
  object-fit: fill;
}

.drink-bar-counter {
  position: absolute;
  left: 50%;
  bottom: 0;
  z-index: 2;
  width: 104%;
  height: var(--drink-counter-height);
  object-fit: fill;
  object-position: center bottom;
  transform: translateX(-50%);
  pointer-events: none;
}

.drink-toffi-reaction[data-reaction="1"] {
  background-position: 0 0;
}

.drink-toffi-reaction[data-reaction="1"] .drink-toffi-sheet {
  transform: translateX(-20%);
}

.drink-toffi-reaction[data-reaction="2"] .drink-toffi-sheet {
  transform: translateX(-40%);
}

.drink-toffi-reaction[data-reaction="3"] .drink-toffi-sheet {
  transform: translateX(-60%);
}

.drink-toffi-reaction[data-reaction="4"] .drink-toffi-sheet {
  transform: translateX(-80%);
}

.drink-dialog,
.drink-ambient-bubble,
.drink-status,
.drink-board,
.ingredient-palette,
.drink-history-panel,
.drink-feedback,
.drink-result,
.drink-intro {
  position: absolute;
  z-index: 2;
}

.drink-dialog {
  top: 14px;
  left: 50%;
  width: fit-content;
  max-width: calc(100% - 36px);
  box-sizing: border-box;
  padding: 12px 18px;
  border: 3px solid #7a4b20;
  border-radius: 8px;
  background: rgba(255, 248, 232, 0.95);
  font-weight: 900;
  text-align: center;
  transform: translateX(-50%);
}

.drink-wrap.drink-is-intro .drink-dialog,
.drink-wrap.drink-is-intro .drink-status,
.drink-wrap.drink-is-intro .drink-board,
.drink-wrap.drink-is-intro .ingredient-palette,
.drink-wrap.drink-is-intro .drink-feedback,
.drink-wrap.drink-is-intro .drink-history-panel {
  display: none;
}

.drink-wrap.drink-is-result .drink-dialog,
.drink-wrap.drink-is-result .drink-status,
.drink-wrap.drink-is-result .drink-board,
.drink-wrap.drink-is-result .ingredient-palette,
.drink-wrap.drink-is-result .drink-feedback,
.drink-wrap.drink-is-result .drink-history-panel {
  display: none;
}

.drink-ambient-bubble {
  left: 50%;
  top: 78px;
  width: min(440px, calc(100% - 36px));
  padding: 11px 14px;
  border: 3px solid #7a4b20;
  border-radius: 8px;
  background: rgba(255, 248, 232, 0.96);
  font-size: 0.96rem;
  font-weight: 900;
  text-align: center;
  transform: translateX(-50%);
  filter: drop-shadow(0 5px 0 rgba(83, 45, 18, 0.18));
}

.drink-ambient-bubble[hidden] {
  display: none;
}

.drink-status {
  top: 82px;
  left: 18px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.drink-status span {
  padding: 8px 10px;
  border: 3px solid #7a4b20;
  border-radius: 8px;
  background: rgba(255, 248, 232, 0.95);
  font-weight: 900;
}

.drink-board {
  left: 50%;
  bottom: var(--drink-board-bottom);
  display: grid;
  justify-items: center;
  gap: 10px;
  transform: translateX(-50%);
}

.drink-slots {
  display: flex;
  align-items: flex-end;
  gap: 1px;
}

.drink-slot {
  position: relative;
  width: 76px;
  height: 86px;
  border: 3px solid transparent;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  isolation: isolate;
  overflow: visible;
}

.drink-slot::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 5px;
  z-index: 0;
  width: 62px;
  height: 18px;
  border-radius: 50%;
  background: transparent;
  transform: translateX(-50%);
}

.drink-slot.is-active::before {
  background: rgba(255, 232, 73, 0.86);
  box-shadow: 0 0 16px rgba(255, 232, 73, 0.95);
}

.drink-slot.is-locked {
  border-color: rgba(22, 143, 79, 0.34);
  background: transparent;
  filter: drop-shadow(0 0 11px rgba(72, 215, 117, 0.9));
}

.drink-slot.is-locked::before {
  background: rgba(80, 221, 112, 0.7);
  box-shadow: 0 0 18px rgba(72, 215, 117, 0.9);
}

.drink-slot::after {
  content: none;
  position: absolute;
  left: 50%;
  bottom: -28px;
  min-width: 58px;
  color: #2b211b;
  font-size: 0.78rem;
  font-weight: 900;
  text-align: center;
  transform: translateX(-50%);
  z-index: 2;
}

.ingredient-icon {
  display: block;
  width: 100%;
  height: 100%;
  background-image: url("assets/objects/drink-ingredients-repacked-v2.png");
  background-size: 800% 100%;
  background-repeat: no-repeat;
  background-color: transparent;
}

.drink-slot .ingredient-icon {
  position: absolute;
  left: 50%;
  bottom: var(--drink-slot-icon-bottom);
  width: 92px;
  height: 88px;
  transform: translateX(-50%);
  transform-origin: 50% 100%;
  z-index: 1;
}

.ingredient-palette {
  left: 50%;
  bottom: 18px;
  display: grid;
  grid-template-columns: repeat(8, 66px);
  gap: 8px;
  transform: translateX(-50%);
}

.ingredient-button {
  width: 70px;
  height: 68px;
  padding: 0;
  border: 3px solid #7a4b20;
  border-radius: 10px;
  background: rgba(255, 248, 232, 0.95);
  cursor: pointer;
  box-shadow: 0 4px 0 #b87835;
}

.ingredient-button:hover,
.ingredient-button:focus-visible {
  filter: drop-shadow(0 0 9px rgba(255, 245, 160, 0.94));
  transform: translateY(-3px) scale(1.03);
}

#blendDrink,
#clearDrinkGuess {
  border: 3px solid #7a4b20;
  border-radius: 8px;
  background: #fff8e8;
  color: var(--ink);
  padding: 10px 18px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 0 #b87835;
}

.drink-action-row {
  display: flex;
  justify-content: center;
  gap: 10px;
}

#blendDrink:disabled,
#clearDrinkGuess:disabled,
.ingredient-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.drink-feedback {
  --tail-left: 28px;
  left: min(290px, 31%);
  top: 142px;
  max-width: 170px;
  min-width: 116px;
  padding: 10px 14px;
  border: 3px solid #7a4b20;
  border-radius: 8px;
  background: rgba(255, 248, 232, 0.96);
  font-size: 1.28rem;
  font-weight: 900;
  text-align: center;
  transform: rotate(-2deg);
  filter: drop-shadow(0 5px 0 rgba(83, 45, 18, 0.18));
}

.drink-feedback::before,
.drink-feedback::after {
  content: "";
  position: absolute;
  left: var(--tail-left);
  width: 0;
  height: 0;
  transform: translateX(-50%);
}

.drink-feedback::before {
  bottom: -17px;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-top: 17px solid #7a4b20;
}

.drink-feedback::after {
  bottom: -12px;
  border-left: 11px solid transparent;
  border-right: 11px solid transparent;
  border-top: 13px solid rgba(255, 248, 232, 0.96);
}

.drink-feedback:empty {
  display: none;
}

.drink-history-panel {
  top: 82px;
  right: 18px;
  width: 292px;
  max-height: 312px;
  padding: 10px;
  border: 3px solid #7a4b20;
  border-radius: 8px;
  background: rgba(255, 248, 232, 0.9);
  overflow-y: auto;
  overflow-x: hidden;
}

.drink-history-panel h2 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.drink-history {
  display: grid;
  gap: 8px;
}

.history-empty {
  margin: 0;
  font-weight: 800;
}

.history-row {
  display: grid;
  gap: 7px;
  padding: 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.52);
}

.history-icons,
.history-results {
  display: grid;
  grid-template-columns: repeat(5, 44px);
  gap: 6px;
  justify-content: center;
}

.history-icon {
  width: 44px;
  height: 42px;
}

.history-results span {
  width: 44px;
  padding: 2px 4px;
  border-radius: 4px;
  background: rgba(255, 248, 232, 0.9);
  font-size: 0.66rem;
  font-weight: 900;
  text-align: center;
}

.history-results span[data-result="MUMS"] {
  background: #d7ffd9;
  color: #116f3a;
}

.history-results span[data-result="Nästan"] {
  background: #fff1b8;
  color: #6b4a00;
}

.history-results span[data-result="Blä!"] {
  background: #ffd4d4;
  color: #8a1f1f;
}

.drink-result {
  inset: 0;
  z-index: 5;
  display: grid;
  place-content: center;
  gap: 12px;
  padding: 24px;
  background: rgba(43, 33, 27, 0.42);
  text-align: center;
}

.drink-result[hidden] {
  display: none;
}

.drink-result h2,
.drink-result p,
.drink-result form,
.drink-result ol {
  width: min(320px, 82vw);
  margin-left: auto;
  margin-right: auto;
}

.drink-result h2,
.drink-result p {
  width: min(380px, 86vw);
  border-left: 3px solid #7a4b20;
  border-right: 3px solid #7a4b20;
  background: rgba(255, 248, 232, 0.96);
  color: var(--ink);
}

.drink-result h2 {
  margin-bottom: 0;
  padding: 14px 16px 4px;
  border-top: 3px solid #7a4b20;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.drink-result p {
  margin-top: -12px;
  margin-bottom: 6px;
  padding: 2px 16px 14px;
  border-top: 0;
  border-bottom: 3px solid #7a4b20;
  border-radius: 0 0 8px 8px;
  font-weight: 900;
  box-shadow: 0 6px 0 rgba(83, 45, 18, 0.18);
}

.drink-result button {
  border: 3px solid #7a4b20;
  border-radius: 8px;
  background: #fff8e8;
  color: var(--ink);
  padding: 9px 14px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 0 #b87835;
}

.drink-intro {
  inset: 0;
  display: block;
  padding: 0;
  background: transparent;
  pointer-events: none;
}

.drink-intro[hidden] {
  display: none;
}

.drink-intro-card {
  position: absolute;
  inset: 0;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  pointer-events: none;
}

.drink-intro-card h2 {
  display: none;
}

.drink-intro-step {
  position: absolute;
  inset: 0;
  display: block;
  pointer-events: none;
}

.drink-intro-step[hidden] {
  display: none;
}

.intro-bubble {
  --tail-left: 42px;
  position: absolute;
  margin: 0;
  padding: 12px 14px;
  border: 3px solid #7a4b20;
  border-radius: 8px;
  background: rgba(255, 248, 232, 0.96);
  font-weight: 800;
  line-height: 1.35;
  filter: drop-shadow(0 5px 0 rgba(83, 45, 18, 0.18));
  pointer-events: auto;
}

.intro-bubble::before,
.intro-bubble::after {
  content: "";
  position: absolute;
  left: var(--tail-left);
  width: 0;
  height: 0;
  transform: translateX(-50%);
}

.intro-bubble::before {
  bottom: -17px;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-top: 17px solid #7a4b20;
}

.intro-bubble::after {
  bottom: -12px;
  border-left: 11px solid transparent;
  border-right: 11px solid transparent;
  border-top: 13px solid rgba(255, 248, 232, 0.96);
}

.intro-bubble-toffi {
  --tail-left: 44px;
  left: 24%;
  top: 17%;
  width: min(340px, 32%);
}

.intro-bubble-grisen {
  --tail-left: 64px;
  left: 59%;
  top: 7%;
  width: min(350px, 34%);
}

.intro-bubble-rules {
  --tail-left: 64px;
  left: 56%;
  top: 8%;
  width: min(410px, 39%);
}

.drink-intro-card button {
  position: absolute;
  left: 50%;
  bottom: 78px;
  display: block;
  width: 150px;
  margin: 0;
  border: 3px solid #7a4b20;
  border-radius: 8px;
  background: #fff8e8;
  color: var(--ink);
  padding: 10px 16px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 0 #b87835;
  transform: translateX(-50%);
  pointer-events: auto;
}

.sandcastle-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 640px;
  padding: 18px;
  background:
    linear-gradient(rgba(255, 245, 206, 0.16), rgba(255, 245, 206, 0.16)),
    url("assets/backgrounds/beach-background-simple-v1.png") center / cover no-repeat;
}

.sandcastle-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(900px, 100%);
  margin: 0 auto 12px;
  padding: 12px 16px;
  border: 3px solid #7a4b20;
  border-radius: 8px;
  background: rgba(255, 248, 232, 0.94);
  box-shadow: 0 6px 0 rgba(83, 45, 18, 0.16);
}

.sandcastle-header h2,
.sandcastle-header p {
  margin: 0;
}

.sandcastle-header h2 {
  font-size: 1.35rem;
}

.sandcastle-header p,
#sandcastleCount {
  font-weight: 800;
}

#sandcastleCount {
  white-space: nowrap;
  color: #7a4b20;
}

.sandcastle-build-area {
  position: relative;
  width: min(900px, 100%);
  height: 330px;
  margin: 0 auto 12px;
  overflow: hidden;
  border: 4px solid #9b6028;
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 245, 206, 0.08), rgba(255, 245, 206, 0.08)),
    url("assets/backgrounds/sandcastle-builder-background-simple-v1.png") center / cover no-repeat,
    linear-gradient(180deg, #f6d48a 0%, #e9b961 100%);
  box-shadow: inset 0 10px 0 rgba(255, 255, 255, 0.22), 0 8px 0 rgba(83, 45, 18, 0.16);
  cursor: crosshair;
  touch-action: none;
}

.sandcastle-build-area::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 2px dashed rgba(122, 75, 32, 0.24);
  border-radius: 10px;
  pointer-events: none;
}

.sandcastle-toolbar,
.sandcastle-actions {
  width: min(900px, 100%);
  margin: 0 auto;
}

.sandcastle-toolbar {
  display: grid;
  grid-template-columns: repeat(8, minmax(72px, 1fr));
  gap: 8px;
  padding: 10px;
  border: 3px solid #7a4b20;
  border-radius: 8px;
  background: rgba(255, 248, 232, 0.94);
}

.sandcastle-tool {
  min-height: 84px;
  padding: 7px 4px;
  border: 3px solid #d49a4b;
  border-radius: 8px;
  background: #fff4ba;
  color: #4b2a17;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.05;
  transition: transform 130ms ease, filter 130ms ease, background 130ms ease;
}

.sandcastle-tool:hover,
.sandcastle-tool:focus-visible {
  transform: translateY(-3px) scale(1.02);
  filter: drop-shadow(0 0 8px rgba(255, 245, 160, 0.9));
}

.sandcastle-tool.is-selected {
  border-color: #7a4b20;
  background: #ffe38a;
  box-shadow: inset 0 0 0 2px rgba(122, 75, 32, 0.16);
}

.sandcastle-tool-icon {
  display: block;
  margin: 0 auto 5px;
  transform: none;
}

.sandcastle-actions,
.sandcastle-finish-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.sandcastle-actions {
  margin-top: 12px;
}

.sandcastle-actions button,
.sandcastle-finish-actions button {
  border: 3px solid #7a4b20;
  border-radius: 8px;
  background: #fff8e8;
  color: #4b2a17;
  padding: 9px 14px;
  font-weight: 900;
  cursor: pointer;
}

.sandcastle-actions button:hover,
.sandcastle-actions button:focus-visible,
.sandcastle-finish-actions button:hover,
.sandcastle-finish-actions button:focus-visible {
  background: #ffe38a;
}

.sandcastle-actions button:disabled {
  cursor: default;
  opacity: 0.45;
}

.sandcastle-piece {
  position: absolute;
  transform: translate(-50%, -50%) rotate(var(--piece-rotation, 0deg));
  pointer-events: none;
  touch-action: none;
  user-select: none;
}

.sandcastle-piece-hitbox {
  position: absolute;
  z-index: 12;
  width: var(--hitbox-width, 54px);
  height: var(--hitbox-height, 64px);
  transform: translate(-50%, -50%) rotate(var(--piece-rotation, 0deg));
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.sandcastle-piece.is-dragging {
  z-index: 10;
  filter: drop-shadow(0 0 12px rgba(255, 245, 160, 0.95)) drop-shadow(0 6px 0 rgba(83, 45, 18, 0.16));
}

.sandcastle-piece-hitbox:active {
  cursor: grabbing;
}

.sandcastle-placement-preview {
  z-index: 4;
  opacity: 0.58;
  pointer-events: none;
  filter: drop-shadow(0 0 10px rgba(255, 245, 160, 0.9));
}

.sandcastle-photo-piece {
  position: absolute;
  transform: translate(-50%, -50%) rotate(var(--piece-rotation, 0deg)) scale(0.72);
  pointer-events: none;
}

.sandcastle-part {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 48px;
}

.sandcastle-piece.sandcastle-part {
  position: absolute;
}

.sandcastle-asset-part {
  width: 74px;
  height: 98px;
  border: 0 !important;
  border-radius: 0 !important;
  background-color: transparent !important;
  background-image: var(--sandcastle-piece-image) !important;
  background-repeat: no-repeat !important;
  background-size: 400% 200% !important;
  background-position: var(--sandcastle-piece-x) var(--sandcastle-piece-y) !important;
  box-shadow: none !important;
  clip-path: none !important;
  filter: drop-shadow(0 4px 0 rgba(83, 45, 18, 0.14));
}

.sandcastle-tool-icon.sandcastle-asset-part {
  width: 42px;
  height: 56px;
}

.sandcastle-photo-piece.sandcastle-asset-part {
  width: 70px;
  height: 94px;
}

.sandcastle-asset-part::before,
.sandcastle-asset-part::after {
  content: none !important;
}

.sandcastle-part-square {
  border: 3px solid #a96b2c;
  border-radius: 7px;
  background: linear-gradient(#f5d28a, #d79b43);
  box-shadow: inset 0 5px 0 rgba(255, 255, 255, 0.25);
}

.sandcastle-part-rect-tall {
  width: 38px;
  height: 62px;
  border: 3px solid #a96b2c;
  border-radius: 8px;
  background: linear-gradient(#f5d28a, #d79b43);
  box-shadow: inset 0 6px 0 rgba(255, 255, 255, 0.24);
}

.sandcastle-part-rect-wide {
  width: 66px;
  height: 36px;
  border: 3px solid #a96b2c;
  border-radius: 8px;
  background: linear-gradient(#f5d28a, #d79b43);
  box-shadow: inset 0 5px 0 rgba(255, 255, 255, 0.24);
}

.sandcastle-part-cylinder {
  width: 44px;
  height: 58px;
  border: 3px solid #a96b2c;
  border-radius: 50% / 16%;
  background: linear-gradient(#f7d995, #d79b43);
}

.sandcastle-part-cylinder::before {
  content: "";
  position: absolute;
  left: -3px;
  right: -3px;
  top: -3px;
  height: 16px;
  border: 3px solid #a96b2c;
  border-radius: 50%;
  background: #f8dda0;
}

.sandcastle-part-shell-pink,
.sandcastle-part-shell-blue {
  width: 46px;
  height: 34px;
  border: 3px solid #7a4b20;
  border-radius: 50% 50% 10px 10px;
}

.sandcastle-part-shell-pink {
  background: repeating-radial-gradient(circle at 50% 90%, #ffd2df 0 6px, #f08ca9 7px 10px);
}

.sandcastle-part-shell-blue {
  background: repeating-radial-gradient(circle at 50% 90%, #c9f1ff 0 6px, #58b4d4 7px 10px);
}

.sandcastle-part-starfish {
  width: 50px;
  height: 50px;
  background: #f08045;
  clip-path: polygon(50% 3%, 61% 35%, 96% 35%, 68% 55%, 80% 90%, 50% 68%, 20% 90%, 32% 55%, 4% 35%, 39% 35%);
  filter: drop-shadow(0 2px 0 #9f552c);
}

.sandcastle-part-flag-t {
  width: 34px;
  height: 66px;
}

.sandcastle-part-flag-t::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 8px;
  width: 5px;
  height: 56px;
  border-radius: 4px;
  background: #7a4b20;
}

.sandcastle-part-flag-t::after {
  content: "T";
  position: absolute;
  left: 18px;
  top: 6px;
  width: 34px;
  height: 24px;
  border: 3px solid #7a4b20;
  border-left: 0;
  border-radius: 0 6px 6px 0;
  background: #e33232;
  color: #fff8e8;
  font-size: 1rem;
  font-weight: 900;
  line-height: 22px;
  text-align: center;
}

.sandcastle-finish-modal {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(62, 38, 22, 0.18);
}

.sandcastle-finish-modal[hidden] {
  display: none;
}

.sandcastle-photo-scene {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(62, 38, 22, 0.2);
}

.sandcastle-photo-scene[hidden] {
  display: none;
}

.sandcastle-photo-card {
  position: relative;
  width: min(820px, 100%);
  min-height: 500px;
  padding: 18px 18px 20px;
  overflow: hidden;
  border: 4px solid #7a4b20;
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 248, 232, 0.22), rgba(255, 248, 232, 0.22)),
    url("assets/backgrounds/sandcastle-builder-background-simple-v1.png") center / cover no-repeat;
  box-shadow: 0 10px 0 rgba(83, 45, 18, 0.18);
  text-align: center;
}

.sandcastle-photo-card h2,
.sandcastle-photo-card p {
  position: relative;
  z-index: 4;
  margin: 0;
  color: #4b2a17;
  text-shadow: 0 2px 0 rgba(255, 248, 232, 0.8);
}

.sandcastle-photo-card h2 {
  font-size: 2rem;
}

.sandcastle-photo-card p {
  margin-top: 4px;
  font-size: 1.05rem;
  font-weight: 900;
}

.sandcastle-photo-preview {
  position: absolute;
  left: 25%;
  right: 24%;
  bottom: 94px;
  height: 250px;
  z-index: 2;
}

.sandcastle-photo-toffi,
.sandcastle-photo-grisen {
  position: absolute;
  z-index: 3;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.sandcastle-photo-toffi {
  left: 1%;
  bottom: 52px;
  width: min(250px, 31%);
}

.sandcastle-photo-grisen {
  right: 2%;
  bottom: 58px;
  width: min(220px, 28%);
}

.sandcastle-photo-card .sandcastle-finish-actions {
  position: absolute;
  left: 50%;
  bottom: 20px;
  z-index: 4;
  width: min(420px, calc(100% - 24px));
  transform: translateX(-50%);
}

.sandcastle-finish-card {
  width: min(440px, 100%);
  padding: 20px;
  border: 4px solid #7a4b20;
  border-radius: 8px;
  background: rgba(255, 248, 232, 0.98);
  box-shadow: 0 10px 0 rgba(83, 45, 18, 0.18);
  text-align: center;
}

.sandcastle-finish-card h2 {
  margin: 0 0 10px;
}

.sandcastle-finish-card p {
  margin: 0 0 16px;
  font-size: 1.08rem;
  font-weight: 900;
  line-height: 1.3;
}

/* Sandslottsbyggaren v1.3.3: sidomeny och fotoflöde i samma scen. */
.sandcastle-wrap {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
  min-height: 640px;
  background:
    linear-gradient(rgba(255, 245, 206, 0.08), rgba(255, 245, 206, 0.08)),
    url("assets/backgrounds/beach-background-simple-v1.png") center / cover no-repeat;
}

.sandcastle-header {
  width: fit-content;
  max-width: min(980px, 100%);
  margin-bottom: 0;
  text-align: center;
}

.sandcastle-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 14px;
  width: min(980px, 100%);
  min-height: 396px;
  margin: 0 auto;
}

.sandcastle-build-area {
  width: calc(100% - 92px);
  height: 100%;
  min-height: 396px;
  margin: 0 0 0 92px;
  border: 3px dashed rgba(122, 75, 32, 0.45);
  background: rgba(255, 236, 174, 0.18);
  box-shadow: inset 0 0 0 999px rgba(255, 229, 150, 0.05);
}

.sandcastle-build-area::before {
  display: none;
}

.sandcastle-side-panel {
  position: relative;
  min-height: 396px;
  padding: 10px;
  border: 3px solid #7a4b20;
  border-radius: 8px;
  background: rgba(255, 248, 232, 0.92);
  box-shadow: 0 7px 0 rgba(83, 45, 18, 0.14);
}

.sandcastle-wrap[data-mode="review"] .sandcastle-side-panel,
.sandcastle-wrap[data-mode="photo"] .sandcastle-side-panel,
.sandcastle-wrap[data-mode="polaroid"] .sandcastle-side-panel {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.sandcastle-toolbar {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
}

.sandcastle-tool {
  display: grid;
  grid-template-rows: 52px auto;
  align-items: center;
  justify-items: center;
  min-height: 74px;
  padding: 4px 3px;
  font-size: 0.62rem;
  text-align: center;
}

.sandcastle-tool-icon {
  margin: 0;
}

.sandcastle-tool-icon.sandcastle-asset-part {
  width: 48px;
  height: 56px;
}

.sandcastle-png-part {
  width: 74px;
  height: 98px;
  border: 0 !important;
  border-radius: 0 !important;
  background-color: transparent !important;
  background-image: var(--sandcastle-png-image) !important;
  background-repeat: no-repeat !important;
  background-size: contain !important;
  background-position: center bottom !important;
  box-shadow: none !important;
  clip-path: none !important;
  filter: drop-shadow(0 4px 0 rgba(83, 45, 18, 0.14));
}

.sandcastle-tool-icon.sandcastle-png-part {
  width: 48px;
  height: 56px;
}

.sandcastle-piece.sandcastle-asset-part {
  width: 86px;
  height: 110px;
}

.sandcastle-piece.sandcastle-png-part {
  width: 86px;
  height: 110px;
}

.sandcastle-photo-piece.sandcastle-png-part {
  width: 70px;
  height: 94px;
}

.sandcastle-png-part::before,
.sandcastle-png-part::after {
  content: none !important;
}

.sandcastle-piece.sandcastle-part-shell-pink,
.sandcastle-piece.sandcastle-part-shell-blue,
.sandcastle-piece.sandcastle-part-starfish {
  width: 58px;
  height: 76px;
}

.sandcastle-piece.sandcastle-part-flag-t {
  width: 76px;
  height: 116px;
}

.sandcastle-action-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.sandcastle-action-group[hidden],
.sandcastle-toolbar[hidden],
.sandcastle-camera-prompt[hidden],
.sandcastle-polaroid[hidden],
.sandcastle-photo-toffi[hidden],
.sandcastle-flash[hidden] {
  display: none !important;
}

.sandcastle-camera-prompt {
  position: absolute;
  inset: 8px;
  display: grid;
  grid-template-rows: auto auto;
  align-items: start;
  justify-items: center;
  align-content: start;
  gap: 6px;
}

.sandcastle-camera-prompt img {
  width: min(205px, 108%);
  max-height: 250px;
  object-fit: contain;
  grid-row: 2;
  filter: drop-shadow(0 6px 0 rgba(83, 45, 18, 0.16));
}

.sandcastle-camera-prompt p {
  position: relative;
  grid-row: 1;
  margin: 0 0 8px;
  padding: 10px 12px;
  border: 3px solid #7a4b20;
  border-radius: 8px;
  background: rgba(255, 248, 232, 0.98);
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
}

.sandcastle-camera-prompt p::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -9px;
  width: 14px;
  height: 14px;
  border-right: 3px solid #7a4b20;
  border-bottom: 3px solid #7a4b20;
  background: rgba(255, 248, 232, 0.98);
  transform: translateX(-50%) rotate(45deg);
}

.sandcastle-wrap[data-mode="review"] .sandcastle-build-area,
.sandcastle-wrap[data-mode="photo"] .sandcastle-build-area,
.sandcastle-wrap[data-mode="polaroid"] .sandcastle-build-area {
  cursor: default;
}

.sandcastle-wrap[data-mode="review"] .sandcastle-actions,
.sandcastle-wrap[data-mode="photo"] .sandcastle-actions {
  position: absolute;
  z-index: 6;
  width: 150px;
  margin: 0;
}

.sandcastle-wrap[data-mode="polaroid"] #sandcastlePhotoActions {
  display: none !important;
}

.sandcastle-wrap[data-mode="review"] #sandcastlePhotoActions,
.sandcastle-wrap[data-mode="photo"] #sandcastlePhotoActions {
  display: grid;
  justify-content: stretch;
}

.sandcastle-photo-toffi {
  position: absolute;
  left: 1.5%;
  bottom: 74px;
  z-index: 3;
  width: min(270px, 26%);
  object-fit: contain;
  filter: drop-shadow(0 6px 0 rgba(83, 45, 18, 0.14));
  animation: sandcastle-toffi-enter 520ms ease-out both;
}

@keyframes sandcastle-toffi-enter {
  from {
    opacity: 0;
    transform: translateX(-34px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.sandcastle-flash {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  background: rgba(255, 255, 255, 0);
}

.sandcastle-flash.is-flashing {
  animation: sandcastle-flash 900ms ease-out;
}

@keyframes sandcastle-flash {
  0%,
  100% {
    background: rgba(255, 255, 255, 0);
  }
  18% {
    background: rgba(255, 255, 255, 0.92);
  }
  45% {
    background: rgba(255, 255, 255, 0.36);
  }
}

.sandcastle-polaroid {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(62, 38, 22, 0.18);
}

.sandcastle-polaroid-card {
  width: min(440px, 96%);
  padding: 16px 16px 18px;
  border: 4px solid #7a4b20;
  border-radius: 6px;
  background: #fffaf0;
  box-shadow: 0 12px 0 rgba(83, 45, 18, 0.18);
  text-align: center;
}

.sandcastle-polaroid-card h2 {
  margin: 0 0 10px;
  font-size: 1.8rem;
}

.sandcastle-polaroid-card p {
  margin: 10px 0 14px;
  font-weight: 900;
}

.sandcastle-photo-preview {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  width: 100%;
  aspect-ratio: 900 / 451;
  height: auto;
  overflow: hidden;
  border: 3px solid #7a4b20;
  background:
    linear-gradient(rgba(255, 245, 206, 0.08), rgba(255, 245, 206, 0.08)),
    url("assets/backgrounds/sandcastle-builder-background-simple-v1.png") center / cover no-repeat;
}

.sandcastle-polaroid-toffi {
  position: absolute;
  left: 3%;
  bottom: 6.25%;
  z-index: 3;
  width: 29.6%;
  object-fit: contain;
  pointer-events: none;
}

.sandcastle-photo-castle-layer {
  position: absolute;
  left: 23.46%;
  top: 13.75%;
  width: 73.08%;
  height: 74.38%;
}

.sandcastle-photo-piece {
  position: absolute;
  transform: translate(-50%, -50%) rotate(var(--piece-rotation, 0deg)) scale(0.62);
  pointer-events: none;
}

.sandcastle-snapshot-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #fff8e8;
}

.sandcastle-signature {
  display: grid;
  gap: 4px;
  justify-items: center;
  margin: 8px 0 12px;
  font-weight: 900;
}

.sandcastle-signature input {
  width: min(220px, 78vw);
  padding: 8px 10px;
  border: 3px solid #7a4b20;
  border-radius: 8px;
  background: #fff8e8;
  color: var(--ink);
  font: inherit;
  font-weight: 900;
  text-align: center;
}

@media (max-width: 760px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .stage {
    min-height: 600px;
  }

  .postcard-card {
    padding: 22px 18px 20px;
  }

  .postcard-tabs,
  .postcard-subtabs {
    gap: 6px;
  }

  .postcard-tab {
    min-width: 0;
    padding-inline: 9px;
  }

  .postcard-panel {
    min-height: 170px;
  }

  .pause-card {
    padding: 14px;
  }

  .pause-score-grid {
    grid-template-columns: 1fr;
  }

  .parasol-wrap {
    height: 100%;
    min-height: 0;
  }

  .parasol-board-panel {
    margin-top: 58px;
    padding: 10px;
  }

  .parasol-grid {
    grid-template-columns: repeat(9, 32px);
    gap: 3px;
  }

  .parasol-cell {
    width: 32px;
    height: 32px;
    border-width: 2px;
    border-radius: 6px;
    font-size: 0.95rem;
  }

  .parasol-danger-icon {
    width: 25px;
    height: 25px;
  }

  .parasol-danger-cat {
    width: 24px;
    height: 24px;
  }

  .parasol-flag-icon {
    width: 25px;
    height: 25px;
    font-size: 1.12rem;
  }

  .parasol-grisen {
    width: 174px;
  }

  #parasolIntro .parasol-card {
    min-height: 390px;
    padding-bottom: 126px;
  }

  .parasol-help {
    font-size: 0.82rem;
  }

  .toffi {
    left: 4%;
    bottom: 86px;
    transform: scale(0.78);
    transform-origin: left bottom;
  }

  .toffi.asset-loaded {
    left: 9%;
    bottom: 110px;
    width: 244px;
    height: 268px;
  }

  .toffi:hover,
  .toffi:focus-visible {
    transform: translateY(-4px) scale(0.81);
  }

  .grisen {
    left: 47%;
    bottom: 100px;
    transform: scale(0.82) rotate(-5deg);
    transform-origin: left bottom;
  }

  .grisen.asset-loaded {
    left: 46%;
    bottom: 116px;
    width: 190px;
    height: 214px;
    transform: scale(0.82) rotate(-3deg);
  }

  .grisen:hover,
  .grisen:focus-visible {
    transform: translateY(-4px) scale(0.85) rotate(-5deg);
  }

  .grisen.asset-loaded:hover,
  .grisen.asset-loaded:focus-visible {
    transform: translateY(-4px) scale(0.85) rotate(-3deg);
  }

  .bucket-hotspot {
    left: 64%;
    right: auto;
    bottom: 62px;
    transform: scale(0.9);
    transform-origin: left bottom;
  }

  .bucket-hotspot.asset-loaded {
    left: 64%;
    right: auto;
    bottom: 62px;
    width: 124px;
    height: 140px;
  }

  .bucket-hotspot:hover,
  .bucket-hotspot:focus-visible {
    transform: translateY(-6px) scale(0.94);
  }

  .sandhouse {
    left: 74%;
    bottom: 86px;
    width: 128px;
    height: 102px;
  }

  .sandhouse:hover,
  .sandhouse:focus-visible {
    transform: translateY(-5px) scale(1.03);
  }

  .postcard {
    left: 4%;
    bottom: 52px;
    width: 138px;
    height: 92px;
    transform: rotate(-8deg);
  }

  .postcard:hover,
  .postcard:focus-visible {
    transform: translateY(-5px) rotate(-8deg) scale(1.03);
  }

  .drink-table {
    left: 1%;
    bottom: 172px;
    width: 218px;
    height: 154px;
    transform: rotate(4deg);
  }

  .drink-table:hover,
  .drink-table:focus-visible {
    transform: translateY(-5px) rotate(4deg) scale(1.03);
  }

  .parasol {
    right: -14px;
    bottom: 246px;
    transform: scale(0.72);
    transform-origin: right bottom;
  }

  .parasol.asset-loaded {
    right: -20px;
    bottom: 240px;
    width: 168px;
    height: 150px;
  }

  .parasol:hover,
  .parasol:focus-visible {
    transform: translateY(-4px) scale(0.75);
  }

  .volley-ball-hotspot {
    left: 62%;
    bottom: 292px;
    width: 104px;
    height: 102px;
  }

  .volley-ball-image {
    width: 74px;
    height: 58px;
  }

  .speech {
    font-size: 0.95rem;
    left: 50%;
    width: calc(100% - 24px);
    max-height: none;
    top: 12px;
    bottom: auto;
  }

  .speech-character {
    width: calc(100% - 24px);
    max-height: none;
  }

  .game-hud {
    top: 6px;
    left: 6px;
    right: 6px;
  }

  .drink-wrap {
    min-height: 650px;
    height: calc(100% - 76px);
  }

  .drink-intro {
    padding: 0;
  }

  .drink-intro-card {
    padding: 0;
  }

  .drink-toffi-reaction {
    left: 2%;
    bottom: -18px;
    width: min(220px, 37vw);
  }

  .drink-grisen-shaker {
    left: 57%;
    top: 35%;
    width: min(210px, 35vw);
  }

  .drink-bar-counter {
    bottom: 0;
    width: 118%;
    height: 42%;
  }

  .intro-bubble-toffi,
  .intro-bubble-grisen,
  .intro-bubble-rules {
    left: 5%;
    right: auto;
    width: 90%;
  }

  .intro-bubble-toffi {
    top: 104px;
  }

  .intro-bubble-grisen,
  .intro-bubble-rules {
    top: 276px;
  }

  .intro-bubble-grisen,
  .intro-bubble-rules {
    --tail-left: 48px;
  }

  .drink-intro-card button {
    bottom: 84px;
  }

  .drink-status {
    top: 76px;
  }

  .drink-history-panel {
    top: 132px;
    left: 12px;
    right: auto;
    width: min(250px, calc(100% - 24px));
    max-height: 160px;
  }

  .drink-board {
    bottom: 136px;
  }

  .drink-slot {
    width: 56px;
    height: 64px;
  }

  .drink-slot .ingredient-icon {
    width: 70px;
    height: 67px;
    bottom: -4px;
  }

  .drink-feedback {
    left: 22%;
    top: 142px;
    max-width: 145px;
    font-size: 1.06rem;
  }

  .ingredient-palette {
    grid-template-columns: repeat(4, 58px);
  }

  .ingredient-button {
    width: 62px;
    height: 60px;
  }

  .sandcastle-wrap {
    padding: 12px;
  }

  .sandcastle-header {
    align-items: center;
    flex-direction: column;
    gap: 8px;
  }

  .sandcastle-build-area {
    width: 100%;
    height: 270px;
    margin-left: 0;
  }

  .sandcastle-workbench {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .sandcastle-side-panel {
    min-height: 0;
  }

  .sandcastle-toolbar {
    grid-template-columns: repeat(4, minmax(64px, 1fr));
  }

  .sandcastle-tool {
    min-height: 78px;
    font-size: 0.68rem;
  }

  .sandcastle-tool-icon.sandcastle-asset-part {
    width: 48px;
    height: 58px;
  }

  .sandcastle-camera-prompt {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    align-content: start;
    gap: 6px;
  }

  .sandcastle-camera-prompt p {
    margin: 0 0 8px;
  }

  .sandcastle-camera-prompt img {
    width: 122px;
  }

  .sandcastle-wrap[data-mode="review"] .sandcastle-actions,
  .sandcastle-wrap[data-mode="photo"] .sandcastle-actions {
    position: absolute;
    margin: 0;
  }

  .sandcastle-photo-toffi {
    left: -12px;
    bottom: 76px;
    width: 34%;
  }

  .sandcastle-photo-card {
    min-height: 500px;
  }

  .sandcastle-photo-preview {
    left: 18%;
    right: 18%;
    bottom: 132px;
    height: 220px;
  }

  .sandcastle-photo-toffi {
    left: -16px;
    bottom: 76px;
    width: 38%;
  }

  .sandcastle-photo-grisen {
    right: -12px;
    bottom: 82px;
    width: 34%;
  }

  .game-hud > span,
  .life-row {
    min-width: 0;
    padding: 6px;
    font-size: 0.8rem;
  }

  .life-row {
    min-width: 96px;
    gap: 4px;
  }

  .life-head {
    width: 20px;
    height: 17px;
  }

  .life-icons-loaded .life-head {
    width: 28px;
    height: 28px;
  }
}

.sandcastle-polaroid-card .sandcastle-photo-preview {
  left: auto;
  right: auto;
  bottom: auto;
  height: auto;
  aspect-ratio: 900 / 451;
}

/* Sandslottsbyggaren: flyttläge, foto och kommande riv-animation. */
.sandcastle-move-icon {
  display: block;
  width: 48px;
  height: 56px;
  background: var(--sandcastle-move-icon-image) center / contain no-repeat;
  filter: drop-shadow(0 4px 0 rgba(83, 45, 18, 0.14));
}

.sandcastle-move-tool.is-selected .sandcastle-move-icon {
  filter: drop-shadow(0 0 8px rgba(255, 245, 160, 0.9)) drop-shadow(0 4px 0 rgba(83, 45, 18, 0.14));
}

.sandcastle-wrap[data-mode="build"] .sandcastle-build-area.is-move-mode {
  cursor: grab;
}

.sandcastle-wrap[data-mode="build"] .sandcastle-build-area.is-move-mode .sandcastle-piece {
  filter: drop-shadow(0 4px 0 rgba(83, 45, 18, 0.12));
}

.sandcastle-wrap.is-tearing-down .sandcastle-build-area {
  cursor: wait;
}

.sandcastle-wrap.is-tearing-down .sandcastle-piece {
  z-index: 31;
}

.sandcastle-wrap.is-tearing-down .sandcastle-build-area::after {
  content: "";
  position: absolute;
  left: var(--sandcastle-cart-x, -340px);
  bottom: -6px;
  z-index: 30;
  width: 320px;
  height: 256px;
  background-image: var(--sandcastle-cart-image);
  background-position: var(--sandcastle-cart-frame-x, 0%) 100%;
  background-size: 200% 100%;
  background-repeat: no-repeat;
  transform: translateY(var(--sandcastle-cart-bob, 0px)) rotate(var(--sandcastle-cart-tilt, 0deg));
  transform-origin: 58% 86%;
  pointer-events: none;
}
