:root {
  color-scheme: dark;
  --bg: #07090e;
  --bg-panel: rgba(16, 22, 37, 0.65);
  --bg-panel-solid: #101625;
  --bg-card: rgba(25, 34, 56, 0.45);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glass-hover: rgba(255, 255, 255, 0.16);
  --text: #f3f4f6;
  --text-muted: #9aa5b9;
  --accent: #ff6b4a;
  --accent-gold: #ffae33;
  --accent-gradient: linear-gradient(135deg, #ff6b4a 0%, #ffae33 100%);
  --accent-2: #00f5a0;
  --accent-2-gold: #00d2ff;
  --accent-2-gradient: linear-gradient(135deg, #00f5a0 0%, #00d2ff 100%);
  --red: #ff5858;
  --red-gradient: linear-gradient(135deg, #ff5858 0%, #ff2e93 100%);
  --shadow-glow: 0 12px 40px rgba(255, 107, 74, 0.2);
  --shadow-card: 0 16px 36px rgba(0, 0, 0, 0.4);
  --font-title: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

body {
  min-height: 100vh;
  font-family: var(--font-body);
  background-color: var(--bg);
  background-image: 
    radial-gradient(circle at 10% 15%, rgba(255, 107, 74, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 20%, rgba(0, 245, 160, 0.08) 0%, transparent 35%),
    radial-gradient(circle at 50% 85%, rgba(139, 92, 246, 0.09) 0%, transparent 45%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
  padding-bottom: 90px; /* Space for floating bottom nav */
}

a {
  color: var(--accent-gold);
  text-decoration: none;
}
a:hover {
  color: var(--accent);
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 15px rgba(255, 107, 74, 0.2); }
  50% { box-shadow: 0 0 25px rgba(255, 107, 74, 0.45); }
}

@keyframes celebrateWinner {
  0% { transform: scale(0.9) rotate(0deg); opacity: 0; }
  50% { transform: scale(1.08) rotate(2deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes floatElement {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(1deg); }
}

@keyframes spinInfinite {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.animated-fade-in {
  animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Shell Layout */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px clamp(16px, 4vw, 36px);
  background: rgba(7, 9, 14, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-glass);
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  color: var(--text);
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 21px;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--accent-gradient);
  color: #0d0905;
  box-shadow: var(--shadow-glow);
}

.brand-text {
  background: linear-gradient(135deg, #ffffff 40%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logout-button {
  background: rgba(255, 88, 88, 0.08);
  border: 1px solid rgba(255, 88, 88, 0.25);
  border-radius: 12px;
  color: #ff8b8b;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.logout-button:hover {
  background: var(--red-gradient);
  border-color: transparent;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 88, 88, 0.3);
}

.main {
  flex: 1;
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: 24px clamp(16px, 4vw, 36px);
  animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Bottom Navigation - Glass Island */
.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 100;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  width: min(640px, calc(100% - 32px));
  padding: 8px;
  border: 1px solid var(--border-glass);
  border-radius: 24px;
  background: rgba(13, 18, 30, 0.72);
  box-shadow: var(--shadow-card), 0 0 30px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
}

.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 46px;
  border-radius: 16px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.bottom-nav a svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.2px;
  transition: transform 0.3s ease, stroke 0.3s ease;
}

.bottom-nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.bottom-nav a:hover svg {
  transform: translateY(-2px);
}

.bottom-nav a.active {
  background: linear-gradient(135deg, rgba(255, 107, 74, 0.15) 0%, rgba(255, 174, 51, 0.1) 100%);
  border: 1px solid rgba(255, 107, 74, 0.25);
  color: var(--accent-gold);
}

.bottom-nav a.active svg {
  transform: scale(1.15) translateY(-1px);
  stroke: var(--accent-gold);
  filter: drop-shadow(0 0 5px rgba(255, 174, 51, 0.4));
}

/* Premium Typography & Titles */
.eyebrow {
  margin-bottom: 6px;
  color: var(--accent-gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1, h2, h3, h4 {
  font-family: var(--font-title);
  color: #fff;
  font-weight: 800;
}

.page-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.page-header h1 {
  font-size: clamp(28px, 5vw, 44px);
  letter-spacing: -0.02em;
  line-height: 1.1;
  background: linear-gradient(180deg, #ffffff 30%, #b8c4d9 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Cards and Panels (Glassmorphism) */
.panel, .app-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-glass);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.panel:hover, .app-card:hover {
  border-color: var(--border-glass-hover);
}

.narrow {
  max-width: 460px;
  margin: 32px auto;
}

.grid {
  display: grid;
  gap: 18px;
  margin: 24px 0;
}
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stack {
  display: grid;
  gap: 14px;
}

.empty {
  text-align: center;
  padding: 48px 24px;
  background: rgba(25, 34, 56, 0.2);
}
.empty h2 {
  font-size: 20px;
  margin-bottom: 8px;
}
.empty p {
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* Beautiful Interactive Buttons */
.button, button {
  appearance: none;
  border: 0;
  border-radius: 16px;
  padding: 14px 22px;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 14px;
  text-align: center;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  outline: none;
}

.button-primary {
  background: var(--accent-gradient);
  color: #0b0704;
  box-shadow: var(--shadow-glow);
}
.button-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(255, 107, 74, 0.35);
  filter: brightness(1.08);
}
.button-primary:active {
  transform: translateY(0);
}

.button-ghost, .icon-button {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.button-ghost:hover, .icon-button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
}
.button-ghost:active {
  transform: translateY(0);
}

.full {
  width: 100%;
}

/* Glowing Form Fields */
.form {
  display: grid;
  gap: 20px;
}
label {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
}
.checkbox-label {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 12px !important;
  cursor: pointer;
}
.checkbox-label input[type="checkbox"] {
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  min-height: 24px !important;
  accent-color: var(--accent) !important;
  cursor: pointer;
  margin: 0 !important;
}
input, select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(8, 12, 22, 0.85);
  color: #fff;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  outline: none;
}
input:focus, select:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(255, 174, 51, 0.15), 0 0 20px rgba(255, 174, 51, 0.08);
  background: rgba(8, 12, 22, 0.95);
}

.filters {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 12px;
}

/* Alert styles */
.alert {
  margin: 16px 0;
  padding: 14px 18px;
  border-radius: 16px;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.alert-error {
  background: rgba(255, 88, 88, 0.1);
  color: #ffa1a1;
  border: 1px solid rgba(255, 88, 88, 0.2);
}
.alert-success {
  background: rgba(0, 245, 160, 0.1);
  color: #a3ffd9;
  border: 1px solid rgba(0, 245, 160, 0.2);
}

/* Hero Landing Section */
.hero {
  min-height: 60vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
}
.hero-copy {
  max-width: 620px;
}
.hero h1 {
  margin-bottom: 16px;
  font-size: clamp(44px, 8vw, 76px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-family: var(--font-title);
  background: linear-gradient(135deg, #ffffff 40%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero .lead {
  color: var(--text-muted);
  font-size: clamp(17px, 2.5vw, 21px);
  line-height: 1.45;
  margin-bottom: 32px;
}

/* Hero Simulated Phone Mockup */
.hero-device {
  justify-self: center;
  width: min(340px, 100%);
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 40px;
  background: linear-gradient(180deg, #161e31 0%, #0a0e17 100%);
  box-shadow: var(--shadow-card), 0 30px 60px rgba(0, 0, 0, 0.6);
  position: relative;
  animation: floatElement 6s ease-in-out infinite;
}
.device-top {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 4px 6px 16px;
}
.device-top span {
  width: 24px;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.15);
}
.device-card {
  margin-top: 12px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
}
.device-card.primary {
  background: linear-gradient(135deg, rgba(255, 107, 74, 0.16) 0%, rgba(0, 245, 160, 0.06) 100%);
  border-color: rgba(255, 107, 74, 0.18);
}
.device-card small {
  color: var(--accent-gold);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.08em;
}
.device-card strong {
  display: block;
  margin: 6px 0 14px;
  font-size: 26px;
  font-family: var(--font-title);
}
.score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.score-row b {
  font-size: 17px;
  color: var(--accent-2);
}

/* Feature Grid */
.feature-card {
  text-align: left;
  border-radius: 24px;
}
.feature-card h2 {
  font-size: 22px;
  margin-bottom: 10px;
  font-family: var(--font-title);
}
.feature-card p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}

/* Player Configuration setup */
.player-list {
  display: grid;
  gap: 12px;
}
.player-list strong {
  font-size: 14px;
  color: var(--text-muted);
}
.player-field {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 12px;
  align-items: center;
}
.player-field span {
  display: grid;
  place-items: center;
  height: 46px;
  border-radius: 16px;
  background: rgba(0, 245, 160, 0.12);
  color: var(--accent-2);
  font-weight: 900;
  font-family: var(--font-title);
  border: 1px solid rgba(0, 245, 160, 0.2);
}

/* Section Title & Surface Icon */
.section-title {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 12px;
}
.section-title h2 {
  font-size: 22px;
}
.surface-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: rgba(255, 107, 74, 0.12);
  color: var(--accent);
  font-size: 24px;
  font-weight: 900;
  border: 1px solid rgba(255, 107, 74, 0.2);
}

/* BoardGameGeek Collection views */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin: 16px 0;
}
.game-card {
  overflow: hidden;
  background: rgba(25, 34, 56, 0.35);
  border: 1px solid var(--border-glass);
  border-radius: 24px;
  display: flex;
  flex-direction: column;
}
.game-card:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 174, 51, 0.25);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}
.game-card > div:last-child {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.game-card h3 {
  margin-bottom: 6px;
  font-size: 16px;
  line-height: 1.25;
  font-family: var(--font-body);
  font-weight: 700;
}
.game-card p {
  color: var(--text-muted);
  font-size: 13px;
  margin: 2px 0;
}
.game-thumb {
  aspect-ratio: 16 / 11;
  display: grid;
  place-items: center;
  background: #111827;
  color: var(--text-muted);
  font-weight: 900;
  overflow: hidden;
  position: relative;
}
.game-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 16px;
  align-items: center;
  margin: 32px 0 12px;
}
.pagination button {
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 13px;
}

.collection-meta {
  color: var(--text-muted);
  font-weight: 700;
  margin: 8px 0;
}

.bgg-credit {
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
  margin-top: 36px;
}

/* History Cards */
.history-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.history-card h2 {
  font-size: 20px;
  margin-bottom: 4px;
}
.history-card strong {
  color: var(--accent-2);
}
.history-card .score-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.history-card .score-list span {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  padding: 6px 12px;
}

/* Stat Widgets */
.stat {
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.stat strong {
  font-size: 48px;
  font-family: var(--font-title);
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
  margin-bottom: 6px;
}
.stat span {
  color: var(--text-muted);
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* SCORING WIZARD STYLING */
.scoring-shell {
  display: grid;
  gap: 20px;
}
.app-flow {
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}
.scoring-wizard {
  display: grid;
  gap: 16px;
}
.wizard-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.wizard-top button {
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 13px;
}
.wizard-top div {
  text-align: right;
}
.wizard-top strong {
  display: block;
  font-size: 18px;
  color: #fff;
}
.wizard-top span {
  color: var(--text-muted);
  font-size: 12px;
}

.progress {
  height: 8px;
  border-radius: 99px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.03);
}
.progress span {
  display: block;
  height: 100%;
  border-radius: 99px;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.4s ease;
}

.step-panel {
  animation: fadeInUp 0.4s ease forwards;
}
.step-panel p {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 20px;
}

/* Touch-ready dynamic inputs */
.score-inputs {
  display: grid;
  gap: 14px;
}
.score-inputs label {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 18px;
  padding: 12px 16px;
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.score-inputs label input[type="number"] {
  width: 100px;
  text-align: center;
  padding: 8px 10px;
  font-weight: 700;
}
.score-inputs label input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--accent);
  cursor: pointer;
}
.score-inputs label select {
  width: auto;
  padding: 8px 12px;
  font-size: 14px;
}

/* Counter Style (buttons inside input) */
.counter-control {
  display: inline-flex;
  align-items: center;
  background: rgba(8, 12, 22, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  overflow: hidden;
}
.counter-btn {
  background: transparent;
  border: 0;
  color: var(--accent-gold);
  width: 38px;
  height: 38px;
  font-size: 20px;
  font-weight: 700;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.counter-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}
.counter-val {
  width: 50px;
  text-align: center;
  font-weight: 800;
  color: #fff;
  border: 0;
  background: transparent;
  font-size: 16px;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.choice {
  min-height: 60px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #fff;
  font-weight: 700;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.choice:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}
.choice.selected {
  background: var(--accent-gradient);
  color: #0b0704;
  border-color: transparent;
  box-shadow: var(--shadow-glow);
  font-weight: 800;
}

/* Scoreboard Live standings inside Wizard */
.scoreboard {
  background: rgba(16, 22, 37, 0.5);
  display: grid;
  gap: 8px;
  padding: 16px;
}
.scoreboard-title {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}
.scoreboard-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.04);
  position: relative;
  overflow: hidden;
}
.scoreboard-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: rgba(0, 245, 160, 0.06);
  transition: width 0.4s ease;
  z-index: 1;
}
.scoreboard-row span, .scoreboard-row strong {
  position: relative;
  z-index: 2;
}
.scoreboard-row strong {
  color: var(--accent-2);
  font-size: 16px;
}

/* Results & Pure CSS Victory Celebrations */
.results {
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
  position: relative;
  animation: celebrateWinner 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  overflow: hidden;
}
.results .eyebrow {
  font-size: 14px;
}
.results h2 {
  font-size: 36px;
  margin-bottom: 12px;
}
.winner {
  font-size: 26px;
  margin: 20px 0;
  background: rgba(0, 245, 160, 0.12);
  border: 1.5px solid rgba(0, 245, 160, 0.35);
  border-radius: 20px;
  padding: 16px 24px;
  color: #fff;
  display: inline-block;
  box-shadow: 0 0 30px rgba(0, 245, 160, 0.12);
}
.winner strong {
  color: var(--accent-2);
  font-family: var(--font-title);
  font-size: 32px;
  text-shadow: 0 0 10px rgba(0, 245, 160, 0.4);
}

.score-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 16px 0 28px;
}
.score-list span {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  padding: 10px 18px;
  font-weight: 800;
  font-size: 14px;
}

/* Confetti Native CSS Blast */
.confetti-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
.confetti-item {
  position: absolute;
  width: 8px;
  height: 8px;
  background-color: var(--accent);
  opacity: 0.8;
  border-radius: 2px;
}
/* Generate 10 floating pure CSS sparkle pieces */
.confetti-item:nth-child(1) { left: 10%; top: 90%; animation: floatElement 4s infinite ease-in-out; background: var(--accent); }
.confetti-item:nth-child(2) { left: 30%; top: 85%; animation: floatElement 5s infinite ease-in-out; background: var(--accent-gold); }
.confetti-item:nth-child(3) { left: 50%; top: 92%; animation: floatElement 3.5s infinite ease-in-out; background: var(--accent-2); }
.confetti-item:nth-child(4) { left: 70%; top: 88%; animation: floatElement 4.5s infinite ease-in-out; background: var(--accent-gold); }
.confetti-item:nth-child(5) { left: 90%; top: 95%; animation: floatElement 6s infinite ease-in-out; background: var(--accent); }
.confetti-item:nth-child(6) { left: 20%; top: 20%; animation: floatElement 4s infinite ease-in-out; background: var(--accent-2); }
.confetti-item:nth-child(7) { left: 40%; top: 15%; animation: floatElement 5s infinite ease-in-out; background: var(--accent); }
.confetti-item:nth-child(8) { left: 60%; top: 25%; animation: floatElement 3s infinite ease-in-out; background: var(--accent-gold); }
.confetti-item:nth-child(9) { left: 80%; top: 10%; animation: floatElement 5.5s infinite ease-in-out; background: var(--accent-2); }

/* ==========================================================================
   STARTING PLAYER SELECTOR (SORTEO) & 3D CSS DICE / NEON WHEEL
   ========================================================================== */
.sorteo-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.sorteo-setup {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.sorteo-playground {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  position: relative;
  overflow: hidden;
}
.mode-selector {
  display: flex;
  width: 100%;
  background: rgba(8, 12, 22, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 16px;
}
.mode-btn {
  flex: 1;
  background: transparent;
  color: var(--text-muted);
  border: 0;
  padding: 10px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 12px;
  margin: 4px;
  font-size: 13px;
}
.mode-btn.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent-gold);
}

/* Interactive Player Pills */
.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}
.pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 14px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.pill-delete {
  background: none;
  border: 0;
  color: #ff8b8b;
  cursor: pointer;
  font-weight: 900;
}

/* 1. 3D CSS DICE STYLING */
.dice-scene {
  width: 120px;
  height: 120px;
  perspective: 600px;
  margin: 40px auto;
  position: relative;
}
.dice-cube {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(-20deg) rotateY(30deg);
  transition: transform 0.1s linear;
}
.dice-face {
  position: absolute;
  width: 120px;
  height: 120px;
  background: linear-gradient(135deg, #1d263a 0%, #101625 100%);
  border: 3px solid #ffae33;
  border-radius: 20px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 24px;
  font-family: var(--font-title);
  font-weight: 900;
  box-shadow: inset 0 0 20px rgba(255, 174, 51, 0.2), 0 0 20px rgba(0,0,0,0.5);
  backface-visibility: visible;
}
.dice-face::before {
  content: '';
  position: absolute;
  top: 5px; left: 5px; right: 5px; bottom: 5px;
  border: 1px dashed rgba(255, 174, 51, 0.3);
  border-radius: 14px;
}
.dice-face.front  { transform: rotateY(0deg) translateZ(60px); }
.dice-face.back   { transform: rotateY(180deg) translateZ(60px); }
.dice-face.right  { transform: rotateY(90deg) translateZ(60px); }
.dice-face.left   { transform: rotateY(-90deg) translateZ(60px); }
.dice-face.top    { transform: rotateX(90deg) translateZ(60px); }
.dice-face.bottom { transform: rotateX(-90deg) translateZ(60px); }

/* Rotations during rolling */
.dice-cube.rolling {
  animation: rollAnimation 1.6s cubic-bezier(0.25, 0.8, 0.25, 1.25) forwards;
}

@keyframes rollAnimation {
  0% { transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg); }
  20% { transform: rotateX(180deg) rotateY(90deg) rotateZ(45deg); }
  40% { transform: rotateX(360deg) rotateY(270deg) rotateZ(180deg); }
  60% { transform: rotateX(540deg) rotateY(450deg) rotateZ(360deg); }
  80% { transform: rotateX(720deg) rotateY(630deg) rotateZ(540deg); }
  100% { transform: var(--target-rotation, rotateX(720deg) rotateY(720deg) rotateZ(720deg)); }
}

/* 2. NEON WHEEL / RULETA STYLING */
.wheel-container {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 20px auto;
}
.wheel-circle {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 6px solid #161e31;
  box-shadow: 0 0 30px rgba(0, 245, 160, 0.15), inset 0 0 20px rgba(0,0,0,0.4);
  position: relative;
  overflow: hidden;
  background: conic-gradient(from 0deg, #101625, #1d263a, #101625);
  transition: transform 4s cubic-bezier(0.1, 0.8, 0.1, 1);
}
.wheel-pointer {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 24px solid var(--accent);
  z-index: 20;
  filter: drop-shadow(0 4px 10px rgba(255, 107, 74, 0.5));
}
.wheel-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  background: var(--accent-gradient);
  border: 4px solid #0d0905;
  border-radius: 50%;
  z-index: 10;
  box-shadow: 0 0 15px rgba(255, 174, 51, 0.5);
}
.wheel-slice {
  position: absolute;
  width: 50%;
  height: 50%;
  left: 50%;
  top: 50%;
  transform-origin: 0 0;
  display: flex;
  align-items: center;
  padding-left: 28px;
  font-weight: 800;
  font-size: 13px;
  color: #fff;
  z-index: 2;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

.sorteo-result-card {
  text-align: center;
  background: rgba(0, 245, 160, 0.08);
  border: 1px solid rgba(0, 245, 160, 0.25);
  border-radius: 20px;
  padding: 16px;
  margin-top: 20px;
  width: 100%;
  animation: fadeInUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.sorteo-result-card strong {
  color: var(--accent-2);
  font-size: 20px;
}

/* Responsive Media Queries */
@media (max-width: 820px) {
  body {
    padding-bottom: 120px;
  }
  .hero {
    grid-template-columns: 1fr;
    gap: 30px;
    text-align: center;
  }
  .hero-device {
    width: min(290px, 100%);
    min-height: auto;
  }
  .sorteo-panel {
    grid-template-columns: 1fr;
  }
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .page-header form {
    width: 100%;
  }
  .page-header button {
    width: 100%;
  }
  .grid.two, .grid.three, .filters {
    grid-template-columns: 1fr;
  }
  .bottom-nav {
    bottom: 16px;
    border-radius: 20px;
    padding: 4px 8px;
    width: min(450px, calc(100% - 24px));
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  }
  .bottom-nav a {
    min-height: 44px;
    gap: 0;
  }
  .bottom-nav a span {
    display: none;
  }
  .bottom-nav a svg {
    width: 20px;
    height: 20px;
  }
  .choice-grid {
    grid-template-columns: 1fr;
  }
  .history-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

/* SCORING GAME CAROUSEL & SEARCH REDESIGN */

/* Search bar wrapper with modern icon and glowing border on focus */
.search-wrapper {
  position: relative;
  margin-bottom: 24px;
  width: 100%;
}
.search-wrapper svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  transition: color 0.3s ease;
}
.search-wrapper input {
  width: 100%;
  padding: 14px 16px 14px 48px;
  background: rgba(16, 22, 37, 0.6);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.search-wrapper input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 16px rgba(255, 174, 51, 0.2);
  background: rgba(16, 22, 37, 0.9);
  outline: none;
}
.search-wrapper input:focus + svg {
  color: var(--accent-gold);
}

/* Premium horizontal scrollable game carousel */
.game-carousel-container {
  position: relative;
  width: 100%;
  margin-bottom: 24px;
  border-radius: 20px;
  overflow: hidden;
}
.game-carousel {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding: 12px 6px;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 174, 51, 0.3) rgba(255, 255, 255, 0.02);
}
.game-carousel::-webkit-scrollbar {
  height: 6px;
}
.game-carousel::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
}
.game-carousel::-webkit-scrollbar-thumb {
  background: rgba(255, 174, 51, 0.25);
  border-radius: 10px;
}
.game-carousel::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 174, 51, 0.45);
}

/* Game cover card styling */
.game-card {
  flex: 0 0 calc(50% - 9px); /* Default to 2 cards visible on smaller screens */
  min-width: 180px;
  max-width: 230px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  scroll-snap-align: start;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

@media screen and (min-width: 600px) {
  .game-card {
    flex: 0 0 calc(33.333% - 12px); /* 3 cards visible on medium screens */
  }
}

@media screen and (min-width: 900px) {
  .game-card {
    flex: 0 0 200px; /* fixed size on large screens */
  }
}

.game-card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.game-card.selected {
  border-color: var(--accent-gold);
  box-shadow: 0 0 20px rgba(255, 174, 51, 0.3);
  background: rgba(255, 174, 51, 0.05);
}

.game-card-img-wrapper {
  position: relative;
  width: 100%;
  height: 140px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
}

.game-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.game-card:hover .game-card-img {
  transform: scale(1.08);
}

/* Mini badge over the image */
.game-card-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(12, 16, 26, 0.85);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-gold);
}

.game-card-info {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  justify-content: space-between;
  gap: 8px;
}

.game-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin: 0;
  line-height: 1.3;
}

.game-card-players {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Selected game header card inside player configuration */
.selected-game-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 174, 51, 0.04);
  border: 1px dashed rgba(255, 174, 51, 0.2);
  border-radius: 18px;
  padding: 12px 16px;
  margin-bottom: 24px;
}
.selected-game-summary img {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.selected-game-summary-info h3 {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 2px 0;
}
.selected-game-summary-info p {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}

/* Play Group custom suggestions pills */
.play-group-pill {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  outline: none;
}
.play-group-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}
.play-group-pill.active {
  background: var(--accent-gradient);
  color: #0b0704;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(255, 174, 51, 0.35);
  font-weight: 700;
}

/* Custom list layout adjustments */
.player-field-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  transition: all 0.2s ease;
}
.player-field-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}
.player-field-card .player-badge {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
}
.player-field-card input {
  flex: 1;
  background: transparent;
  border: 0;
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  padding: 8px 0;
}
.player-field-card input:focus {
  outline: none;
}
.player-field-card .remove-btn {
  background: transparent;
  border: 0;
  color: var(--red);
  font-size: 20px;
  font-weight: 700;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.2s ease;
}
.player-field-card .remove-btn:hover {
  background: rgba(255, 88, 88, 0.1);
}

/* ================================================
   SETUP GRID — Responsive 2-column layout
================================================ */
.setup-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
@media screen and (min-width: 768px) {
  .setup-grid {
    grid-template-columns: 280px 1fr;
  }
}

