:root {
  --bg-blue: #7892c8;
  --bg-blue-dark: #6882b8;
  --maroon: #9e144b;
  --maroon-dark: #6b0b31;
  --maroon-hover: #b31956;
  --orange: #f9a01b;
  --orange-dark: #c27607;
  --orange-hover: #ffae33;
  --bowl-outer: #b2cfb8;
  --bowl-inner: #9bbaa3;
  --cereal-gold: #f3bd68;
  --cereal-stroke: #d89b3c;
  --spoon-bg: #ebedf0;
  --spoon-shadow: #506694;
  --white: #ffffff;
  --focus-ring: #fde047;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

.visually-hidden {
  position: absolute;
  clip-path: inset(50%);
  overflow: hidden;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  white-space: nowrap;
}

body {
  font-family: 'Cairo', 'Segoe UI', Tahoma, system-ui, sans-serif;
  background: var(--bg-blue);
  color: var(--white);
  line-height: 1.45;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  user-select: none;
}

#app {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  position: relative;
}

button,
input,
select {
  font: inherit;
  font-size: max(1rem, 1em);
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

/* Official Top HUD Bar (Circular Maroon Buttons + Milk Counter) */
.hud-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem 0.25rem;
  z-index: 50;
}

.hud-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.hud-right {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  direction: ltr;
}

.milk-count {
  font-size: 1.55rem;
  font-weight: 900;
  color: var(--white);
  letter-spacing: 0.03em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.circle-maroon-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--maroon);
  border: none;
  border-bottom: 5px solid var(--maroon-dark);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 900;
  transition: transform 0.1s ease, background 0.15s ease;
}

.circle-maroon-btn:hover {
  background: var(--maroon-hover);
}

.circle-maroon-btn:active {
  transform: translateY(3px);
  border-bottom-width: 2px;
}

.lang-circle-btn {
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

/* Main Screen Canvas */
.screen-canvas {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.5rem 1.1rem 1.4rem;
  gap: 1rem;
  position: relative;
}

/* Official Golden-Orange 3D Pill Button ("العب" / "التالي") */
.orange-pill-btn {
  background: var(--orange);
  color: var(--white);
  font-weight: 900;
  font-size: 1.65rem;
  border: none;
  border-bottom: 6px solid var(--orange-dark);
  border-radius: 999px;
  padding: 0.45rem 2.6rem;
  min-width: 195px;
  min-height: 60px;
  cursor: pointer;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.22);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  transition: transform 0.1s ease, background 0.15s ease;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

.orange-pill-btn:hover:not(:disabled) {
  background: var(--orange-hover);
}

.orange-pill-btn:active:not(:disabled) {
  transform: translateY(4px);
  border-bottom-width: 2px;
}

.orange-pill-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Official Maroon 3D Pill Button (Voting & Guessing Options) */
.maroon-pill-btn {
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
  background: var(--maroon);
  color: var(--white);
  font-weight: 800;
  font-size: 1.35rem;
  border: none;
  border-bottom: 6px solid var(--maroon-dark);
  border-radius: 999px;
  padding: 0.55rem 1.5rem;
  min-height: 58px;
  cursor: pointer;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: transform 0.1s ease, background 0.15s ease;
}

.maroon-pill-btn:hover:not(:disabled) {
  background: var(--maroon-hover);
}

.maroon-pill-btn:active:not(:disabled) {
  transform: translateY(4px);
  border-bottom-width: 2px;
}

.maroon-pill-btn.correct-choice {
  background: #16a34a;
  border-bottom-color: #14532d;
}

.maroon-pill-btn.wrong-choice {
  background: #dc2626;
  border-bottom-color: #7f1d1d;
}

/* Official Circular Golden-Orange Icon Buttons (- and Person+) */
.circle-orange-btn {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--orange);
  border: none;
  border-bottom: 5px solid var(--orange-dark);
  box-shadow: 0 4px 9px rgba(0, 0, 0, 0.24);
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.1s ease, background 0.15s ease;
}

.circle-orange-btn:hover:not(:disabled) {
  background: var(--orange-hover);
}

.circle-orange-btn:active:not(:disabled) {
  transform: translateY(3px);
  border-bottom-width: 2px;
}

.circle-orange-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Official Screen Titles & Typography */
.game-heading-white {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--white);
  text-align: center;
  line-height: 1.4;
  margin-block: 0.25rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.player-title-orange {
  font-size: 2.3rem;
  font-weight: 900;
  color: var(--orange);
  text-align: center;
  text-shadow: 0 3px 6px rgba(0, 0, 0, 0.18);
  margin-block-end: 0.4rem;
}

.center-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.85rem;
  padding: 0.5rem 0.4rem;
}

.role-body-text {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1.55;
  max-width: 380px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.14);
}

.secret-topic-highlight {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--orange);
  background: rgba(255, 255, 255, 0.95);
  color: var(--maroon);
  padding: 0.45rem 1.75rem;
  border-radius: 999px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
  margin-block: 0.35rem;
}

/* Category Shelf Screen (Cereal Boxes on Maroon Shelves) */
.shelf-banner {
  background: var(--maroon);
  color: var(--white);
  font-weight: 900;
  font-size: 1.25rem;
  text-align: center;
  padding: 0.55rem 1rem;
  border-radius: 16px;
  border-bottom: 4px solid var(--maroon-dark);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.shelves-container {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  padding-block: 0.25rem;
}

.shelf-row {
  display: flex;
  flex-direction: column;
}

.shelf-boxes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
  padding: 0 0.6rem;
  align-items: end;
}

.maroon-shelf-plank {
  height: 12px;
  background: var(--maroon);
  border-bottom: 4px solid var(--maroon-dark);
  border-radius: 999px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
  margin-top: -2px;
}

.cereal-box-btn {
  position: relative;
  border: none;
  border-radius: 8px 8px 3px 3px;
  height: 175px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.55rem;
  box-shadow: -5px 4px 10px rgba(0, 0, 0, 0.28);
  transition: transform 0.15s ease;
  overflow: hidden;
  text-align: center;
}

.cereal-box-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 12px;
  background: rgba(0, 0, 0, 0.22);
  border-radius: 0 0 10px 10px;
}

.cereal-box-btn:hover {
  transform: translateY(-5px) scale(1.02);
}

.cereal-box-btn.selected-box {
  outline: 4px solid #fde047;
  transform: translateY(-4px);
}

.box-places {
  background: linear-gradient(160deg, #1d4ed8 0%, #1e3a8a 100%);
}
.box-food {
  background: repeating-conic-gradient(#f4c430 0% 25%, #f9e076 0% 50%) 50% / 36px 36px;
}
.box-animals {
  background: linear-gradient(160deg, #f59e0b 0%, #d97706 100%);
}
.box-clothes {
  background: linear-gradient(160deg, #d97706 0%, #9a3412 100%);
}
.box-drinks {
  background: linear-gradient(160deg, #1f6f78 0%, #114b5f 100%);
}
.box-sweets {
  background: linear-gradient(160deg, #7dd3fc 0%, #38bdf8 100%);
}
.box-anime {
  background: repeating-conic-gradient(from 0deg, #7e22ce 0deg 15deg, #db2777 15deg 30deg);
}
.box-jobs {
  background: linear-gradient(160deg, #312e81 0%, #1e1b4b 100%);
}

.box-title {
  margin-top: 0.45rem;
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--white);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45), 0 0 6px rgba(0, 0, 0, 0.35);
  z-index: 2;
}

.box-food .box-title {
  color: var(--white);
  text-shadow: 0 2px 0 #78350f, -1px -1px 0 #78350f, 1px -1px 0 #78350f;
}

.box-sweets .box-title {
  color: #f472b6;
  text-shadow: 0 2px 0 #831843, -1px -1px 0 #831843;
}

.box-art {
  font-size: 2.8rem;
  line-height: 1;
  z-index: 2;
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.25));
}

.box-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  width: 100%;
  z-index: 2;
}

.nutrition-pill {
  background: rgba(15, 23, 42, 0.78);
  color: var(--white);
  border: 1.5px solid var(--white);
  border-radius: 6px;
  padding: 0.1rem 0.35rem;
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1.1;
  direction: ltr;
}

.box-ribbon {
  background: var(--maroon);
  color: var(--white);
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Official Add Players Screen (White Cereal Spoons!) */
.spoons-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  padding-block: 0.35rem;
}

.spoon-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
}

.spoon-shape {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--spoon-bg);
  border-radius: 999px;
  padding: 0.38rem 1.1rem;
  min-height: 60px;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.22);
  position: relative;
  gap: 0.45rem;
}

.spoon-input {
  width: 100%;
  border: none;
  background: transparent;
  color: #1e293b;
  font-weight: 800;
  font-size: 1.15rem;
  padding: 0.25rem 0.4rem;
}

.spoon-input::placeholder {
  color: #64748b;
  font-weight: 700;
}

.spoon-input:focus-visible {
  outline: 2px solid var(--maroon);
  border-radius: 8px;
}

.spoon-divider {
  width: 1.5px;
  height: 26px;
  background: #cbd5e1;
  flex-shrink: 0;
}

.helper-chips-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.mini-pill-btn {
  background: rgba(255, 255, 255, 0.2);
  color: var(--white);
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
}

.mini-pill-btn:hover {
  background: rgba(255, 255, 255, 0.32);
}

.bottom-bar-spoons {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding-top: 0.5rem;
}

.add-player-fab {
  position: absolute;
  inset-inline-start: 0.25rem;
}

/* Official Voting Screen White Tip Pill + Bottom Characters */
.white-tip-banner {
  background: var(--white);
  color: var(--maroon);
  font-weight: 900;
  font-size: 1.2rem;
  padding: 0.65rem 1.4rem;
  border-radius: 22px;
  text-align: center;
  width: 100%;
  max-width: 350px;
  margin: 0.5rem auto 0;
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.16);
}

.characters-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  padding-top: 0.25rem;
}

/* Official Cereal Bowl Reveal Screen (play_9.png & play_16.png) */
.cereal-bowl-wrapper {
  width: 290px;
  height: 290px;
  margin: 0 auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cereal-bowl-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.22));
}

.bowl-outsider-name {
  position: absolute;
  font-size: 2.35rem;
  font-weight: 900;
  color: var(--maroon);
  text-align: center;
  z-index: 5;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.8);
  animation: popReveal 0.45s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes popReveal {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Question Log & Optional Input */
.question-controls-card {
  width: 100%;
  max-width: 370px;
  background: rgba(255, 255, 255, 0.16);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 20px;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.q-select,
.q-text-input {
  width: 100%;
  min-height: 48px;
  padding: 0.55rem 0.85rem;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  background: var(--white);
  color: #1e293b;
  font-weight: 800;
}

.q-log-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 130px;
  overflow-y: auto;
  text-align: start;
}

.q-log-item {
  background: rgba(255, 255, 255, 0.92);
  color: #1e293b;
  padding: 0.45rem 0.75rem;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 700;
}

/* Scoreboard Pills */
.score-pills-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: 100%;
  max-width: 350px;
  margin: 0 auto;
}

.score-pill-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--white);
  color: var(--maroon);
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  font-weight: 900;
  font-size: 1.2rem;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.18);
}

.score-pill-row.first-place {
  background: #fef08a;
  border: 2px solid var(--orange);
}
