/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #0a1628 0%, #1a2744 100%);
  color: #eee;
  min-height: 100vh;
}

#app {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 0 16px;
}

/* ===== App Header ===== */
.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(10, 22, 40, 0.97);
  border-bottom: 2px solid #FFD700;
  border-radius: 10px 10px 0 0;
  margin-bottom: 0;
}

.game-header-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.pir-logo-header {
  display: flex;
  align-items: baseline;
  gap: 5px;
  flex-wrap: nowrap;
}

.pir-logo-header .banner-the,
.pir-logo-header .banner-is {
  font-size: 1rem;
}

.pir-logo-header .banner-price,
.pir-logo-header .banner-right {
  font-size: 1.7rem;
  letter-spacing: 2px;
}

.game-header-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.room-name-display {
  color: #bbb;
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.btn-how-to-play {
  background: transparent;
  border: 1px solid #FFD700;
  color: #FFD700;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.btn-how-to-play:hover {
  background: #FFD700;
  color: #1a1a2e;
}

.btn-new-game {
  background: transparent;
  border: 1px solid #ff6b6b;
  color: #ff6b6b;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.btn-new-game:hover {
  background: #ff6b6b;
  color: #fff;
}

@keyframes gear-spin-cw {
  from { transform: rotate(0deg); }
  to   { transform: rotate(180deg); }
}

@keyframes gear-spin-ccw {
  from { transform: rotate(180deg); }
  to   { transform: rotate(0deg); }
}

.btn-settings-gear {
  background: transparent;
  border: none;
  color: #FFD700;
  font-size: 1.1rem;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  animation: gear-spin-ccw 0.4s ease-out forwards;
}

.btn-settings-gear:hover {
  background: transparent;
  animation: gear-spin-cw 0.4s ease-out forwards;
}

/* ===== Settings Modal ===== */
.settings-modal-box {
  max-width: 480px;
}

.settings-body {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 20px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 215, 0, 0.1);
  gap: 16px;
}

.settings-row:last-child {
  border-bottom: none;
}

.settings-label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.settings-label-text {
  font-size: 0.95rem;
  font-weight: 700;
  color: #eee;
}

.settings-label-desc {
  font-size: 0.78rem;
  color: #888;
  line-height: 1.3;
}

.settings-select {
  background: #0d0d1a;
  color: #eee;
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.9rem;
  cursor: pointer;
  flex-shrink: 0;
}

.settings-select:focus {
  outline: none;
  border-color: #FFD700;
}

.settings-footer {
  text-align: right;
}

/* Host-only settings row */
.settings-host-badge {
  font-size: 0.6rem;
  background: rgba(255, 215, 0, 0.15);
  color: #FFD700;
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 3px;
  padding: 1px 4px;
  margin-left: 6px;
  vertical-align: middle;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.settings-host-status {
  font-size: 0.72rem;
  color: #c0c0c0;
  margin-top: 2px;
  font-style: italic;
}

.settings-row--locked {
  opacity: 0.55;
  pointer-events: none;
}

.settings-row--locked .settings-select,
.settings-row--locked .toggle-switch {
  cursor: not-allowed;
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: #333;
  border-radius: 24px;
  transition: background 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #888;
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
  background: rgba(255, 215, 0, 0.25);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
  background: #FFD700;
}

/* ===== QR Invite Button ===== */
.btn-qr-invite {
  background: transparent;
  border: none;
  color: #FFD700;
  font-size: 1.1rem;
  padding: 4px 5px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  transition: opacity 0.15s;
  flex-shrink: 0;
}

.btn-qr-invite:hover {
  opacity: 0.7;
}

/* ===== QR Invite Modal ===== */
.qr-modal-box {
  max-width: 320px;
  text-align: center;
}

.qr-image-wrapper {
  display: flex;
  justify-content: center;
  margin: 16px 0;
}

.qr-image-wrapper img {
  width: 200px;
  height: 200px;
  border-radius: 4px;
}

.qr-url-text {
  color: #888;
  font-size: 0.7rem;
  word-break: break-all;
  margin-top: 4px;
}

.qr-modal-box p {
  color: #ccc;
  font-size: 0.9rem;
  margin-bottom: 0;
}

/* ===== How to Play Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease-out;
}

.modal-box {
  background: #16213e;
  border: 1px solid rgba(255, 215, 0, 0.35);
  border-radius: 14px;
  max-width: 580px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 32px 28px 28px;
  position: relative;
  box-shadow: 0 8px 40px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,215,0,0.1);
  animation: slideUp 0.22s ease-out;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: #aaa;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.modal-close:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}

.modal-box h2 {
  margin: 0 0 18px;
  color: #FFD700;
  font-size: 1.6rem;
  text-align: center;
}

.modal-body h3 {
  margin: 18px 0 8px;
  color: #FFD700;
  font-size: 1rem;
}

.modal-body h3:first-child { margin-top: 0; }

.modal-body p,
.modal-body li {
  color: #ddd;
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 4px 0;
}

.modal-body ul {
  padding-left: 20px;
  margin: 4px 0;
}

.modal-body li { margin-bottom: 5px; }



.banner-the, .banner-is {
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.banner-price {
  font-size: 3rem;
  font-weight: 900;
  color: #FFD700;
  text-shadow: 3px 3px 6px rgba(0,0,0,0.5), 0 0 20px rgba(255,215,0,0.3);
  letter-spacing: 4px;
}

.banner-right {
  font-size: 3rem;
  font-weight: 900;
  color: #E31837;
  text-shadow: 3px 3px 6px rgba(0,0,0,0.5), 0 0 20px rgba(227,24,55,0.3);
  letter-spacing: 4px;
}

/* ===== Screens ===== */
.screen { animation: fadeIn 0.3s ease-in; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== Center Card (join / no-game) ===== */
.center-card {
  text-align: center;
  margin-top: 3vh;
}

.center-card p {
  margin-bottom: 20px;
  color: #aaa;
}

.center-card code {
  background: #333;
  padding: 2px 8px;
  border-radius: 4px;
}

.inline-form {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.inline-form input {
  padding: 10px 14px;
  border-radius: 8px;
  border: 2px solid #444;
  background: #222;
  color: #eee;
  font-size: 1rem;
  width: 240px;
}

.inline-form input:focus {
  outline: none;
  border-color: #FFD700;
}

/* ===== Game Name Row ===== */
.game-name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 12px;
}

.game-name-row p { margin-bottom: 0; }
.game-name-row h2 { margin: 0; }

/* ===== Join Screen Player Preview ===== */
.join-players-preview {
  margin: 12px auto 16px;
  text-align: center;
}

.join-players-preview ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.join-players-preview li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,215,0,0.15);
  width: 100%;
}

.join-players-preview li:last-child { border-bottom: none; }

.no-players-yet {
  color: #666;
  font-style: italic;
  justify-content: center;
  border-bottom: none !important;
}

.btn-secondary {
  background: #333;
  color: #eee;
  border: 1px solid #555;
}

.btn-secondary:hover { background: #444; }

.btn-small {
  padding: 6px 14px;
  font-size: 0.85rem;
}

/* ===== Rounds Dropdown ===== */
.rounds-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.rounds-row label {
  color: #aaa;
  font-size: 0.95rem;
}

.rounds-select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 2px solid #444;
  background: #222;
  color: #eee;
  font-size: 0.95rem;
  cursor: pointer;
}

.rounds-select:focus {
  outline: none;
  border-color: #FFD700;
}

/* ===== Buttons ===== */
.btn {
  padding: 10px 24px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, background 0.2s;
}

.btn:hover { transform: scale(1.03); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary {
  background: #E31837;
  color: #fff;
}

.btn-primary:hover { background: #c41430; }

.btn-restart { background: #e67e22; color: #fff; }
.btn-restart:hover { background: #cf6d17; }

.btn-large {
  padding: 14px 40px;
  font-size: 1.2rem;
}

/* ===== Lobby ===== */
.lobby-container {
  text-align: center;
  margin-top: 4vh;
}

/* Product-fetch status bar shown while Lambda fetches products */
.product-fetch-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 10px auto 0;
  color: #ccc;
  font-size: 0.95rem;
}

.product-fetch-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255, 215, 0, 0.25);
  border-top-color: #FFD700;
  border-radius: 50%;
  animation: pir-spin 0.75s linear infinite;
  flex-shrink: 0;
}

@keyframes pir-spin {
  to { transform: rotate(360deg); }
}

.lobby-container h2 { color: #FFD700; font-weight: 700; margin-bottom: 24px; }
.game-name-row h2 { margin: 0; }

.player-list-container {
  background: rgba(22, 33, 62, 0.8);
  border: 2px solid #FFD700;
  border-radius: 12px;
  padding: 20px;
  max-width: 400px;
  margin: 0 auto 24px;
}

.player-list-container h3 {
  margin-bottom: 12px;
  color: #FFD700;
}

#lobby-player-list {
  list-style: none;
}

#lobby-player-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,215,0,0.15);
}

#lobby-player-list li:last-child { border-bottom: none; }

.player-name { font-weight: 600; }

.player-host-badge {
  background: #E31837;
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 12px;
  margin-left: 8px;
}

.player-disconnected { opacity: 0.4; }

.btn-remove {
  background: transparent;
  border: 1px solid #e74c3c;
  color: #e74c3c;
  padding: 2px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
}

.btn-remove:hover { background: #e74c3c; color: #fff; }

.muted { color: #777; font-style: italic; margin-top: 12px; }

/* ===== Scoreboard ===== */
.scoreboard {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  padding: 12px;
  background: rgba(22, 33, 62, 0.8);
  border: 1px solid rgba(255,215,0,0.2);
  border-radius: 12px;
  margin-bottom: 20px;
}

.score-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 16px;
  border-radius: 8px;
  background: rgba(26, 26, 46, 0.6);
  min-width: 80px;
  transition: all 0.3s;
}

.score-item.leader {
  background: #FFD700;
  color: #1a1a2e;
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

.score-item.other {
  background: rgba(52, 152, 219, 0.5);
  border: 1px solid rgba(52, 152, 219, 0.6);
}

.score-item.disconnected { opacity: 0.4; }

/* ===== Join Error ===== */
.join-error {
  color: #ff6b6b;
  font-size: 0.9rem;
  margin-top: 10px;
  text-align: center;
}

.score-item.active-turn {
  border: 2px solid rgba(255, 215, 0, 0.9);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
  animation: pulse-glow 1.5s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 8px rgba(255, 215, 0, 0.3); }
  50%       { box-shadow: 0 0 20px rgba(255, 215, 0, 0.9); }
}

.score-name { font-size: 0.85rem; font-weight: 600; }
.score-value { font-size: 1.3rem; font-weight: 700; color: #FFD700; }
.score-item.leader .score-value { color: #1a1a2e; }
.score-item.leader .score-name { color: #1a1a2e; }

/* ===== Round Indicator ===== */
.round-indicator {
  text-align: center;
  font-size: 0.85rem;
  color: #aaa;
  margin-top: 12px;
  margin-bottom: 6px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ===== Timer ===== */
.timer {
  font-size: 3rem;
  font-weight: 700;
  text-align: center;
  margin: 12px 0;
  color: #FFD700;
}

.timer.urgent { color: #E31837; animation: pulse 0.5s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Background urgency pulse — applied to body when ≤10 s remain */
body.timer-urgent-bg {
  animation: bg-urgent-pulse 1s ease-in-out infinite;
}

@keyframes bg-urgent-pulse {
  0%, 100% { background: linear-gradient(135deg, #0a1628 0%, #1a2744 100%); }
  50%       { background: linear-gradient(135deg, #2a0a0a 0%, #3a1020 100%); }
}

/* ===== Product Pop-In Animation ===== */
@keyframes product-pop-in {
  0%   { opacity: 0; transform: scale(0.55); }
  65%  { opacity: 1; transform: scale(1.07); }
  100% { opacity: 1; transform: scale(1); }
}

.product-card-enter {
  animation: product-pop-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.showcase-card-enter {
  animation: product-pop-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ===== Product Card ===== */
.product-card {
  background: rgba(22, 33, 62, 0.9);
  border: 2px solid #FFD700;
  border-radius: 16px;
  padding: 24px;
  margin: 16px auto;
  max-width: 500px;
  text-align: center;
}

.product-image-container {
  width: 380px;
  height: 380px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
}

.product-image-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.product-emoji {
  font-size: 5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: #f0f0f0;
}

.product-info h3 {
  color: #FFD700;
  font-size: 1.3rem;
  margin-bottom: 8px;
}

.product-info p {
  color: #ccc;
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.product-hint {
  display: inline-block;
  background: rgba(255,215,0,0.15);
  color: #FFD700;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
}

.product-details {
  color: #aaa;
  font-size: 0.82rem;
  margin-bottom: 6px;
  font-style: italic;
}

.amazon-verify-link {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 16px 10px;
  background: rgba(255, 153, 0, 0.15);
  color: #FF9900;
  border: 1px solid #FF9900;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
}

.amazon-verify-link:hover {
  background: rgba(255, 153, 0, 0.3);
}

.product-details-small {
  color: #888;
  font-size: 0.7rem;
  font-style: italic;
  margin-bottom: 4px;
}

/* ===== Bid Form ===== */
.bid-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
}

.bid-input-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.dollar-sign {
  font-size: 2rem;
  font-weight: 700;
  color: #FFD700;
}

.bid-input-group input {
  width: 200px;
  padding: 12px 16px;
  font-size: 1.8rem;
  font-weight: 700;
  border-radius: 8px;
  border: 2px solid #FFD700;
  background: #16213e;
  color: #fff;
  text-align: right;
}

.bid-input-group input:focus {
  outline: none;
  border-color: #fff;
  box-shadow: 0 0 10px rgba(255,215,0,0.3);
}

/* Hide number input spinners */
.bid-input-group input::-webkit-outer-spin-button,
.bid-input-group input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.bid-input-group input[type=number] {
  -moz-appearance: textfield;
}

.bid-submitted {
  text-align: center;
  margin-top: 16px;
}

.bid-progress {
  margin-top: 8px;
  color: #aaa;
}

.bid-bar {
  width: 200px;
  height: 6px;
  background: #333;
  border-radius: 3px;
  margin: 8px auto;
  overflow: hidden;
}

.bid-bar-fill {
  height: 100%;
  background: #FFD700;
  border-radius: 3px;
  transition: width 0.3s;
  width: 0%;
}

/* ===== Reveal Phase ===== */
.actual-price {
  font-size: 3rem;
  font-weight: 900;
  color: #FFD700;
  text-align: center;
  margin: 16px 0;
  text-shadow: 0 0 20px rgba(255,215,0,0.4);
}

.reveal-product-img {
  display: block;
  width: 280px;
  height: 280px;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
  padding: 8px;
  margin: 0 auto 0.75rem;
}

.reveal-product-name {
  text-align: center;
  font-size: 1.1rem;
  color: #aaa;
  margin-bottom: 20px;
}

.bids-reveal {
  max-width: 500px;
  margin: 0 auto;
}

.bid-reveal-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(22, 33, 62, 0.8);
  border-radius: 8px;
  margin-bottom: 8px;
  border-left: 4px solid #444;
  transition: all 0.3s;
  opacity: 0;
  transform: translateX(-20px);
}

.bid-reveal-item.shown {
  opacity: 1;
  transform: translateX(0);
}

.bid-reveal-item.winner {
  border-left-color: #FFD700;
  background: rgba(255, 215, 0, 0.1);
}

.bid-reveal-item.over {
  border-left-color: #E31837;
  opacity: 0.6;
}

.bid-reveal-item .bid-player { font-weight: 600; }
.bid-reveal-item .bid-amount { font-weight: 700; font-size: 1.1rem; }
.bid-reveal-item .bid-amount.over { color: #E31837; text-decoration: line-through; }
.bid-reveal-item .bid-points { color: #FFD700; font-weight: 700; margin-left: 12px; }

.round-winner {
  text-align: center;
  margin-top: 20px;
  font-size: 1.3rem;
  font-weight: 700;
  color: #FFD700;
}

/* ===== Phase Countdown Timer ===== */
.phase-countdown {
  text-align: center;
  margin-top: 24px;
  font-size: 1rem;
  color: #999;
  font-weight: 400;
  letter-spacing: 0.5px;
}
.phase-countdown .countdown-seconds {
  font-weight: 700;
  color: #FFD700;
  font-size: 1.1rem;
}

/* ===== Showdown (Wheel Spin) ===== */
.showdown-subtitle {
  color: #aaa;
  margin-bottom: 16px;
}

.showdown-spinner-name {
  font-size: 1.3rem;
  font-weight: 700;
  color: #FFD700;
  margin-bottom: 12px;
}

/* ===== Wheel Pop-In Animation ===== */
@keyframes wheel-pop-in {
  0%   { opacity: 0; transform: scale(1.55); }
  70%  { opacity: 1; transform: scale(0.97); }
  100% { opacity: 1; transform: scale(1); }
}

.wheel-container-enter {
  animation: wheel-pop-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.wheel-container {
  position: relative;
  width: 448px;
  height: 448px;
  margin: 16px auto;
}

#wheel-canvas {
  width: 448px;
  height: 448px;
  border-radius: 50%;
  box-shadow: 0 0 30px rgba(255,215,0,0.3);
}



.showdown-spin-info {
  text-align: center;
  margin: 12px 0;
  font-size: 1.1rem;
}

.showdown-results-table {
  max-width: 500px;
  margin: 16px auto;
}

.showdown-result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(22, 33, 62, 0.8);
  border-radius: 8px;
  margin-bottom: 8px;
  border-left: 4px solid #444;
}

.showdown-result-row span:first-child { font-weight: 600; }
.showdown-result-row span:last-child { font-weight: 700; font-size: 1.1rem; }

.showdown-result-row.busted {
  border-left-color: #E31837;
  opacity: 0.6;
}
.showdown-result-row.showdown-winner {
  border-left-color: #FFD700;
  background: rgba(255, 215, 0, 0.1);
}

/* ===== Showcase ===== */
.showcase-subtitle {
  color: #aaa;
  margin-bottom: 8px;
}

.showcase-products {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin: 16px 0;
}

.showcase-product-card {
  width: 280px;
  background: rgba(22, 33, 62, 0.9);
  border: 2px solid #FFD700;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.showcase-product-card img {
  width: 200px;
  height: 200px;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
  margin-bottom: 8px;
}

.showcase-product-card h4 {
  color: #FFD700;
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.showcase-product-card p {
  color: #aaa;
  font-size: 0.88rem;
}

.showcase-product-card .showcase-price {
  display: block;
  margin-top: 6px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #2ecc71;
}

#phase-reveal .amazon-verify-link {
  margin-bottom: 20px;
}

.showcase-product-card .amazon-verify-link {
  display: block;
  margin-top: 8px;
  font-size: 0.75rem;
}

/* ===== Results ===== */
#phase-results {
  text-align: center;
  margin-top: 40px;
}

#phase-results h2 { font-size: 2rem; margin-bottom: 12px; }

/* ===== Game Over ===== */
#phase-game-over { text-align: center; margin-top: 2vh; }
#phase-game-over h1 { margin-bottom: 8px; color: #FFD700; }

.final-scores {
  max-width: 400px;
  margin: 8px auto;
}

.final-score-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(22, 33, 62, 0.8);
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.final-score-item:first-child {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #1a1a2e;
  font-size: 1.3rem;
  font-weight: 700;
}

.final-score-item .rank { margin-right: 12px; }

/* ===== Final Score Slide-In Animation ===== */
@keyframes score-slide-in {
  0%   { opacity: 0; transform: translateY(-28px) scale(0.95); }
  70%  { opacity: 1; transform: translateY(4px) scale(1.01); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.final-score-item-enter {
  animation: score-slide-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ===== Game Phase Headers ===== */
.game-phase {
  text-align: center;
}

.game-phase h2 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

/* ===== Confetti ===== */
@keyframes confetti-fall {
  0% { transform: translateY(-100vh) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

.confetti-piece {
  position: fixed;
  width: 10px;
  height: 10px;
  top: -10px;
  animation: confetti-fall 3s ease-out forwards;
  z-index: 1000;
  pointer-events: none;
}

/* ===== Score Notifications ===== */
#score-notifications {
  position: fixed;
  top: 4.5rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  align-items: flex-end;
}
.score-toast {
  background: #1a7a1a;
  border: 1px solid #2ecc2e;
  border-radius: 8px;
  padding: 0.55rem 1rem;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 600;
  box-shadow: 0 4px 18px rgba(0,0,0,0.6), 0 0 8px rgba(46,204,46,0.4);
  animation: score-toast-in 0.3s ease forwards;
  white-space: nowrap;
}
.score-toast.score-toast-loss {
  background: #a01010;
  border-color: #e05050;
  box-shadow: 0 4px 18px rgba(0,0,0,0.6), 0 0 8px rgba(204,50,50,0.45);
}
.score-toast.fade-out {
  animation: score-toast-out 0.6s ease forwards;
}
@keyframes score-toast-in {
  from { opacity: 0; transform: translateX(50px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes score-toast-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(50px); }
}

/* ===== Debug Product Preview ===== */
.product-preview-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.product-preview-container h2 {
  color: #FFD700;
  text-align: center;
  margin-bottom: 8px;
}

.product-preview-meta {
  text-align: center;
  color: #aaa;
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.product-preview-meta strong {
  color: #FFD700;
}

.product-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.pp-card {
  background: rgba(22, 33, 62, 0.85);
  border: 1px solid #333;
  border-radius: 12px;
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  position: relative;
}

.pp-card-num {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 0.7rem;
  color: #666;
  font-weight: 600;
}

.pp-thumb {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 8px;
  background: #111;
  flex-shrink: 0;
}

.pp-no-img {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
}

.pp-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pp-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: #fff;
  line-height: 1.3;
}

.pp-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.pp-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
}

.pp-cat {
  background: rgba(255, 215, 0, 0.15);
  color: #FFD700;
  border: 1px solid rgba(255, 215, 0, 0.4);
}

.pp-hint {
  background: rgba(100, 200, 255, 0.12);
  color: #7ecfff;
  border: 1px solid rgba(100, 200, 255, 0.3);
}

.pp-desc {
  font-size: 0.75rem;
  color: #999;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.pp-details {
  font-size: 0.72rem;
  color: #777;
  font-style: italic;
}

.pp-price {
  font-size: 1.05rem;
  font-weight: 700;
  color: #E31837;
}

.pp-amazon {
  margin-top: 4px;
  font-size: 0.75rem;
  padding: 3px 10px 6px;
  align-self: flex-start;
}

.product-preview-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.product-preview-footer .btn-secondary {
  background: transparent;
  color: #aaa;
  border: 2px solid #555;
}

.product-preview-footer .btn-secondary:hover:not(:disabled) {
  border-color: #FFD700;
  color: #FFD700;
}

.product-preview-footer .btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Product use-in-game badge ───────────────────────────── */
.pp-game-badge {
  position: absolute;
  top: 8px;
  left: 10px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.pp-game-badge--game {
  background: rgba(46, 200, 120, 0.2);
  color: #2ec878;
  border: 1px solid rgba(46, 200, 120, 0.5);
}

.pp-game-badge--extra {
  background: rgba(120, 120, 120, 0.15);
  color: #777;
  border: 1px solid rgba(120, 120, 120, 0.3);
}

/* Extra (non-game) cards are dimmed so game cards stand out */
.pp-card-extra {
  opacity: 0.55;
  border-color: #222;
}

/* Highlight cards whose image failed to load — easy to spot broken images */
.pp-card-no-image {
  border-color: #E31837;
  box-shadow: 0 0 0 1px rgba(227, 24, 55, 0.4);
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .pir-logo-header .banner-price,
  .pir-logo-header .banner-right { font-size: 1.2rem; letter-spacing: 1px; }
  .pir-logo-header .banner-the,
  .pir-logo-header .banner-is { font-size: 0.75rem; }
  .game-header { padding: 8px 10px; }
  .room-name-display { display: none !important; }
  .btn-settings-gear { font-size: 1rem; padding: 4px 7px; }
  .product-image-container { width: 260px; height: 260px; }
  .scoreboard { gap: 4px; }
  .score-item { padding: 6px 10px; min-width: 60px; }
  .score-name { font-size: 0.75rem; }
  .score-value { font-size: 1rem; }
  .showcase-products { flex-direction: column; align-items: center; }
  .showcase-product-card { width: 90%; }
  .bid-input-group input { width: 150px; font-size: 1.4rem; }
}
