* { box-sizing: border-box; }

:root {
  --bg: #fff5f8;
  --bg2: #ffe3ee;
  --accent: #ff7aa2;
  --accent2: #ffc2d4;
  --ink: #7a4453;
  --soft: #ffffff;
}

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

body {
  font-family: Mali, system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

button {
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

.app {
  min-height: 100vh;
  width: 100%;
  background: linear-gradient(165deg, var(--bg), var(--bg2));
  transition: background .4s ease;
  overflow-x: hidden;
}

.screen {
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 18px 40px;
}

.home {
  justify-content: center;
  padding: 40px 22px;
  position: relative;
  overflow: hidden;
  text-align: center;
}

.float-food {
  position: absolute;
  opacity: .5;
  animation: floaty 5s ease-in-out infinite;
  pointer-events: none;
}

.float-food:nth-child(1) { top: 8%; left: 8%; font-size: 46px; }
.float-food:nth-child(2) { top: 16%; right: 10%; font-size: 40px; animation-duration: 6s; animation-delay: .8s; }
.float-food:nth-child(3) { bottom: 14%; left: 12%; font-size: 42px; animation-duration: 5.5s; animation-delay: .4s; }
.float-food:nth-child(4) { bottom: 18%; right: 9%; font-size: 38px; animation-duration: 6.4s; animation-delay: 1.1s; }

.hero-icon {
  font-size: clamp(72px, 18vw, 120px);
  animation: bob 3s ease-in-out infinite;
  line-height: 1;
}

h1,
.title,
.headline,
.brand {
  font-family: Itim, cursive;
  letter-spacing: 0;
}

h1 {
  margin: 6px 0 0;
  color: var(--accent);
  font-size: clamp(48px, 11vw, 92px);
  text-shadow: 0 4px 0 rgba(255,255,255,.7);
  white-space: nowrap;
}

.tagline {
  font-family: Itim, cursive;
  font-size: clamp(20px, 4.4vw, 30px);
  margin: 2px 0 0;
}

.theme-label {
  margin: 30px 0 8px;
  font-size: clamp(15px, 3.4vw, 18px);
  opacity: .8;
}

.theme-list,
.actions,
.top-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.theme-list {
  max-width: 520px;
  gap: 14px;
}

.theme-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 108px;
  min-height: 96px;
  padding: 14px 10px;
  border-radius: 22px;
  cursor: pointer;
  background: #fff;
  border: 4px solid transparent;
  box-shadow: 0 6px 16px rgba(0,0,0,.07);
  color: var(--theme-color);
  transition: transform .12s, box-shadow .12s, border-color .12s;
}

.theme-button.active {
  border-color: var(--theme-color);
  box-shadow: 0 6px 16px rgba(0,0,0,.16);
}

.theme-button span:first-child {
  font-size: 34px;
}

.theme-button span:last-child {
  font-weight: 600;
  font-size: 15px;
}

.primary-button,
.secondary-button,
.ghost-button,
.icon-button,
.cat-button {
  border: none;
  cursor: pointer;
  transition: transform .12s, opacity .12s, box-shadow .12s;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.icon-button:hover,
.cat-button:hover,
.theme-button:hover {
  transform: translateY(-3px);
}

.primary-button:active,
.secondary-button:active,
.ghost-button:active,
.icon-button:active {
  transform: translateY(4px);
}

.primary-button {
  padding: 18px 52px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-family: Itim, cursive;
  font-size: clamp(22px, 5vw, 30px);
  box-shadow: 0 9px 0 rgba(0,0,0,.10), 0 14px 26px rgba(0,0,0,.14);
}

.home .primary-button {
  margin-top: 34px;
}

.warning {
  margin-top: 38px;
  max-width: min(96vw, 760px);
  text-align: center;
  font-size: clamp(10px, 2.4vw, 13px);
  opacity: .65;
  background: rgba(255,255,255,.55);
  padding: 10px 18px;
  border-radius: 999px;
}

.header {
  width: 100%;
  max-width: 920px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.header-left {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.icon-button {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: rgba(255,255,255,.85);
  color: var(--ink);
  font-size: 18px;
  box-shadow: 0 4px 10px rgba(0,0,0,.08);
}

.brand,
.headline {
  color: var(--accent);
  white-space: nowrap;
}

.brand {
  font-size: clamp(20px, 5vw, 28px);
}

.headline {
  font-size: clamp(20px, 5vw, 30px);
}

.subtext {
  font-size: clamp(13px, 3.2vw, 15px);
  opacity: .75;
  margin: 8px 0 16px;
  text-align: center;
}

.category-tools {
  width: 100%;
  max-width: 820px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.pill {
  font-weight: 700;
  font-size: 13px;
  background: rgba(255,255,255,.6);
  padding: 6px 14px;
  border-radius: 999px;
}

.ghost-button,
.secondary-button {
  border-radius: 999px;
  font-weight: 700;
}

.ghost-button {
  background: rgba(255,255,255,.8);
  color: var(--ink);
  padding: 8px 15px;
  font-size: 12px;
}

.secondary-button {
  background: var(--accent2);
  color: var(--ink);
  padding: 13px 28px;
  font-family: Itim, cursive;
  font-size: 19px;
  box-shadow: 0 6px 0 rgba(0,0,0,.08);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 10px;
  width: 100%;
  max-width: 820px;
}

.cat-button {
  position: relative;
  min-height: 104px;
  padding: 12px 8px;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: rgba(255,255,255,.55);
  border: 2.5px solid transparent;
  color: var(--ink);
  box-shadow: 0 6px 15px rgba(0,0,0,.04);
  opacity: .65;
}

.cat-button.active {
  background: var(--soft);
  border-color: var(--accent);
  box-shadow: 0 6px 15px rgba(0,0,0,.10);
  opacity: 1;
}

.cat-emoji {
  font-size: 32px;
  line-height: 1;
}

.cat-label {
  font-family: Itim, cursive;
  font-size: 15px;
  line-height: 1.1;
  text-align: center;
}

.cat-count {
  font-size: 10px;
  opacity: .65;
}

.tick {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
  background: var(--bg2);
}

.active .tick {
  background: var(--accent);
  color: #fff;
}

.start-button {
  margin-top: 22px;
}

.primary-button:disabled {
  background: #cfcfcf;
  cursor: not-allowed;
  opacity: .7;
  box-shadow: 0 6px 0 rgba(0,0,0,.06);
}

.pool-hint,
.footer-note {
  font-size: 13px;
  opacity: .6;
  text-align: center;
}

.game-body {
  width: 100%;
  max-width: 880px;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 0;
  text-align: center;
}

.slot-icon {
  font-size: clamp(80px, 20vw, 130px);
  animation: bob 2.6s ease-in-out infinite;
}

.idle-text,
.result-copy {
  font-family: Itim, cursive;
  font-size: clamp(22px, 5vw, 32px);
  margin: 10px 0 26px;
}

.pulse {
  animation: pulse 2s ease-in-out infinite;
}

.cards {
  display: flex;
  gap: clamp(14px, 4vw, 30px);
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

.spin-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(230px, 1fr));
  gap: clamp(14px, 4vw, 34px);
  width: 100%;
  max-width: 820px;
}

.spin-card {
  min-height: 258px;
  background: var(--soft);
  border-radius: 28px;
  border: 4px solid var(--accent2);
  padding: 30px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 30px rgba(0,0,0,.10);
}

.spin-food-circle {
  width: clamp(110px, 26vw, 150px);
  height: clamp(110px, 26vw, 150px);
  border-radius: 50%;
  background: linear-gradient(160deg, var(--bg), var(--bg2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(56px, 14vw, 84px);
  animation: spinwob .18s linear infinite alternate;
}

.spin-card:nth-child(2) .spin-food-circle {
  animation-delay: .09s;
}

.spin-menu-name {
  font-family: Itim, cursive;
  font-size: 22px;
  color: var(--ink);
  margin-top: 14px;
  text-align: center;
}

.menu-card {
  flex: 1 1 240px;
  min-width: min(240px, 100%);
  background: var(--soft);
  border-radius: 28px;
  border: 4px solid var(--accent2);
  padding: 26px 18px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 12px 30px rgba(0,0,0,.10);
  animation: pop .45s ease both;
}

.menu-card:nth-child(2) {
  animation-delay: .08s;
}

.food-circle {
  width: clamp(120px, 28vw, 160px);
  height: clamp(120px, 28vw, 160px);
  border-radius: 50%;
  background: linear-gradient(160deg, var(--bg), var(--bg2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(60px, 15vw, 90px);
}

.category-chip {
  font-size: 12px;
  color: var(--accent);
  font-weight: 700;
  margin-top: 12px;
  background: var(--bg2);
  padding: 4px 12px;
  border-radius: 999px;
}

.menu-name {
  font-family: Itim, cursive;
  font-size: clamp(24px, 5vw, 30px);
  margin-top: 8px;
  text-align: center;
}

.choose-button {
  margin-top: 16px;
  padding: 12px 28px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  font-family: Itim, cursive;
  font-size: 20px;
  box-shadow: 0 6px 0 rgba(0,0,0,.10);
}

.title {
  font-size: clamp(22px, 5vw, 32px);
  color: var(--accent);
  margin-bottom: 6px;
}

.rps-title {
  font-size: clamp(24px, 5.5vw, 36px);
}

.rps-card {
  flex: 1 1 250px;
  min-width: min(250px, 100%);
  background: var(--soft);
  border-radius: 28px;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 12px 30px rgba(0,0,0,.10);
}

.left-player { border: 4px solid #ffc2d4; }
.right-player { border: 4px solid #bcc6ff; }
.left-player .player-name { color: #e85d8f; }
.right-player .player-name { color: #4f6bd8; }

.player-name {
  font-family: Itim, cursive;
  font-size: 25px;
}

.small-circle,
.hand-circle {
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.small-circle {
  width: clamp(92px, 22vw, 118px);
  height: clamp(92px, 22vw, 118px);
  margin-top: 10px;
  font-size: clamp(44px, 11vw, 64px);
}

.hand-circle {
  width: clamp(86px, 21vw, 108px);
  height: clamp(86px, 21vw, 108px);
  background: linear-gradient(160deg,#fff,#ffeef4);
  border: 2px dashed #ffc2d4;
  font-size: clamp(44px, 11vw, 62px);
}

.right-player .hand-circle {
  background: linear-gradient(160deg,#fff,#eef1ff);
  border-color: #bcc6ff;
}

.divider {
  width: 80%;
  height: 2px;
  border-radius: 2px;
  background: var(--bg2);
  margin: 14px 0;
}

.vs {
  display: flex;
  align-items: center;
  font-family: Itim, cursive;
  font-size: clamp(28px, 7vw, 46px);
  color: var(--accent);
}

.result-card {
  margin: 18px 0 6px;
  background: var(--soft);
  border-radius: 36px;
  border: 5px solid var(--accent);
  padding: clamp(26px, 6vw, 46px) clamp(28px, 8vw, 70px);
  box-shadow: 0 18px 44px rgba(0,0,0,.16);
  animation: popBig .55s cubic-bezier(.2,1.2,.4,1) both;
}

.result-card .food-circle {
  width: clamp(150px, 40vw, 230px);
  height: clamp(150px, 40vw, 230px);
  margin: 0 auto;
  font-size: clamp(84px, 22vw, 150px);
  animation: bob 2.4s ease-in-out infinite;
}

.result-card .menu-name {
  font-size: clamp(34px, 8vw, 56px);
}

.footer-note {
  margin-top: auto;
  padding-top: 26px;
  font-size: clamp(9px, 2.2vw, 11px);
  opacity: .55;
  max-width: 96vw;
}

.mute-button {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 9998;
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 5px 14px rgba(0,0,0,.16);
  transition: transform .12s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mute-button:hover {
  transform: scale(1.08);
}

.mute-button.muted {
  background: rgba(255,255,255,.85);
  color: var(--ink);
}

.confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -24px;
  border-radius: 2px;
  opacity: .92;
  animation-name: confFall;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

@keyframes pop { 0%{transform:scale(.6);opacity:0} 60%{transform:scale(1.08)} 100%{transform:scale(1);opacity:1} }
@keyframes popBig { 0%{transform:scale(.4) rotate(-8deg);opacity:0} 55%{transform:scale(1.12) rotate(3deg)} 100%{transform:scale(1) rotate(0);opacity:1} }
@keyframes floaty { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-14px)} }
@keyframes bob { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-7px)} }
@keyframes pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.05)} }
@keyframes spinwob { 0%{transform:scale(.9) rotate(-6deg)} 100%{transform:scale(1.04) rotate(6deg)} }
@keyframes confFall { to { transform: translateY(112vh) rotate(560deg); } }

@media (max-width: 640px) {
  .screen {
    padding: 18px 14px 32px;
  }

  .header {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .top-actions .ghost-button {
    flex: 1 1 132px;
  }

  .category-tools {
    justify-content: center;
  }

  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .primary-button {
    width: min(100%, 360px);
    padding-left: 22px;
    padding-right: 22px;
  }

  .warning {
    border-radius: 18px;
  }

  .cards {
    align-items: stretch;
  }

  .spin-cards {
    grid-template-columns: 1fr;
  }

  .menu-card,
  .rps-card {
    flex-basis: 100%;
  }

  .vs {
    width: 100%;
    justify-content: center;
    line-height: 1;
  }
}
