@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800;900&family=Tajawal:wght@400;700;800;900&display=swap');

:root {
  --orange: #f05a28;
  --orange-lt: #ff7043;
  --orange-bg: #fff3ee;
  --orange-dk: #c94510;
  --red: #e53935;
  --green: #2e7d32;
  --text: #1c1c1c;
  --muted: #888;
  --border: #e8e0d8;
  --bg: #f7f4f0;
  --white: #ffffff;
  --dark: #18120e;
  --radius: 14px;
  --radius-s: 8px;
  --font: "Cairo", "Tajawal", sans-serif;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
  --shadow-md: 0 6px 24px rgba(0, 0, 0, 0.10);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100vh;
  margin: 0;
  padding: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  outline: none;
  overflow-y: auto;
}

#app {
  min-height: 100vh;
}

.screen {
  display: none;
  min-height: 100vh;
}

.screen.active {
  display: block;
}

.screen-board.active {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  padding: 0.5rem 0.75rem 0.65rem;
}

.btn {
  font-family: inherit;
  font-weight: 800;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-s);
  border: none;
  cursor: pointer;
  font-size: 1rem;
  transition: transform 0.15s, filter 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  text-decoration: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn.primary {
  background: linear-gradient(135deg, var(--orange-lt), var(--orange));
  color: #fff;
  box-shadow: 0 4px 16px rgba(240, 90, 40, 0.3);
}

.btn.primary:hover {
  filter: brightness(1.06);
}

.btn.ghost {
  background: transparent;
  color: var(--muted);
  border: 1.5px solid var(--border);
}

.btn.ghost:hover {
  border-color: #ccc;
  color: var(--text);
}

.btn.sm {
  height: 38px;
  padding: 0 1rem;
  font-size: 0.85rem;
}

.btn.full {
  width: 100%;
}

.hidden {
  display: none !important;
}

.msg {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--orange);
  min-height: 1.2em;
}

.msg.ok {
  color: var(--green);
}

.msg.center {
  text-align: center;
}

.hint {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.demo-code {
  margin-top: 0.5rem;
  padding: 0.75rem;
  background: var(--orange-bg);
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  color: var(--orange);
}

.btn-back-sub {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--text);
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}

.btn-back-sub:hover {
  background: var(--orange-bg);
  color: var(--orange);
}

.magic-wait {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  text-align: center;
  padding: 0.5rem 0;
}

.magic-wait.hidden {
  display: none;
}

.magic-envelope {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--orange-bg);
  border: 2px solid #ffd0b8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--orange);
  animation: magicBounce 1.8s ease-in-out infinite;
}

@keyframes magicBounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px);
  }
}

.magic-title {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--text);
}

.magic-desc {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.7;
}

.magic-pulse {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  margin: 0.4rem 0;
}

.magic-pulse span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
  opacity: 0.3;
  animation: pulseAnim 1.2s ease-in-out infinite;
}

.magic-pulse span:nth-child(2) {
  animation-delay: 0.2s;
}

.magic-pulse span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes pulseAnim {

  0%,
  100% {
    opacity: 0.3;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.3);
  }
}

.verifying-panel {
  background: var(--white);
  border-radius: 20px;
  padding: 3rem 2.5rem;
  text-align: center;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  min-width: 280px;
}

.verifying-icon {
  font-size: 3rem;
  color: var(--orange);
  margin-bottom: 1rem;
}

.verifying-icon.success {
  color: #2e7d32;
}

.verifying-icon.error {
  color: var(--red);
}

.verifying-msg {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
}

.auth-card {
  max-width: 380px;
  margin: 8vh auto;
  padding: 2.5rem 2rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.auth-logo {
  font-size: 2.4rem;
  font-weight: 900;
  text-align: center;
  color: var(--orange);
  margin-bottom: 0.2rem;
  letter-spacing: -1px;
}

.subtitle {
  text-align: center;
  color: var(--muted);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.form label {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 700;
}

.form input {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-s);
  border: 1.5px solid var(--border);
  background: #fafafa;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form input:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(240, 90, 40, 0.1);
}

.link-btn {
  margin-top: 1.1rem;
  background: none;
  border: none;
  color: var(--orange);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.92rem;
  text-decoration: none;
  width: 100%;
  text-align: center;
}

.screen-landing {
  background: var(--bg);
  height: 100vh;
  overflow: hidden;
}

#screen-home.active {
  display: flex !important;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

#screen-home .landing-hero {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 1.75rem 1.5rem;
  gap: 1.25rem;
}

.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 2rem;
  background: var(--white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 10;
}

.nav-logo {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--orange);
  letter-spacing: -0.5px;
}

.credits-badge-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1rem;
  height: 38px;
  border-radius: 12px;
  background: var(--white);
  border: 1.5px solid var(--border);
  font-size: 0.85rem;
  color: var(--text);
  box-shadow: none;
}

.credits-badge-top i {
  color: var(--orange);
}

.credits-badge-top strong {
  font-weight: 900;
  font-size: 1rem;
}

.nav-user {
  position: relative;
  cursor: pointer;
}

.user-trigger {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0 0.85rem;
  height: 38px;
  border-radius: 12px;
  background: #fbf6fd;
  border: 1.5px solid rgba(0, 0, 0, 0.05);
  transition: background 0.2s, border-color 0.2s;
  user-select: none;
}

.user-trigger:hover {
  background: #f5f0f8;
  border-color: rgba(156, 39, 176, 0.2);
}

.nav-username {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text);
}

.menu-arrow {
  font-size: 0.75rem;
  color: var(--muted);
  transition: transform 0.3s;
}

.nav-user.active .menu-arrow {
  transform: rotate(180deg);
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 220px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 2000;
  animation: dropdownIn 0.2s cubic-bezier(0.2, 1, 0.3, 1);
}

@keyframes dropdownIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nav-user.active .user-dropdown {
  display: flex;
}

.dropdown-item {
  display: flex !important;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.25rem;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  transition: background 0.2s;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: right;
  width: 100%;
}

.dropdown-item:hover {
  background: #f9f9f9;
}

.dropdown-item.admin {
  color: #9c27b0;
  border-bottom: 1px solid #eee;
}

.dropdown-item.logout {
  color: var(--muted);
}

.dropdown-item.logout:hover {
  background: #fff5f5;
  color: var(--red);
}

.dropdown-header-info {
  padding: 1.25rem;
  background: linear-gradient(to bottom, #fbfafd, #ffffff);
}

.user-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  background: #f1f3f5;
  color: #495057;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.user-role-badge.admin {
  background: #e8f5e9;
  color: #2e7d32;
}

.user-role-badge.manager {
  background: #f3e5f5;
  color: #9c27b0;
}

.user-role-badge.editor {
  background: #fff3e0;
  color: #e65100;
}

.sub-status-box {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sub-label {
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 700;
}

.sub-label strong.active {
  color: #2e7d32;
}

.sub-label strong.inactive {
  color: var(--muted);
}

.sub-timer {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 0;
}

.nav-user-side {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.nav-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--orange-bg);
  border: 2px solid var(--orange);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--orange);
  font-size: 1rem;
}

.landing-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 62px);
  padding: 3rem 1.5rem;
  gap: 1.75rem;
}

.landing-title {
  font-size: clamp(2.8rem, 8vw, 5rem);
  font-weight: 900;
  text-align: center;
  line-height: 1.1;
  color: var(--text);
  letter-spacing: -2px;
}

.title-accent {
  color: var(--orange);
}

.landing-sub {
  color: var(--muted);
  font-size: 1.05rem;
  text-align: center;
  margin-top: -0.75rem;
}

.landing-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  width: 100%;
  max-width: 680px;
}

@media (max-width: 560px) {
  .landing-cards {
    grid-template-columns: 1fr;
    max-width: 320px;
  }
}

.landing-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  padding: 2rem 1rem;
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  box-shadow: var(--shadow);
}

.landing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--orange);
}

.landing-card:active {
  transform: scale(0.97);
}

.card-play {
  border-color: rgba(240, 90, 40, 0.3);
}

.card-games {
  border-color: rgba(46, 125, 50, 0.2);
}

.card-contact {
  border-color: rgba(0, 0, 0, 0.1);
}

.card-admin {
  grid-column: 1 / -1;
  border-color: rgba(156, 39, 176, 0.2);
  flex-direction: row !important;
  justify-content: center;
  padding: 1.25rem !important;
}

.lcard-icon {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}

.card-play .lcard-icon {
  background: var(--orange-bg);
  color: var(--orange);
}

.card-games .lcard-icon {
  background: #f0faf1;
  color: var(--green);
}

.card-contact .lcard-icon {
  background: #f0f4ff;
  color: #3b5bdb;
}

.card-admin .lcard-icon {
  background: #f3e5f5;
  color: #9c27b0;
  width: 44px;
  height: 44px;
  font-size: 1.2rem;
}

.lcard-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.lcard-title {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--text);
}

.lcard-sub {
  font-size: 0.78rem;
  color: var(--muted);
}

.credits-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1.25rem;
  border-radius: 99px;
  background: var(--white);
  border: 1.5px solid var(--border);
  font-size: 0.9rem;
  color: var(--text);
  box-shadow: var(--shadow);
}

.credits-badge i {
  color: var(--orange);
}

.credits-badge span:nth-child(2) {
  font-weight: 900;
  font-size: 1.05rem;
}

.btn-add-credits {
  padding: 0.3rem 0.75rem;
  border-radius: 99px;
  background: var(--orange-bg);
  border: 1.5px solid rgba(240, 90, 40, 0.25);
  color: var(--orange);
  font-family: inherit;
  font-weight: 800;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-add-credits:hover {
  background: #fde5d8;
}

.subscreen-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.subscreen-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.subscreen-title {
  font-size: 1.5rem;
  font-weight: 900;
}

.my-games-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  padding: 0.5rem 0;
}

@media (max-width: 1000px) {
  .my-games-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .my-games-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  .my-games-list {
    grid-template-columns: 1fr;
  }
}

.empty-state {
  text-align: center;
  color: var(--muted);
  line-height: 2;
  padding: 3rem 0;
  font-size: 0.95rem;
  width: 100%;
}

.saved-game-card-new {
  width: 100%;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.13);
  border: 2px solid rgba(240, 90, 40, 0.15);
}

.sgc-header {
  background: linear-gradient(145deg, #ff6b3d, #e53515);
  padding: 1.1rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  text-align: center;
}

.sgc-count {
  background: #2e7d32;
  color: #fff;
  border-radius: 99px;
  padding: 0.22rem 0.75rem;
  font-size: 0.68rem;
  font-weight: 800;
  font-family: var(--font);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.sgc-name {
  font-size: 1.85rem;
  font-weight: 900;
  color: #fff;
  line-height: 1.1;
  word-break: break-word;
}

.sgc-play-btn {
  background: #fff;
  color: var(--orange);
  border: none;
  border-radius: 99px;
  padding: 0.48rem 2rem;
  font-weight: 900;
  font-size: 0.95rem;
  font-family: var(--font);
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
  transition: transform 0.15s, filter 0.15s;
}

.sgc-play-btn:hover {
  filter: brightness(0.96);
  transform: scale(1.04);
}

.sgc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--white);
}

.sgc-cell {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--orange-bg);
}

.sgc-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sgc-icon {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: var(--orange);
  opacity: 0.5;
}

.sgc-cell-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, var(--orange-lt), var(--orange));
  color: #fff;
  font-size: 0.58rem;
  font-weight: 800;
  text-align: center;
  padding: 0.18rem 0.2rem;
  font-family: var(--font);
  line-height: 1.2;
}

.contact-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem 0;
}

.contact-text {
  color: var(--muted);
  text-align: center;
}

.screen#screen-setup {
  display: none;
  flex-direction: column;
  min-height: 100vh;
  overflow-y: auto;
  padding: 0;
}

.screen#screen-setup.active {
  display: flex;
}

.setup-topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 1.25rem;
  flex-shrink: 0;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 10;
}

.setup-topbar-logo {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--orange);
  letter-spacing: -0.5px;
}

.setup-topbar-right {
  flex: 1;
  display: flex;
  justify-content: flex-start;
}

.setup-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  right: 0.85rem;
  color: var(--muted);
  font-size: 0.88rem;
  pointer-events: none;
}

.setup-search {
  width: 220px;
  padding: 0.6rem 2.4rem 0.6rem 0.9rem;
  border-radius: 99px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.setup-search:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(240, 90, 40, 0.08);
}

.setup-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem 1rem 2rem;
}

.setup-section-card {
  width: 100%;
  max-width: 1000px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.setup-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--orange-bg);
  flex-shrink: 0;
}

.setup-section-title {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--orange);
}

.pick-counter {
  font-weight: 800;
  font-size: 0.85rem;
  color: #b35a20;
  padding: 0.35rem 0.85rem;
  border-radius: 99px;
  background: var(--white);
  border: 1.5px solid rgba(240, 90, 40, 0.2);
  white-space: nowrap;
}

.pick-counter-ok {
  color: var(--green);
  border-color: rgba(46, 125, 50, 0.25);
  background: #f0faf1;
}

.setup-section-card.cats-card {
  background: transparent;
  border: none;
  box-shadow: none;
  overflow: visible;
}

.setup-section-card.cats-card .setup-section-header {
  background: var(--white);
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 0;
}

.setup-categories-grouped {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 0.25rem 0 1rem;
}

.cat-group {
  width: 100%;
  max-width: 1000px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cat-group-label {
  position: relative;
  z-index: 2;
  margin-bottom: -16px;
  display: flex;
  align-items: center;
  gap: 1rem;
  background: linear-gradient(135deg, var(--orange-lt), var(--orange));
  color: #fff;
  font-weight: 900;
  font-size: 0.92rem;
  padding: 0.42rem 1.25rem 0.42rem 0.75rem;
  border-radius: 99px;
  box-shadow: 0 4px 14px rgba(240, 90, 40, 0.32);
}

.cat-group-body {
  width: 100%;
  position: relative;
  background: var(--white);
  border-radius: 18px;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-md);
  padding: 1.6rem 1rem 1rem;
  display: flex;
  align-items: flex-start;
}

.cat-group-toggle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.4);
  cursor: pointer;
  color: #fff;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
}

.cat-group-toggle:hover {
  background: rgba(255, 255, 255, 0.4);
}

.cat-group-toggle.toggled {
  transform: rotate(-180deg);
  background: var(--white);
  color: var(--orange);
}

.cat-group-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  flex: 1;
  overflow: hidden;
  max-height: 1500px;
  opacity: 1;
  transition: max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s ease;
}

.cat-group-cards.collapsed {
  max-height: 0;
  opacity: 0;
}

.cat-group-body {
  transition: padding 0.35s ease;
}

.cat-group-body.body-collapsed {
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
}

.setup-teams-inner {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1rem 1.25rem 1.25rem;
}

.teams-inputs-row {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.teams-inputs-row .team-field {
  flex: 1;
  min-width: 150px;
}

.teams-start-row {
  display: flex;
  justify-content: center;
  padding-top: 0.25rem;
}

.teams-start-row .btn-start-big {
  width: auto;
  padding: 0.85rem 3rem;
}

@media (max-width: 640px) {
  .teams-fields-row {
    flex-direction: column;
    align-items: stretch;
  }

  .teams-fields-row .btn-start-big {
    width: 100%;
  }

  .pick-card {
    width: 108px;
    height: 145px;
  }
}

.pick-card {
  position: relative;
  border-radius: 16px;
  border: 2.5px solid var(--border);
  background: #f5f3f0;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.18s ease,
    transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
  width: 130px;
  height: 170px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  padding: 0;
  font-family: var(--font);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.09);
}

.pick-card:hover {
  border-color: var(--orange);
  box-shadow: 0 8px 26px rgba(240, 90, 40, 0.22);
  transform: translateY(-5px);
}

.pick-card.picked {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(240, 90, 40, 0.28), 0 6px 22px rgba(240, 90, 40, 0.18);
  transform: scale(1.04);
}

.pick-card:active {
  transform: scale(0.95);
}

.pick-img-area {
  flex: 1;
  min-height: 0;
  background: linear-gradient(160deg, #f0ece6, #e8e1d8);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.pick-img-area img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  transition: transform 0.3s;
}

.pick-card:hover .pick-img-area img {
  transform: scale(1.06);
}

.pick-img-area .pick-icon-fa {
  font-size: 2.8rem;
  color: var(--orange);
  opacity: 0.6;
}

.pick-img-area::after {
  display: none;
}

.pick-q-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 4;
  background: var(--orange);
  color: #fff;
  font-size: 0.58rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: 99px;
  line-height: 1.5;
  pointer-events: none;
  border: 1px solid rgba(255,255,255,0.3);
}

.pick-sparkle {
  position: absolute;
  font-size: 0.85rem;
  color: var(--orange);
  z-index: 3;
  pointer-events: none;
  line-height: 1;
  filter: drop-shadow(0 0 3px rgba(240, 90, 40, 0.4));
}

.pick-sparkle-r {
  top: 7px;
  right: 7px;
}

.pick-sparkle-l {
  bottom: 8px;
  left: 7px;
  font-size: 0.65rem;
  opacity: 0.7;
}

.pick-info-btn {
  position: absolute;
  top: 7px;
  left: 7px;
  z-index: 4;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #2196f3;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
  font-style: italic;
  font-family: Georgia, serif;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 2px 6px rgba(33, 150, 243, 0.35);
  pointer-events: none;
}

.pick-remain-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 4;
  background: linear-gradient(135deg, var(--orange-lt), var(--orange));
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  font-family: var(--font);
  padding: 0.2rem 0.5rem;
  border-radius: 99px;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(240, 90, 40, 0.3);
}

.pick-sub-name {
  background: linear-gradient(135deg, var(--orange-lt), var(--orange));
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  font-family: var(--font);
  text-align: center;
  padding: 0.5rem 0.4rem;
  flex-shrink: 0;
  line-height: 1.2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.pick-check {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  background: rgba(240, 90, 40, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: var(--orange);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.pick-card.picked .pick-check {
  opacity: 1;
}

.team-lifelines {
  margin-top: 0.45rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--border);
}

.lifelines-label {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--muted);
  text-align: center;
  margin-bottom: 0.35rem;
  font-family: var(--font);
}

.lifelines-row {
  display: flex;
  gap: 0.35rem;
  justify-content: center;
  align-items: center;
}

.lifeline-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  border: 2px solid var(--ll-color, var(--orange));
  background: transparent;
  border-radius: 10px;
  padding: 0.3rem 0.45rem;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s, background 0.15s;
  color: var(--ll-color, var(--orange));
  font-family: var(--font);
}

.lifeline-btn i {
  font-size: 1.1rem;
}

.lifeline-btn .ll-label {
  font-size: 0.52rem;
  font-weight: 800;
  white-space: nowrap;
}

.lifeline-btn:not(:disabled):hover {
  background: rgba(0, 0, 0, 0.05);
  transform: scale(1.12);
}

.lifeline-btn:not(:disabled):active {
  transform: scale(0.9);
}

.lifeline-btn.used {
  opacity: 0.3;
  border-color: #bbb;
  color: #aaa;
  cursor: not-allowed;
  filter: grayscale(1);
}

.lifeline-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  cursor: pointer;
}

.lifeline-overlay-card {
  background: linear-gradient(145deg, #1c1c3a, #12122a);
  border-radius: 28px;
  padding: 2.5rem 3.5rem 2rem;
  text-align: center;
  color: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  min-width: 280px;
  position: relative;
  overflow: hidden;
  cursor: default;
}

.lol-top {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  font-family: var(--font);
}

.lol-icon-wrap {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  border: 2px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.4rem 0;
}

.lol-icon-el {
  font-size: 2.6rem;
}

.lol-name {
  font-size: 2rem;
  font-weight: 900;
  color: var(--orange-lt);
  font-family: var(--font);
  line-height: 1.1;
}

.lol-team {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.65);
  font-family: var(--font);
  font-weight: 600;
}

.lol-bar {
  position: absolute;
  bottom: 0;
  right: 0;
  height: 4px;
  width: 100%;
  background: linear-gradient(90deg, var(--orange-lt), var(--orange));
  border-radius: 0 0 4px 4px;
}

@keyframes lolIn {
  from {
    opacity: 0;
    transform: scale(0.85);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes lolOut {
  from {
    opacity: 1;
    transform: scale(1);
  }

  to {
    opacity: 0;
    transform: scale(0.9);
  }
}

.lol-in .lifeline-overlay-card {
  animation: lolIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.lol-out .lifeline-overlay-card {
  animation: lolOut 0.35s ease forwards;
}


.team-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.team-label {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--orange);
}

.team-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-s);
  border: 1.5px solid var(--border);
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.team-input:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(240, 90, 40, 0.1);
}

.btn-start-big {
  padding: 0.85rem 2rem;
  font-size: 1rem;
  border-radius: 99px;
  background: linear-gradient(135deg, #ff7043, var(--orange));
  color: #fff;
  font-weight: 900;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(240, 90, 40, 0.35);
  transition: filter 0.15s, transform 0.15s;
  font-family: var(--font);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-start-big:hover {
  filter: brightness(1.06);
}

.btn-start-big:active {
  transform: scale(0.98);
}

.board-topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.4rem 0.6rem;
  flex-shrink: 0;
  padding: 0.5rem 0.85rem;
  margin-bottom: 0.5rem;
  border-radius: 99px;
  background: linear-gradient(135deg, var(--orange-lt), var(--orange));
  box-shadow: 0 4px 18px rgba(240, 90, 40, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.topbar-slot.topbar-start {
  justify-self: start;
}

.topbar-slot.topbar-mid {
  justify-self: center;
}

.topbar-slot.topbar-end {
  justify-self: end;
}

.topbar-title {
  font-weight: 900;
  font-size: clamp(0.9rem, 2.5vw, 1.15rem);
  color: #fff;
  white-space: nowrap;
  letter-spacing: -0.5px;
}

.turn-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: inherit;
  font-weight: 700;
  font-size: clamp(0.75rem, 2vw, 0.88rem);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
}

.turn-pill:hover {
  background: rgba(255, 255, 255, 0.3);
}

.turn-pill-text strong {
  font-weight: 900;
}

.btn-end-bar {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: inherit;
  font-weight: 800;
  font-size: clamp(0.72rem, 1.8vw, 0.85rem);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
}

.btn-end-bar:hover {
  background: rgba(255, 255, 255, 0.3);
}

.btn-end-red {
  background: rgba(229, 57, 53, 0.3) !important;
  border-color: rgba(229, 57, 53, 0.8) !important;
}

.btn-end-red:hover {
  background: rgba(229, 57, 53, 0.5) !important;
}

.topbar-slot.topbar-end {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

@media (max-width: 600px) {
  .board-topbar {
    grid-template-columns: 1fr auto 1fr;
    border-radius: 12px;
    padding: 0.4rem 0.5rem;
    gap: 0.25rem;
  }

  .topbar-title {
    font-size: 0.78rem;
  }

  .turn-pill {
    padding: 0.3rem 0.55rem;
    font-size: 0.7rem;
    gap: 0.3rem;
  }

  .btn-end-bar {
    padding: 0.3rem 0.55rem;
    font-size: 0.7rem;
    gap: 0.25rem;
  }

  .topbar-slot.topbar-end {
    gap: 0.3rem;
  }
}

.board-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 5px 2rem;
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: auto auto;
  gap: 0.85rem 0.75rem;
  width: 100%;
  max-width: 860px;
  margin-inline: auto;
  height: auto;
  align-content: start;
}

@media (max-width: 680px) {
  .board-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
  }
}

@media (max-width: 440px) {
  .board-grid {
    grid-template-columns: 1fr;
  }
}

.cat-col {
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  border: 1.5px solid var(--border);
  background: var(--white);
  box-shadow: var(--shadow);
}

.cat-col-head {
  position: relative;
  width: 100%;
  height: 56px;
  background: var(--orange-bg);
  overflow: hidden;
  flex-shrink: 0;
}

.cat-col-head img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.cat-col-head::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(240, 90, 40, 0.65) 100%);
  pointer-events: none;
}

.cat-remain {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 2;
  font-size: 0.58rem;
  font-weight: 900;
  padding: 0.15rem 0.42rem;
  border-radius: 99px;
  background: var(--orange);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.cat-col-name {
  position: absolute;
  bottom: 0;
  right: 0;
  left: 0;
  z-index: 2;
  font-size: 0.68rem;
  font-weight: 900;
  text-align: center;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  padding: 0.2rem 0.3rem 0.28rem;
}

.cat-no-img {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  background: var(--orange-bg);
  color: var(--orange);
}

.cell-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 3px 4px;
}

.point-cell {
  position: relative;
  aspect-ratio: 2.2 / 1;
  min-height: 26px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-weight: 900;
  font-size: clamp(0.62rem, 1.4vw, 0.85rem);
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, filter 0.15s;
}

.point-cell.tier-200 {
  color: #92400e;
  background: #fef3c7;
  border-color: rgba(146, 64, 14, 0.2);
}

.point-cell.tier-400 {
  color: var(--orange);
  background: var(--orange-bg);
  border-color: rgba(240, 90, 40, 0.22);
}

.point-cell.tier-600 {
  color: var(--red);
  background: #fef2f2;
  border-color: rgba(229, 57, 53, 0.22);
}

.point-cell:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.04);
  filter: brightness(0.94);
  z-index: 2;
}

.point-cell:disabled {
  opacity: 0.22;
  cursor: not-allowed;
  text-decoration: line-through;
  transform: none !important;
  filter: none !important;
}

.tier-divider {
  height: 1px;
  background: var(--border);
  margin: 0 4px;
}

.board-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  flex-shrink: 0;
  padding-top: 0.5rem;
  max-width: 860px;
  margin-inline: auto;
  width: 100%;
}

.team-score {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-s);
  padding: 0.45rem 0.5rem;
  text-align: center;
  box-shadow: var(--shadow);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.team-score.active-turn {
  border-color: var(--orange);
  box-shadow: 0 0 0 2px #fff, 0 0 0 5px var(--orange), 0 8px 24px rgba(240, 90, 40, 0.25);
  transform: translateY(-4px);
  z-index: 10;
}

.team-score-name {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--orange);
  margin-bottom: 0.1rem;
}

.team-score-val {
  font-size: 1.35rem;
  font-weight: 900;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.score-btns {
  display: flex;
  gap: 0.3rem;
  justify-content: center;
  margin-top: 0.25rem;
}

.score-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fafafa;
  color: var(--text);
  cursor: pointer;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.score-btn:hover {
  background: var(--orange-bg);
}

.team-lifelines {
  margin-top: 0.45rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--border);
}

.lifelines-row {
  display: flex;
  gap: 0.35rem;
  justify-content: center;
  align-items: stretch;
}

.lifeline-btn {
  flex: 1;
  min-width: 0;
  max-width: 70px;
  height: 44px;
  border-radius: 10px;
  border: 2px solid var(--ll-color, var(--orange));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--ll-color, var(--orange));
  cursor: pointer;
  transition: all 0.2s;
}

.lifeline-btn i {
  font-size: 1rem;
}

.lifeline-btn .ll-label {
  font-size: 0.52rem;
  font-weight: 800;
  margin-top: 2px;
  white-space: nowrap;
}

.lifeline-btn.used {
  background: #eee !important;
  border-color: #bbb !important;
  color: #aaa !important;
  cursor: not-allowed !important;
  filter: grayscale(1);
  opacity: 0.3;
}

.score-pop {
  transform: scale(1.3);
  color: var(--orange);
}

@media (max-width: 500px) {
  .board-footer {
    gap: 0.35rem;
  }

  .team-score {
    padding: 0.3rem 0.35rem;
  }

  .team-score-name {
    font-size: 0.7rem;
  }

  .team-score-val {
    font-size: 1.1rem;
  }

  .score-btn {
    width: 24px;
    height: 24px;
    font-size: 0.68rem;
  }

  .lifeline-btn {
    height: 36px;
    border-radius: 8px;
  }

  .lifeline-btn i {
    font-size: 0.85rem;
  }

  .lifeline-btn .ll-label {
    display: none;
  }
}

@media (max-width: 380px) {
  .screen-board.active {
    padding: 0.35rem 0.4rem 0.5rem;
  }

  .board-grid {
    gap: 0.5rem 0.4rem;
  }

  .btn-end-bar span {
    display: none;
  }

  .turn-pill-text {
    font-size: 0.65rem;
  }
}



@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    transform: translateY(24px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  background: #fffaf7;
  animation: fadeIn 0.2s ease;
  overflow: hidden;
}

.overlay.hidden {
  display: none !important;
}

.question-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
  animation: slideIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.question-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1.25rem;
  background: linear-gradient(135deg, var(--orange-lt), var(--orange));
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
  box-shadow: 0 3px 12px rgba(240, 90, 40, 0.22);
}

.q-meta-bar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.q-category-badge,
.q-points-badge,
.timer-wrap,
.btn-close-mobile {
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.22);
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 800;
  gap: 0.5rem;
  text-decoration: none;
  box-sizing: border-box;
}

.q-points-badge {
  font-weight: 900;
}

.timer-wrap {
  background: rgba(0, 0, 0, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

.timer-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.32rem 0.8rem;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.timer-wrap.expired {
  background: rgba(0, 0, 0, 0.1);
}

.timer-label {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.75rem;
}

.timer-value {
  font-size: 1.15rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: #fff;
  min-width: 25px;
  text-align: center;
}

.timer-restart {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  transition: all 0.2s;
}

@media (max-width: 600px) {
  .question-top {
    padding: 0.5rem 0.75rem;
    gap: 0.4rem;
  }

  .q-meta-bar {
    gap: 0.4rem;
  }

  .timer-wrap {
    height: 30px;
    padding: 0 0.5rem;
    font-size: 0.72rem;
    border-radius: 9px;
    gap: 0.35rem;
    display: flex;
    flex-direction: row-reverse;
  }

  .q-category-badge,
  .q-points-badge,
  .btn-close-mobile {
    height: 30px;
    padding: 0 0.65rem;
    font-size: 0.72rem;
    border-radius: 9px;
    gap: 0.35rem;
  }

  .timer-value {
    font-size: 0.95rem;
    order: 2;
  }

  .timer-label {
    order: 3;
  }

  .timer-restart {
    width: 24px;
    height: 24px;
    font-size: 0.68rem;
    order: 1;
  }
}

.timer-restart:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.timer-restart:hover {
  background: rgba(255, 255, 255, 0.28);
}

.q-main-row {
  flex: 1;
  display: flex;
  flex-direction: row;
  min-height: 0;
  overflow: hidden;
}

.q-scores-side {
  width: 160px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.85rem 0.7rem;
  align-items: stretch;
  justify-content: center;
  background: #fff8f4;
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.q-score-card {
  width: 100%;
  border-radius: 14px;
  padding: 0.75rem 0.6rem 0.7rem;
  background: var(--white);
  border: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.18rem;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.q-score-card.active-turn {
  border-color: var(--orange);
  box-shadow: 0 4px 18px rgba(240, 90, 40, 0.25);
  background: linear-gradient(160deg, #fff8f4, var(--orange-bg));
}

.q-sc-crown {
  font-size: 1.25rem;
  color: var(--orange);
  line-height: 1;
}

.q-sc-name {
  font-size: 0.72rem;
  font-weight: 900;
  color: var(--text);
  text-align: center;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.q-sc-score {
  font-size: 2rem;
  font-weight: 900;
  color: var(--orange);
  line-height: 1.1;
}

.q-sc-label {
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.q-sc-lifelines {
  display: flex;
  flex-direction: row;
  gap: 0.3rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--border);
  width: 100%;
}

.q-ll-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--white);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  padding: 0;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.15s, border-color 0.15s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.07);
}

.q-ll-btn i {
  font-size: 1rem;
}

.q-ll-btn span {
  font-size: 0.38rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1;
  display: none;
}

.q-ll-btn:hover:not(:disabled) {
  transform: scale(1.15);
  border-color: var(--orange);
  box-shadow: 0 3px 10px rgba(240, 90, 40, 0.25);
}

.q-ll-btn:active:not(:disabled) {
  transform: scale(0.9);
}

.q-ll-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
  filter: grayscale(1);
  transform: none !important;
}

.question-body-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  overflow-y: auto;
  gap: 1rem;
}

.question-block {
  width: 100%;
  max-width: 700px;
  padding: 2rem 2.5rem;
  border-radius: 18px;
  background: var(--white);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-md);
  text-align: center;
}

.question-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 1.25rem;
  text-transform: uppercase;
}

.question-body {
  margin: 0;
  font-size: clamp(1.3rem, 3.5vw, 1.9rem);
  font-weight: 800;
  line-height: 1.7;
  color: var(--text);
  word-break: break-word;
}

.q-actions-row {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

.q-actions-row .btn {
  min-width: 170px;
}

.question-img-wrap {
  margin: 1.2rem auto 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1.5px solid var(--border);
  max-width: 360px;
}

.question-img-wrap img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 240px;
  object-fit: contain;
  background: #f9f9f9;
}

.answer-block {
  width: 100%;
  max-width: 700px;
  display: flex;
  flex-direction: column;
  border: 2px solid var(--border);
  background: var(--white);
}

.answer-block.hidden {
  display: none;
}

.answer-reveal-panel {
  padding: 1.75rem 2rem;
  background: #f0faf1;
  border-bottom: 1.5px solid rgba(46, 125, 50, 0.15);
  text-align: center;
}

.answer-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: #3a9c40;
  margin-bottom: 0.85rem;
  text-transform: uppercase;
}

.answer-text {
  margin: 0;
  font-size: clamp(1.2rem, 3vw, 1.65rem);
  font-weight: 800;
  color: #2e7d32;
  line-height: 1.6;
}

.answer-img-wrap {
  margin: 1rem 0 0;
  overflow: hidden;
  border: 1px solid var(--border);
}

.answer-img-wrap img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: contain;
  background: #f9f9f9;
}

.who-panel {
  padding: 1.25rem 1.5rem;
  background: var(--white);
}

.who-answered-row {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.who-answered-row .label {
  font-size: 0.88rem;
  color: var(--text);
  font-weight: 800;
  text-align: center;
}

.who-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.who-btns .btn {
  padding: 0.7rem 1rem;
  font-size: 0.95rem;
  border-radius: 6px;
}

#who-none {
  font-size: 0.88rem;
  border-radius: 6px;
}

#btn-back-question {
  font-size: 0.88rem;
  background: none;
  border: none;
  color: var(--orange);
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  padding: 0.4rem 0;
  text-align: start;
}

#btn-back-question:hover {
  color: var(--orange-lt);
}

.overlay-footer {
  flex-shrink: 0;
  padding: 0.75rem 1.25rem;
  background: var(--white);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-start;
}

#btn-close-question {
  font-size: 0.9rem;
  background: none;
  border: none;
  color: var(--orange);
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  padding: 0.4rem 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

#screen-finish.screen.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.finish-card {
  width: 100%;
  max-width: 480px;
  text-align: center;
  padding: 3rem 2.5rem 2.5rem;
  background: var(--white);
  border-radius: 20px;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-md);
  animation: slideIn 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.finish-crown {
  font-size: 3.5rem;
  display: block;
  margin-bottom: 0.5rem;
  color: #f59e0b;
  animation: bounce 1.2s ease-in-out infinite alternate;
}

@keyframes bounce {
  from {
    transform: translateY(0) rotate(-5deg);
  }

  to {
    transform: translateY(-8px) rotate(5deg);
  }
}

.finish-title {
  font-size: 2rem;
  font-weight: 900;
  color: var(--orange);
  margin-bottom: 0.35rem;
}

.winner-name {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--green);
  margin-bottom: 1.75rem;
}

.finish-divider {
  height: 1px;
  background: var(--border);
  margin: 0 0 1.25rem;
}

.finish-scores {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-bottom: 1.75rem;
}

.finish-team {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.1rem;
  border-radius: 12px;
  background: #fafafa;
  border: 1px solid var(--border);
}

.finish-team.winner-team {
  border-color: var(--orange);
  background: var(--orange-bg);
}

.finish-team-name {
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.finish-team-score {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--orange);
}

#btn-finish-home {
  width: 100%;
  padding: 0.9rem;
  font-size: 1rem;
  border-radius: 99px;
}

@keyframes fadeUpIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#screen-home .landing-title {
  animation: fadeUpIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.05s both;
}

#screen-home .landing-sub {
  animation: fadeUpIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.14s both;
}

#screen-home .landing-cards {
  animation: fadeUpIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.22s both;
}

#screen-home .credits-badge {
  animation: fadeUpIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.32s both;
}

.cat-group {
  animation: fadeUpIn 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.cat-col {
  animation: fadeUpIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.saved-game-card-new {
  animation: fadeUpIn 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes pickBounce {
  0% {
    transform: scale(1);
  }

  30% {
    transform: scale(1.12) translateY(-7px);
  }

  65% {
    transform: scale(0.96);
  }

  85% {
    transform: scale(1.04);
  }

  100% {
    transform: scale(1);
  }
}

.pick-card.pick-anim {
  animation: pickBounce 0.48s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scorePop {
  0% {
    transform: scale(1);
  }

  45% {
    transform: scale(1.3);
    color: var(--orange);
  }

  100% {
    transform: scale(1);
  }
}

.score-pop {
  animation: scorePop 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cellFlash {
  0% {
    filter: brightness(1.5);
  }

  100% {
    filter: brightness(1);
  }
}

.point-cell:active:not(:disabled) {
  animation: cellFlash 0.18s ease;
}

.auth-card {
  animation: fadeUpIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.subscreen-title {
  animation: fadeUpIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

.team-score-val {
  transition: color 0.2s ease;
}

@keyframes logoPulse {
  0% {
    letter-spacing: -0.5px;
  }

  50% {
    letter-spacing: 1px;
  }

  100% {
    letter-spacing: -0.5px;
  }
}

.landing-nav .nav-logo {
  animation: logoPulse 2.5s ease-in-out 0.5s 1;
}

@keyframes screenIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.screen.active {
  animation: screenIn 0.3s ease forwards;
}

.screen-board.active {
  animation: screenIn 0.3s ease forwards;
}

.board-cell {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.board-cell:not(.used):hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.board-cell:not(.used):active {
  transform: scale(0.96);
}

@keyframes shake {

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

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

  50% {
    transform: translateX(5px);
  }

  75% {
    transform: translateX(-5px);
  }
}

.shake {
  animation: shake 0.3s ease-in-out;
  color: var(--red) !important;
}

.msg {
  min-height: 1.4rem;
  margin: 0.2rem 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  transition: all 0.2s;
}

.msg.ok {
  color: var(--green);
}

.msg.error {
  color: var(--red);
}

.screen-finish-full {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 2rem;
  z-index: 1000;
  animation: fadeIn 0.4s ease;
}

.finish-card {
  width: 100%;
  max-width: 480px;
  text-align: center;
  padding: 3rem 2.5rem 2.5rem;
  background: var(--white);
  border-radius: 20px;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-md);
  animation: slideIn 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.finish-crown {
  font-size: 3.5rem;
  display: block;
  margin-bottom: 0.5rem;
  color: #f59e0b;
  animation: bounce 1.2s ease-in-out infinite alternate;
}

@keyframes bounce {
  from {
    transform: translateY(0) rotate(-5deg);
  }

  to {
    transform: translateY(-8px) rotate(5deg);
  }
}

.finish-title {
  font-size: 2rem;
  font-weight: 900;
  color: var(--orange);
  margin-bottom: 0.35rem;
}

.winner-name {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--green);
  margin-bottom: 1.75rem;
}

.finish-divider {
  height: 1px;
  background: var(--border);
  margin: 0 0 1.25rem;
}

.finish-scores {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-bottom: 1.75rem;
}

.finish-team {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.1rem;
  border-radius: 12px;
  background: #fafafa;
  border: 1px solid var(--border);
}

.finish-team.winner-team {
  border-color: var(--orange);
  background: var(--orange-bg);
}

.finish-team-name {
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.finish-team-score {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--orange);
}

.btn-finish-home {
  width: 100%;
  padding: 0.9rem;
  font-size: 1rem;
  border-radius: 99px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.msg.center {
  text-align: center;
}

@media (max-width: 600px) {
  .landing-nav {
    padding: 0.8rem 1rem;
  }

  .credits-badge-top {
    padding: 0.3rem 0.7rem;
    gap: 0.35rem;
  }

  .credits-label {
    display: none;
  }

  .user-dropdown {
    width: 200px;
  }
}

html,
body {
  overflow-y: auto !important;
  height: auto !important;
  min-height: 100vh !important;
}

#app {
  overflow-y: visible !important;
  height: auto !important;
}