:root {
  --bg-color: #fcf5fc;
  --primary-purple: #6a24d1;
  --logo-color: #8c42ff;
  --text-dark: #3a2a47;
  --text-light: #ab9cbd;

  --score-bg-a: #f1e4fb;
  --score-text-a: #a46af3;
  --score-val-a: #682ab9;

  --score-bg-b: #f5e8f9;
  --score-text-b: #a58ebb;
  --score-val-b: #4e3a5f;

  --timer-bg: #ff91c2;
  --timer-text: #641538;

  --card-bg: #ffffff;
  --card-shadow: 0 25px 60px rgba(220, 195, 235, 0.6);
  --word-bg: #f8ebfa;
  --word-text: #7b598b;

  --btn-correct: #16c685;
  --btn-pass: #ffc91b;
  --btn-taboo: #bd1b46;

  --nav-bg: #fdf7fe;
  --nav-active: #aa77ff;
}

body,
html {
  margin: 0;
  padding: 0;
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-dark);
  height: 100%;
  overflow-x: hidden;
}

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  overflow: hidden;
  padding: 70px 15px 85px 15px;
  box-sizing: border-box;
}

/* Decor Shapes */
.bg-shape-top-right {
  position: absolute;
  top: -60px;
  right: -60px;
  width: 250px;
  height: 250px;
  background-color: #ffefcd;
  border-radius: 50%;
  z-index: -1;
}

.bg-shape-bottom-left {
  position: absolute;
  bottom: 0;
  left: -100px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255, 230, 245, 0.8) 0%, rgba(253, 245, 252, 0) 70%);
  z-index: -1;
  border-radius: 50%;
}

/* Header */
.top-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  box-sizing: border-box;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 25px 30px;
  z-index: 100;
  pointer-events: none;
  /* Allows pressing screen below if needed */
}

.top-header>* {
  pointer-events: auto;
  /* Re-enable clicks for items inside */
}

.logo-img {
  height: 90px;
  width: auto;
  object-fit: contain;
}

.header-icons {
  display: flex;
  gap: 15px;
}

.header-icons i {
  font-size: 1.3rem;
  color: #4a3852;
  cursor: pointer;
  transition: color 0.2s;
}

.header-icons i:hover {
  color: var(--primary-purple);
}

/* Scoreboard */
.top-section {
  display: flex;
  justify-content: center;
  z-index: 2;
  position: relative;
  margin-bottom: -15px;
  /* Overlap with card visually */
}

.scoreboard {
  display: flex;
  gap: 15px;
}

.team-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 25px;
  border-radius: 16px;
  width: 130px;
  box-sizing: border-box;
  transition: all 0.3s ease;
}

.team-a {
  background-color: var(--score-bg-a);
}

.team-a .team-title {
  color: var(--score-text-a);
}

.team-a .team-points {
  color: var(--score-val-a);
}

.team-b {
  background-color: var(--score-bg-b);
}

.team-b .team-title {
  color: var(--score-text-b);
}

.team-b .team-points {
  color: var(--score-val-b);
}

.team-title {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 1px;
}

.team-points {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.1;
  margin-top: 2px;
}

/* Main Card */
.card-area {
  position: relative;
  display: flex;
  justify-content: center;
  margin-top: 5px;
  margin-bottom: 25px;
  z-index: 10;
}

.timer-badge {
  position: absolute;
  top: 15px;
  right: 15%;
  background-color: var(--timer-bg);
  color: var(--timer-text);
  padding: 10px 20px;
  border-radius: 25px;
  font-weight: 800;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 12;
  box-shadow: 0 5px 15px rgba(255, 145, 194, 0.4);
  transform: rotate(5deg);
}

.taboo-card {
  background-color: var(--card-bg);
  border-radius: 24px;
  padding: 30px 30px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 11;
}

.target-word {
  font-size: 2.5rem;
  color: var(--primary-purple);
  font-weight: 800;
  margin: 0 0 20px 0;
  text-transform: uppercase;
  letter-spacing: -1px;
}

.forbidden-words {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.word-pill {
  background-color: var(--word-bg);
  color: var(--word-text);
  padding: 10px 15px;
  border-radius: 10px;
  text-align: center;
  font-weight: 700;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Action Buttons */
.actions {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 10px;
  z-index: 10;
}

.btn {
  border: none;
  padding: 14px 24px;
  border-radius: 25px;
  font-family: inherit;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn:hover {
  transform: translateY(-3px);
  filter: brightness(1.05);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.btn-correct {
  background-color: var(--btn-correct);
}

.btn-pass {
  background-color: var(--btn-pass);
  color: #594200;
}

.btn-taboo {
  background-color: var(--btn-taboo);
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: rgba(253, 247, 254, 0.95);
  backdrop-filter: blur(15px);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 10px 0 20px;
  border-top-left-radius: 35px;
  border-top-right-radius: 35px;
  box-shadow: 0 -10px 30px rgba(220, 200, 240, 0.4);
  z-index: 50;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  color: var(--text-light);
  gap: 6px;
  position: relative;
  width: 80px;
  padding-top: 10px;
}

.nav-text {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 1px;
}

.nav-icon {
  font-size: 1.4rem;
  margin-bottom: 4px;
}

.nav-item.active {
  color: var(--nav-active);
}

.play-circle-wrapper {
  position: relative;
  margin-top: -45px;
  /* Pulls the button up significantly overlapping */
  width: 65px;
  height: 65px;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--bg-color);
  /* Cutout effect simulation */
  border-radius: 50%;
  margin-bottom: 5px;
}

.play-circle {
  background-color: var(--nav-active);
  color: white;
  width: 55px;
  height: 55px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 8px 25px rgba(170, 119, 255, 0.5);
  font-size: 1.3rem;
}

/* Responsive Overrides */
@media (max-width: 550px) {
  .actions {
    flex-wrap: wrap;
    gap: 10px;
  }

  .btn {
    flex: 1 1 calc(50% - 10px);
    padding: 12px 15px;
    font-size: 0.95rem;
  }

  .btn-pass {
    flex: 1 1 100%;
  }

  .scoreboard {
    gap: 10px;
  }

  .team-score {
    width: 110px;
    padding: 8px 15px;
  }

  .taboo-card {
    padding: 25px 20px;
  }

  .target-word {
    font-size: 2.2rem;
    margin-bottom: 15px;
  }

  .timer-badge {
    right: 5%;
    top: 5px;
  }
}

/* --- Menu Page Styles --- */
.menu-container {
  padding: 85px 15px 25px 15px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.menu-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  z-index: -1;
  opacity: 0.8;
}

.top-glow {
  top: 50px;
  left: 20%;
  width: 300px;
  height: 300px;
  background-color: #fffae6;
}

.right-glow {
  top: 35%;
  right: -50px;
  width: 350px;
  height: 350px;
  background-color: #f7eaff;
}

.menu-main {
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 2;
  position: relative;
  justify-content: center;
  flex-grow: 1;
}

.menu-hero {
  text-align: center;
  margin-top: -60px;
  margin-bottom: 5px;
}

.hero-logo {
  height: 250px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  margin: 0 auto;
  filter: drop-shadow(0 0 15px rgba(255, 255, 255, 1)) drop-shadow(0 0 30px rgba(255, 255, 255, 0.8));
}

.menu-subtitle {
  font-size: 1.15rem;
  font-weight: 600;
  color: #6a5e78;
  margin-top: 5px;
  line-height: 1.4;
}

.room-cards {
  display: flex;
  gap: 20px;
  width: 100%;
}

.room-card {
  flex: 1;
  border-radius: 24px;
  padding: 20px 20px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.04);
}

.create-room {
  background-color: var(--primary-purple);
  color: #fff;
  box-shadow: 0 15px 35px rgba(106, 36, 209, 0.25);
}

.join-room {
  background-color: #ecdcf9;
  color: #3b2061;
}

.rc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.rc-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.3rem;
}

.create-room .rc-icon {
  background-color: #fff;
  color: var(--primary-purple);
}

.join-room .rc-icon {
  background: transparent;
  color: var(--primary-purple);
  font-size: 2rem;
  margin-left: -5px;
}

.rc-badge {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 8px 14px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

.create-room .rc-badge {
  background-color: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.join-room .rc-badge {
  background-color: rgba(106, 36, 209, 0.08);
  color: var(--primary-purple);
}

.rc-content h2 {
  font-size: 1.8rem;
  font-weight: 800;
  font-style: italic;
  margin: 0 0 10px 0;
}

.rc-content p {
  font-size: 1rem;
  font-weight: 500;
  margin: 0;
  line-height: 1.4;
}

.create-room .rc-content p {
  color: rgba(255, 255, 255, 0.85);
}

.join-room .rc-content p {
  color: #6f5985;
}

.info-banner {
  background-color: #fbd114;
  border-radius: 20px;
  padding: 20px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  color: #493902;
  box-shadow: 0 15px 35px rgba(251, 209, 20, 0.25);
}

.info-icon {
  width: 55px;
  height: 55px;
  min-width: 55px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.08);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.5rem;
  color: #493902;
}

.info-text {
  flex: 1;
}

.info-text h2 {
  font-size: 1.6rem;
  font-weight: 800;
  font-style: italic;
  margin: 0 0 12px 0;
}

.info-text p {
  font-size: 1.05rem;
  font-weight: 500;
  margin: 0;
  line-height: 1.4;
  color: #624e03;
}

.info-arrow {
  margin-left: auto;
  font-size: 1.5rem;
  color: #493902;
  align-self: flex-end;
}

@media (max-width: 550px) {
  .room-cards {
    flex-direction: column;
    gap: 10px;
  }

  .hero-logo {
    height: 150px;
  }

  .rc-header {
    margin-bottom: 10px;
  }
}

/* --- Settings Page Styles --- */
.settings-container {
  padding: 20px 15px 40px 15px;
  background-color: var(--bg-color);
  overflow-y: auto;
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  padding: 0 10px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.header-title {
  color: var(--primary-purple);
  font-weight: 800;
  font-size: 1.15rem;
}

.circle-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  font-size: 1.1rem;
  transition: transform 0.2s;
}

.circle-btn:hover {
  transform: scale(1.05);
}

.light-purple {
  background-color: #eee0fa;
  color: var(--primary-purple);
}

.dark-purple {
  background-color: var(--primary-purple);
  color: #fff;
}

.settings-main {
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 0 auto;
}

.settings-hero {
  text-align: center;
  margin-bottom: 20px;
}

.settings-hero .logo {
  font-size: 2.8rem;
  letter-spacing: -1.5px;
  color: var(--primary-purple);
  font-style: italic;
  font-weight: 900;
  margin: 0;
}

.settings-subtitle {
  font-size: 0.95rem;
  color: #6a5e78;
  font-weight: 600;
  margin-top: 5px;
}

.settings-card {
  background-color: #f3e6f7;
  border-radius: 28px;
  padding: 25px 30px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.02);
}

.sc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sc-icon-title {
  display: flex;
  align-items: center;
  gap: 15px;
}

.sc-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: #fff;
  color: var(--primary-purple);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 10px rgba(106, 36, 209, 0.08);
}

.sc-icon-title h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-dark);
  margin: 0;
}

.sc-badge {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 800;
}

.pink-badge {
  background-color: #fa87b5;
  color: #fff;
}

.yellow-badge {
  background-color: #fbd114;
  color: #493902;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sc-inputs-row {
  display: flex;
  gap: 15px;
}

.input-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  font-size: 0.8rem;
  font-weight: 800;
  color: #8b7999;
  letter-spacing: 0.5px;
}

.input-group input {
  background-color: #ecdcf9;
  border: none;
  padding: 18px 20px;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--primary-purple);
  outline: none;
  transition: box-shadow 0.2s;
}

.input-group input:focus {
  box-shadow: 0 0 0 2px var(--primary-purple);
}

.input-group input::placeholder {
  color: #c7bcdf;
  font-weight: 500;
}

.sc-options-row {
  display: flex;
  gap: 15px;
}

.time-btn {
  flex: 1;
  background-color: #fff;
  border: none;
  padding: 20px 0;
  border-radius: 40px;
  font-family: inherit;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-dark);
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
}

.time-btn.active {
  background-color: var(--primary-purple);
  color: #fff;
  box-shadow: 0 10px 25px rgba(106, 36, 209, 0.35);
  transform: translateY(-2px);
}

.slider-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 10px;
  position: relative;
}

.custom-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  background: #ecdcf9;
  border-radius: 4px;
  outline: none;
}

.custom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-purple);
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(106, 36, 209, 0.4);
}

.custom-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-purple);
  cursor: pointer;
  border: none;
  box-shadow: 0 4px 10px rgba(106, 36, 209, 0.4);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.slider-labels span {
  font-weight: 700;
  color: #8b7999;
  font-size: 0.9rem;
}

.card-input {
  color: var(--primary-purple);
  font-size: 1.5rem;
  font-weight: 800;
  position: absolute;
  left: 50%;
  bottom: -4px;
  transform: translateX(-50%);
  width: 60px;
  text-align: center;
  border: none;
  background: transparent;
  outline: none;
  font-family: inherit;
  -moz-appearance: textfield;
}

.card-input::-webkit-outer-spin-button,
.card-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.settings-btn {
  width: 100%;
  border: none;
  padding: 24px 0;
  border-radius: 40px;
  font-family: inherit;
  font-weight: 800;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.settings-btn:hover {
  transform: translateY(-3px);
}

.category-btn {
  background-color: #a43b74;
  box-shadow: 0 15px 30px rgba(164, 59, 116, 0.3);
  margin-top: 10px;
}

.start-btn {
  background-color: var(--primary-purple);
  box-shadow: 0 15px 30px rgba(106, 36, 209, 0.3);
}

@media (max-width: 550px) {
  .sc-inputs-row {
    flex-direction: column;
  }
}

/* --- Teams Page Styles --- */
.teams-main {
  gap: 25px;
}

.team-players-card {
  gap: 15px;
  padding: 20px 25px;
}

.blue-badge {
  background-color: #3b82f6;
  color: #fff;
}

.red-badge {
  background-color: #ef4444;
  color: #fff;
}

.players-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background-color: #fff;
  border-radius: 16px;
  padding: 15px;
  min-height: 80px;
}

.player-row {
  font-weight: 600;
  color: #6a5e78;
  font-size: 0.95rem;
  padding: 10px 14px;
  background-color: #f9f5fc;
  border-radius: 10px;
  display: flex;
  align-items: center;
}

.player-row::before {
  content: '\f2bd';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  margin-right: 12px;
  color: #c7bcdf;
  font-size: 1.1rem;
}

.teams-actions {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 10px;
}

.teams-actions .settings-btn {
  margin-top: 0;
}

.invite-btn {
  background-color: #f59e0b;
  /* Amber */
  box-shadow: 0 15px 30px rgba(245, 158, 11, 0.3);
}

/* --- Modal Styles --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(30, 20, 50, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background-color: #fff;
  border-radius: 28px;
  width: 90%;
  max-width: 400px;
  padding: 30px 25px;
  position: relative;
  text-align: center;
  transform: translateY(30px);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.modal-overlay.show .modal-content {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: #f1e4fb;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--primary-purple);
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s;
  outline: none;
}

.modal-close:hover {
  background: #d8bcf5;
}

.modal-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: #fbd114;
  color: #493902;
  font-size: 1.8rem;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 15px auto;
}

.modal-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-dark);
  margin: 0 0 5px 0;
}

.modal-desc {
  font-size: 0.95rem;
  color: #6a5e78;
  margin: 0 0 25px 0;
  font-weight: 500;
  line-height: 1.5;
}

.code-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #f9f5fc;
  border: 2px dashed #cdbdf2;
  border-radius: 16px;
  padding: 10px 10px 10px 20px;
}

.code-box span {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--primary-purple);
  letter-spacing: 2px;
}

.copy-btn {
  background-color: var(--primary-purple);
  color: #fff;
  border: none;
  padding: 12px 18px;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.copy-btn:hover {
  transform: scale(1.05);
}

/* --- Category List (in Modal) --- */
.category-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 250px;
  overflow-y: auto;
  text-align: left;
  margin-top: 15px;
  padding-right: 5px;
}

.category-list::-webkit-scrollbar {
  width: 6px;
}

.category-list::-webkit-scrollbar-thumb {
  background-color: #cdbdf2;
  border-radius: 10px;
}

.category-item {
  display: flex;
  align-items: center;
  padding: 15px 18px;
  border-radius: 16px;
  background-color: #fcf8ff;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.category-item:hover {
  background-color: #f3e6f7;
}

.category-item.active {
  border-color: var(--primary-purple);
  background-color: #f7effd;
}

.category-item .cat-icon {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background-color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--primary-purple);
  font-size: 1.1rem;
  margin-right: 15px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.category-item .cat-name {
  flex: 1;
  font-weight: 700;
  color: var(--text-dark);
  font-size: 1rem;
}

.category-item .cat-check {
  color: var(--primary-purple);
  font-size: 1.3rem;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.2s;
}

.category-item.active .cat-check {
  opacity: 1;
  transform: scale(1);
}

/* --- Result Screen Overlay --- */
.result-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #fcf5fc;
  z-index: 2000;
  display: none; /* Shown via JS */
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  padding: 40px 20px;
  animation: fadeIn 0.4s ease-out;
}

.result-overlay.show {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-content {
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.trophy-section {
  margin-bottom: 20px;
}

.trophy-circle {
  width: 80px;
  height: 80px;
  background-color: #fbd114;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2.5rem;
  color: #493902;
  box-shadow: 0 10px 25px rgba(251, 209, 20, 0.4);
  animation: trophyPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.3s both;
}

@keyframes trophyPop {
  0% { transform: scale(0); rotate: -20deg; }
  100% { transform: scale(1); rotate: 0deg; }
}

.result-titles {
  margin-bottom: 30px;
}

.congrats-text {
  font-size: 2.8rem;
  font-weight: 900;
  color: var(--primary-purple);
  margin: 0;
  letter-spacing: -1px;
}

.congrats-subtext {
  font-size: 0.9rem;
  font-weight: 700;
  color: #6a5e78;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 5px;
}

.score-cards {
  display: flex;
  gap: 15px;
  width: 100%;
  margin-bottom: 25px;
}

.result-card {
  flex: 1;
  background: white;
  border-radius: 30px;
  padding: 25px 15px;
  box-shadow: 0 15px 40px rgba(106, 36, 209, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.card-status {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 10px;
}

.status-label {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--primary-purple);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.status-icon {
  color: #ff91c2;
  font-size: 0.7rem;
}

.chaser .status-label {
  color: #a58ebb;
}

.res-team-name {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-dark);
  margin: 0 0 10px 0;
}

.res-score-box {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-bottom: 15px;
}

.res-points {
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--primary-purple);
  line-height: 1;
}

.chaser .res-points {
  color: #a58ebb;
}

.res-unit {
  font-size: 0.8rem;
  font-weight: 800;
  color: #ab9cbd;
}

.res-progress-bg {
  width: 100%;
  height: 6px;
  background-color: #f3e6f7;
  border-radius: 10px;
  overflow: hidden;
}

.res-progress-fill {
  height: 100%;
  background-color: var(--primary-purple);
  border-radius: 10px;
}

.chaser .res-progress-fill {
  background-color: #d8c7e8;
}

.stats-row {
  width: 100%;
  background-color: #f7eaff;
  border-radius: 25px;
  padding: 20px 10px;
  display: flex;
  justify-content: space-around;
  margin-bottom: 30px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.stat-icon {
  font-size: 1.1rem;
  margin-bottom: 3px;
}

.stat-icon.time { color: #8c42ff; }
.stat-icon.taboo { color: #bd1b46; }
.stat-icon.speed { color: #ff91c2; }

.stat-label {
  font-size: 0.6rem;
  font-weight: 800;
  color: #8b7999;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-dark);
}

.next-round-btn {
  width: 100%;
  background-color: #6a24d1;
  color: white;
  border: none;
  padding: 18px;
  border-radius: 20px;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 25px rgba(106, 36, 209, 0.3);
  transition: transform 0.2s, filter 0.2s;
}

.next-round-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

@media (max-width: 480px) {
  .congrats-text { font-size: 2.2rem; }
  .res-points { font-size: 2.8rem; }
  .res-team-name { font-size: 1.1rem; }
}

/* --- Refined Game Screen --- */
.game-screen {
  max-width: 100%;
  padding: 30px 22px 150px;
}

.game-header-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.game-mini-logo {
  width: 110px;
  height: auto;
  object-fit: contain;
}

.game-header-actions {
  display: flex;
  gap: 10px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.ghost-btn {
  background: #efe7f8;
  color: #5f4b78;
  box-shadow: 0 8px 20px rgba(112, 86, 160, 0.12);
}

.game-main-shell {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  padding: 4px 0 24px;
}

.game-scoreboard {
  width: min(460px, 100%);
  margin: 0 auto;
  z-index: 2;
}

.refined-card-area {
  width: 100%;
  margin: 0;
}

.refined-taboo-card {
  max-width: 100%;
  width: min(100%, 520px);
  padding: 36px 28px 28px;
  border-radius: 28px;
}

.refined-timer {
  top: 12px;
  right: -16px;
  transform: none;
}

.round-meta {
  font-size: .95rem;
  font-weight: 800;
  color: #8d7aa6;
  margin-bottom: 8px;
  letter-spacing: .08em;
}

.game-actions-row {
  width: 100%;
  max-width: 460px;
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.action-pill {
  border: 0;
  border-radius: 999px;
  padding: 15px 26px;
  font-family: inherit;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 14px 28px rgba(0,0,0,.12);
}

.correct-pill { background: var(--btn-correct); color: #fff; }
.pass-pill { background: var(--btn-pass); color: #5c4600; }
.taboo-pill { background: var(--btn-taboo); color: #fff; }

.round-start-wrap {
  margin-top: 18px;
}

.large-cta-btn {
  min-width: 260px;
  justify-content: center;
  font-size: 1.05rem;
  padding: 16px 24px;
  border-radius: 999px;
}

.game-bottom-nav {
  max-width: none;
}

/* --- Result Screen --- */
.result-screen {
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 18px;
}

.result-shell {
  width: min(100%, 560px);
  background: rgba(255,255,255,.9);
  border-radius: 32px;
  padding: 28px 24px;
  box-shadow: var(--card-shadow);
}

.result-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffe5a8;
  color: #6a4c00;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 800;
}

.result-title {
  margin: 18px 0 8px;
  font-size: 2rem;
  color: var(--primary-purple);
}

.result-subtitle {
  margin: 0 0 20px;
  color: #7b6a8f;
  font-weight: 600;
}

.result-score-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.result-team-card {
  border-radius: 24px;
  padding: 20px;
  text-align: center;
}

.winner-accent { background: #f0e5ff; }
.secondary-accent { background: #f7eff8; }

.result-team-name {
  font-size: .9rem;
  font-weight: 800;
  color: #8668a4;
  margin-bottom: 8px;
}

.result-team-score {
  font-size: 2.6rem;
  font-weight: 900;
  color: var(--primary-purple);
}

.result-summary-card {
  background: #faf5ff;
  border-radius: 24px;
  padding: 18px;
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #715a89;
  font-weight: 700;
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

@media (max-width: 768px) {
  .game-screen {
    padding: 20px 16px 145px;
  }

  .refined-timer {
    right: 8px;
    top: 14px;
    padding: 10px 16px;
  }

  .refined-taboo-card {
    padding: 34px 18px 22px;
  }

  .target-word {
    font-size: 2rem;
    text-align: center;
  }

  .game-actions-row {
    gap: 10px;
  }

  .action-pill {
    flex: 1 1 calc(50% - 10px);
    min-width: 140px;
  }

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

@media (max-width: 640px) {
  .game-main-shell {
    justify-content: flex-start;
    gap: 12px;
    padding: 0 0 20px;
  }

  .game-scoreboard {
    gap: 10px;
    width: 100%;
    position: sticky;
    top: 8px;
    z-index: 4;
  }

  .team-score {
    padding: 12px 14px;
  }

  .refined-taboo-card {
    padding: 72px 24px 28px;
    border-radius: 28px;
  }

  .refined-timer {
    top: 12px;
    right: -6px;
    transform: none;
  }

  .round-meta {
    font-size: .95rem;
    font-weight: 800;
    color: #8d7aa6;
    margin-bottom: 8px;
    letter-spacing: .08em;
  }

  .game-actions-row {
    width: 100%;
    max-width: 460px;
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 12px;
    flex-wrap: wrap;
  }

  .action-pill {
    border: 0;
    border-radius: 999px;
    padding: 14px 20px;
    font-family: inherit;
    font-weight: 800;
    font-size: .95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 14px 28px rgba(0,0,0,.12);
  }

  .correct-pill { background: var(--btn-correct); color: #fff; }
  .pass-pill { background: var(--btn-pass); color: #5c4600; }
  .taboo-pill { background: var(--btn-taboo); color: #fff; }

  .round-start-wrap {
    margin-top: 10px;
  }
}
