/* ============================================================
   Pick4Us - Styles
   Friendly, accessible, mobile-first group decision game
   Light & Dark mode with system preference detection
   ============================================================ */

/* Reset & Base */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ============================================================
   Color Tokens — Light Mode (default)
   ============================================================ */
:root {
  --bg-deep: #f5f5f0;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f0ec;
  --bg-input: #f7f7f4;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-soft: rgba(59, 130, 246, 0.12);
  --accent: #e76f51;
  --accent-soft: rgba(231, 111, 81, 0.12);
  --success: #22c55e;
  --success-soft: rgba(34, 197, 94, 0.12);
  --warning: #e9c46a;
  --warning-soft: rgba(233, 196, 106, 0.15);
  --danger: #e76f51;
  --danger-soft: rgba(231, 111, 81, 0.1);
  --text: #264653;
  --text-muted: #4a6670;
  --text-dim: #6b8590;
  --border: #dde3e0;
  --shadow: 0 2px 8px rgba(38, 70, 83, 0.08);
  --shadow-lg: 0 8px 24px rgba(38, 70, 83, 0.12);
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --transition: 0.2s ease;
  color-scheme: light dark;
}

/* ============================================================
   Dark Mode
   ============================================================ */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-deep: #1a1f25;
    --bg-card: #242b33;
    --bg-card-hover: #2d353f;
    --bg-input: #1e252c;
    --primary: #60a5fa;
    --primary-hover: #3b82f6;
    --primary-soft: rgba(96, 165, 250, 0.15);
    --accent: #ff6b6b;
    --accent-soft: rgba(255, 107, 107, 0.15);
    --success: #4ade80;
    --success-soft: rgba(74, 222, 128, 0.15);
    --warning: #ffd93d;
    --warning-soft: rgba(255, 217, 61, 0.15);
    --danger: #ff6b6b;
    --danger-soft: rgba(255, 107, 107, 0.12);
    --text: #e8eded;
    --text-muted: #9fb3b8;
    --text-dim: #6b8186;
    --border: #333d46;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.3);
  }
}

/* Manual dark override */
[data-theme="dark"] {
  --bg-deep: #1a1f25;
  --bg-card: #242b33;
  --bg-card-hover: #2d353f;
  --bg-input: #1e252c;
  --primary: #60a5fa;
  --primary-hover: #3b82f6;
  --primary-soft: rgba(96, 165, 250, 0.15);
  --accent: #ff6b6b;
  --accent-soft: rgba(255, 107, 107, 0.15);
  --success: #4ade80;
  --success-soft: rgba(74, 222, 128, 0.15);
  --warning: #ffd93d;
  --warning-soft: rgba(255, 217, 61, 0.15);
  --danger: #ff6b6b;
  --danger-soft: rgba(255, 107, 107, 0.12);
  --text: #e8eded;
  --text-muted: #9fb3b8;
  --text-dim: #6b8186;
  --border: #333d46;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.3);
}

html { font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--bg-deep);
  color: var(--text);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}

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

/* ============================================================
   Theme Toggle
   ============================================================ */
.theme-toggle {
  position: fixed;
  bottom: 12px;
  right: 12px;
  z-index: 50;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-card);
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  transition: all var(--transition);
}
.theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-lg);
}

/* ============================================================
   Layout
   ============================================================ */
.app {
  width: 100%;
  max-width: 480px;
  min-height: 100dvh;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.screen {
  display: none;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
  animation: fadeIn 0.3s ease;
}

.screen.active { display: flex; }

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

/* ============================================================
   Typography
   ============================================================ */
.logo {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--primary);
  margin-bottom: 4px;
}

.tagline {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 32px;
}

h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 8px;
}

h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn-primary {
  width: 100%;
  padding: 16px 24px;
  font-size: 1.1rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--primary);
  color: white;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-primary:active:not(:disabled) { transform: translateY(0); }

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: var(--text-dim);
}

.btn-accent {
  background: var(--accent);
}

.btn-accent:hover:not(:disabled) {
  filter: brightness(1.1);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  width: 100%;
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 600;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--bg-card);
  color: var(--text);
  transition: all var(--transition);
  box-shadow: var(--shadow);
}

.btn-secondary:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.btn-large { padding: 18px 24px; font-size: 1.15rem; }

.btn-small {
  padding: 10px 16px;
  font-size: 0.9rem;
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-row {
  display: flex;
  gap: 12px;
  width: 100%;
}

.btn-row > * { flex: 1; }

/* ============================================================
   Inputs
   ============================================================ */
input[type="text"], input[type="number"], select {
  width: 100%;
  padding: 14px 16px;
  font-size: 1rem;
  font-family: var(--font);
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: border-color var(--transition);
  outline: none;
}

input:focus, select:focus {
  border-color: var(--primary);
}

input::placeholder { color: var(--text-dim); }

.idea-input {
  display: block;
  width: 100%;
  margin-bottom: 12px;
  box-sizing: border-box;
}

/* ============================================================
   Cards
   ============================================================ */
.card {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

/* ============================================================
   Landing Screen
   ============================================================ */
.landing-hero {
  text-align: center;
  padding: 80px 0 16px;
  padding-top: max(80px, calc(env(safe-area-inset-top, 0px) + 60px));
}

.pickles-container {
  position: relative;
  display: inline-block;
}

.landing-mascot {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  overflow: hidden;
  border: 3px solid var(--border);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  animation: float 3s ease-in-out infinite;
  cursor: pointer;
  transition: transform 0.2s;
}

.landing-mascot:active {
  transform: scale(0.95);
}

.speech-bubble {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 10px 16px;
  max-width: 260px;
  width: max-content;
  box-shadow: var(--shadow);
  animation: bubble-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  z-index: 5;
}

.speech-bubble p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--text);
}

/* Triangle pointer */
.speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid var(--bg-card);
}

.speech-bubble::before {
  content: '';
  position: absolute;
  bottom: -9px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 9px solid var(--border);
}

.speech-bubble.hidden {
  display: none;
}

/* Confirm Dialog */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.confirm-dialog {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 24px;
  max-width: 320px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.confirm-message {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 4px;
}

.confirm-subtitle {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin: 0 0 20px;
}

.confirm-buttons {
  display: flex;
  gap: 12px;
}

.confirm-btn {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--transition);
}

.confirm-cancel {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.confirm-ok {
  background: var(--primary);
  color: white;
}

@keyframes bubble-pop {
  0% { opacity: 0; transform: translateX(-50%) translateY(-100%) scale(0.5); }
  100% { opacity: 1; transform: translateX(-50%) translateY(-100%) scale(1); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.btn-decide {
  padding: 16px 32px;
  font-size: 1.1rem;
  border-radius: 28px;
  margin-top: 8px;
}

/* Inline Join Code */
.join-code-inline {
  text-align: center;
  margin-top: 20px;
}

.join-code-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

.join-code-boxes {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.code-box {
  width: 52px;
  height: 56px;
  border: 2px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font-size: 1.5rem;
  font-weight: 800;
  font-family: var(--font);
  text-align: center;
  text-transform: uppercase;
  caret-color: var(--primary);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.1s ease;
}

.code-box:focus {
  border-color: var(--primary);
  outline: none;
  background: var(--primary-soft);
}

.code-box.error {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* Custom question input — hidden by default, replaces madlib sentence */
.madlib-wrapper {
  position: relative;
  width: 100%;
}

.madlib-custom-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  font-size: clamp(1rem, 4vw, 1.3rem);
  font-weight: 600;
  font-family: var(--font);
  border: 2px dashed var(--primary);
  border-radius: 28px;
  background: var(--primary-soft);
  color: var(--text);
  padding: 12px 24px;
  box-sizing: border-box;
  transition: opacity 0.25s ease;
}

.madlib-custom-input::placeholder {
  color: var(--text-dim);
  font-weight: 400;
}

.madlib-wrapper.custom-mode .madlib-sentence {
  opacity: 0;
  pointer-events: none;
}

.madlib-wrapper.custom-mode .madlib-custom-input {
  opacity: 1;
  pointer-events: auto;
}

.landing-identity {
  width: 100%;
  margin-bottom: 8px;
}

.landing-identity.hidden {
  display: none !important;
  visibility: hidden !important;
  max-height: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

.landing-identity.hidden > * {
  display: none !important;
}

@keyframes reveal-slide {
  0% { opacity: 0; transform: translateY(-10px); max-height: 0; }
  100% { opacity: 1; transform: translateY(0); max-height: 300px; }
}

.btn-go {
  background: #22c55e !important;
}

.btn-go:hover {
  background: #16a34a !important;
}

.landing-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin-bottom: 32px;
}

.how-toggle {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.9rem;
  font-family: var(--font);
  cursor: pointer;
  padding: 16px 0 4px;
  transition: color var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 auto;
}

.how-toggle:hover {
  color: var(--text);
}

.how-toggle-arrow {
  display: inline-block;
  transition: transform 0.2s ease;
  font-size: 1rem;
}

.how-toggle-arrow.open {
  transform: rotate(90deg);
}

.how-it-works {
  width: 100%;
  text-align: left;
}

.how-it-works.hidden {
  display: none;
}

.step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
}

.step-number {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.step-content h4 {
  font-size: 1rem;
  margin-bottom: 4px;
}

.step-content p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ============================================================
   Create Screen
   ============================================================ */
.back-btn {
  align-self: flex-start;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.8rem;
  cursor: pointer;
  padding: 0 8px;
  line-height: 1;
  transition: color var(--transition);
}

.back-btn:hover {
  color: var(--primary);
}

.create-question {
  font-size: clamp(1.1rem, 5vw, 1.5rem);
  font-weight: 700;
  color: var(--primary);
  text-align: center;
  margin: 4px 0 20px;
  padding: 0 16px;
  width: 100%;
}

.create-form {
  width: 100%;
}

.create-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  margin-top: 20px;
}

.create-form label:first-child { margin-top: 0; }

/* ============================================================
   Mad-Libs Topic Selector
   ============================================================ */
.madlib-sentence {
  font-size: clamp(1.05rem, 5vw, 1.6rem);
  font-weight: 700;
  text-align: center;
  line-height: 2.2;
  color: var(--text);
  margin-bottom: 8px;
  padding: 12px 0;
  white-space: nowrap;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.2s ease, margin 0.3s ease, padding 0.3s ease;
}

/* (hidden-smooth removed — custom mode handled via .madlib-wrapper.custom-mode) */

.madlib-prefix, #madlib-suffix {
  color: var(--text);
}

.madlib-verb {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border: 2px solid var(--primary);
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  color: var(--primary);
  font-size: inherit;
  font-weight: 800;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--transition);
  line-height: 1.4;
  vertical-align: baseline;
}

.madlib-verb:hover {
  background: var(--primary);
  color: white;
}

/* caret removed — dropdown behavior is clear from the button styling */

.madlib-picker {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: max-height 0.3s ease, opacity 0.2s ease, margin 0.3s ease;
}

.madlib-picker.open {
  max-height: 400px;
  opacity: 1;
  margin-bottom: 16px;
  pointer-events: auto;
}

.madlib-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 8px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow);
  font-family: var(--font);
}

.madlib-option:hover {
  border-color: var(--primary);
  color: var(--text);
  background: var(--primary-soft);
  transform: translateY(-1px);
}

.madlib-option.selected {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.madlib-option-custom {
  border-style: dashed;
  grid-column: 1 / -1;
}

/* ============================================================
   Language Picker
   ============================================================ */
.lang-toggle {
  position: fixed;
  bottom: 12px;
  left: 12px;
  z-index: 50;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-card);
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  transition: all var(--transition);
}
.lang-toggle:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-lg);
}

.lang-dropdown {
  position: fixed;
  bottom: 56px;
  left: 12px;
  z-index: 51;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  max-height: 320px;
  overflow-y: auto;
  display: none;
  min-width: 160px;
}

.lang-dropdown.open { display: block; }

.lang-dropdown button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  font-family: var(--font);
  transition: background var(--transition);
  text-align: left;
}

.lang-dropdown button:hover { background: var(--bg-card-hover); }
.lang-dropdown button.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.setting-row label { margin-top: 0; font-size: 0.9rem; }
.setting-hint { font-size: 0.75rem; color: var(--text-dim); margin: 2px 0 0; }

.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.stepper span {
  font-size: 1.1rem;
  font-weight: 700;
  min-width: 28px;
  text-align: center;
}

.stepper-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.stepper-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ============================================================
   Emoji Carousel (Character Picker)
   ============================================================ */
.name-emoji-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.name-emoji-row input[type="text"] {
  flex: 1;
  min-width: 0;
}

.emoji-carousel {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.emoji-carousel-display {
  font-size: 2.8rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  user-select: none;
  transition: transform 0.15s ease;
}

.emoji-carousel-display.flip {
  transform: scale(0.7);
  opacity: 0.5;
}

.emoji-arrow {
  width: 36px;
  height: 36px;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 1.4rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}

.emoji-arrow:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.emoji-arrow:active {
  transform: scale(0.92);
}

/* ============================================================
   Advanced Toggle
   ============================================================ */
.advanced-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  padding: 12px 0 4px;
  font-family: var(--font);
  transition: color var(--transition);
}

.advanced-toggle:hover {
  color: var(--text-muted);
}

.advanced-arrow {
  display: inline-block;
  transition: transform 0.2s ease;
  font-size: 1rem;
}

.advanced-arrow.open {
  transform: rotate(90deg);
}

.advanced-section {
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  max-height: 200px;
  opacity: 1;
}

.advanced-section.hidden {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

/* ============================================================
   Join Screen
   ============================================================ */
.code-input-group {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 24px 0;
}

.code-digit {
  width: 56px;
  height: 64px;
  text-align: center;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  caret-color: var(--primary);
}

/* Join Name Screen */
.join-name-form {
  width: 100%;
  text-align: center;
}

.room-code-badge {
  display: inline-block;
  padding: 8px 20px;
  background: var(--bg-card);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 4px;
  color: var(--primary);
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.random-name-hint {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 8px;
  margin-bottom: 20px;
}

/* ============================================================
   Lobby Screen
   ============================================================ */
.lobby-info {
  text-align: center;
  width: 100%;
}

.lobby-topic {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 20px;
  padding: 14px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.lobby-share {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 20px;
  width: 100%;
  box-shadow: var(--shadow);
}

.lobby-code {
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: 8px;
  color: var(--primary);
}

.lobby-qr {
  width: 160px;
  height: 160px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.lobby-link {
  font-size: 0.85rem;
  color: var(--text-dim);
  word-break: break-all;
}

.lobby-players-section {
  width: 100%;
  margin-top: 8px;
}

.lobby-players-section h3 {
  margin-bottom: 12px;
}

.player-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  transition: all var(--transition);
  animation: slideIn 0.3s ease;
  box-shadow: var(--shadow);
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

.player-card.me { border-color: var(--primary); background: var(--primary-soft); }
.player-card.disconnected { opacity: 0.4; }

.player-emoji { font-size: 1.5rem; }
.player-name { font-weight: 600; flex: 1; text-align: left; }
.host-badge { font-size: 1.2rem; }

/* ============================================================
   Submit Screen
   ============================================================ */
.submit-header {
  text-align: center;
  width: 100%;
  margin-bottom: 12px;
}

.submit-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.submit-share {
  margin: 12px 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--bg-card) 100%);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.submit-code-badge {
  font-family: "SF Mono", Monaco, Consolas, monospace;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 6px;
  color: var(--primary);
  margin-bottom: 8px;
  cursor: pointer;
  user-select: all;
}

.submit-share-row {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
}

.submit-qr {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 4px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.submit-share-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

.btn-copy-link {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  font-family: var(--font);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-copy-link:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.submit-share-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin: 0;
  opacity: 0.8;
}

.submit-form {
  width: 100%;
}

.submission-success {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #22c55e;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 16px 0 4px;
}

.checkmark-icon {
  animation: checkPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.waiting-pulse {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  animation: softPulse 2s ease-in-out infinite;
}

@keyframes softPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Legacy compat */
.submitted-check { display: none; }
.submitted-text { text-align: center; color: var(--text-muted); font-size: 1rem; }

.extra-idea-note {
  font-size: 0.85rem;
  color: var(--text);
  background: var(--warning-soft);
  border: 1px solid var(--warning);
  border-radius: var(--radius-xs);
  padding: 10px;
  margin-bottom: 16px;
  text-align: center;
}

/* Submit Progress */
.submit-progress {
  width: 100%;
  margin-top: 12px;
  text-align: center;
}

.progress-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-input);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.5s ease;
}

.progress-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-weight: 500;
}

.submit-avatars {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.avatar-dot {
  font-size: 1.6rem;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-input);
  opacity: 0.4;
  transition: all var(--transition);
}

.avatar-dot.done {
  opacity: 1;
  background: color-mix(in srgb, var(--primary) 15%, transparent);
  box-shadow: 0 0 0 2px var(--primary);
}

.avatar-dot.waiting { animation: pulse 2s ease-in-out infinite; }

@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.6; }
}

/* Waiting-on text */
.waiting-on {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-top: 10px;
}

.waiting-on span {
  font-weight: 600;
  color: var(--text-muted);
}

/* ============================================================
   Live Submission Feed
   ============================================================ */
.submit-feed {
  width: 100%;
  margin-top: 24px;
}

.feed-title {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  text-align: center;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.idea-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.idea-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  animation: slideIn 0.3s ease;
}

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

.idea-author {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.idea-author.host-reveal {
  cursor: pointer;
  position: relative;
}

.idea-author.host-reveal.revealed::after {
  content: attr(title);
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px 8px;
  font-size: 0.75rem;
  white-space: nowrap;
  box-shadow: var(--shadow);
  z-index: 10;
  color: var(--text);
}

.idea-text {
  flex: 1;
  font-size: 0.95rem;
  color: var(--text);
  word-break: break-word;
}

.idea-link {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  text-decoration: none;
  color: var(--primary);
}

.idea-link:hover .idea-text {
  text-decoration: underline;
}

.idea-youtube {
  border-radius: var(--radius-sm);
}

.yt-thumb {
  width: 100%;
  border-radius: var(--radius-sm);
  aspect-ratio: 16/9;
  object-fit: cover;
}

.link-icon {
  font-size: 0.8rem;
  flex-shrink: 0;
}

/* ============================================================
   Session Reclaim
   ============================================================ */
.btn-reclaim {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.85rem;
  font-family: var(--font);
  cursor: pointer;
  padding: 12px 0;
  text-decoration: none;
  transition: color var(--transition);
  display: block;
  margin: 0 auto;
}

.btn-reclaim:hover { color: var(--primary); }

.reclaim-panel { width: 100%; text-align: center; }
.reclaim-panel h3 { margin-bottom: 16px; }

.reclaim-players {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.reclaim-player-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.reclaim-player-btn:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.reclaim-player-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

.reclaim-emoji { font-size: 1.4rem; }
.reclaim-name { font-weight: 600; }

.reclaim-hint {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.reclaim-hint.waiting {
  color: var(--primary);
  animation: pulse 1.5s ease-in-out infinite;
}

/* Host approval toast */
.reclaim-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--surface);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  z-index: 1000;
  text-align: center;
  max-width: 320px;
  width: 90%;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.reclaim-toast.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.reclaim-toast p { margin-bottom: 12px; font-size: 0.95rem; }

.reclaim-toast-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.btn-approve {
  padding: 8px 20px;
  border: none;
  border-radius: 20px;
  background: var(--primary);
  color: white;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
}

.btn-deny {
  padding: 8px 20px;
  border: 2px solid var(--border);
  border-radius: 20px;
  background: none;
  color: var(--text-dim);
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
}

/* ============================================================
   Eliminate Screen
   ============================================================ */
.eliminate-screen {
  width: 100%;
}

.your-turn-banner {
  font-size: 1.5rem;
  font-weight: 800;
  text-align: center;
  padding: 16px;
  background: var(--accent);
  color: white;
  border-radius: var(--radius);
  margin-bottom: 8px;
  animation: pulse-glow 1.5s ease-in-out infinite;
  box-shadow: var(--shadow-lg);
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 15px var(--accent-soft); }
  50% { box-shadow: 0 0 30px var(--accent-soft), 0 0 60px var(--accent-soft); }
}

.pulse-glow { animation: pulse-glow 1.5s ease-in-out infinite; }

.eliminate-instruction {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.waiting-turn {
  text-align: center;
  font-size: 1.15rem;
  padding: 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  margin-bottom: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.option-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-align: left;
  font-family: var(--font);
  color: var(--text);
  font-size: 1rem;
  box-shadow:
    0 1px 3px rgba(0,0,0,0.08),
    0 4px 8px rgba(0,0,0,0.1),
    0 8px 16px rgba(0,0,0,0.06);
  position: relative;
  overflow: hidden;
}

.option-card.eliminable:hover {
  border-color: var(--danger);
  background: var(--danger-soft);
  transform: translateY(-2px);
  box-shadow:
    0 2px 6px rgba(0,0,0,0.1),
    0 8px 16px rgba(0,0,0,0.15),
    0 16px 32px rgba(0,0,0,0.1);
}

.option-card.eliminable:active {
  transform: scale(0.96);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.option-card.locked {
  cursor: default;
  opacity: 0.7;
}

.option-text {
  font-weight: 600;
  font-size: 1.05rem;
}

.option-submitter {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 4px;
}

#eliminate-count {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* Turn Order */
#turn-order {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.turn-dot {
  font-size: 1.3rem;
  opacity: 0.3;
  transition: all var(--transition);
}

.turn-dot.current {
  opacity: 1;
  transform: scale(1.3);
}

.turn-dot.past { opacity: 0.15; }

/* Timer */
.timer-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-input);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 4px;
}

.timer-fill {
  height: 100%;
  background: #4CAF50;
  border-radius: 3px;
  transition: width 1s linear, background-color 0.3s ease;
}

.timer-fill.warning {
  background: #FFC107;
}

.timer-fill.danger {
  background: #FF9800;
}

.timer-fill.critical {
  background: #F44336;
  animation: timer-pulse-red 0.6s ease-in-out infinite;
}

@keyframes timer-pulse-red {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px rgba(244,67,54,0.3); }
  50% { opacity: 0.7; box-shadow: 0 0 20px rgba(244,67,54,0.6); }
}

.timer-text.critical {
  color: #F44336;
  font-weight: 700;
  animation: timer-bounce 0.3s cubic-bezier(0.68,-0.55,0.265,1.55);
}

@keyframes timer-bounce {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.timer-text {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-align: right;
  display: block;
}

/* Elimination Animations — Spotlight style inspired by Jackbox */

/* Early game: quick slide with fade */
.eliminate-slide {
  animation: eliminateSlide 0.5s ease forwards;
}

/* Mid game: spotlight vignette + shrink */
.eliminate-spotlight {
  animation: eliminateSpotlight 0.7s cubic-bezier(0.45, 0, 0.55, 1) forwards;
}

/* Final few: dramatic red glow + shake + collapse */
.eliminate-dramatic {
  animation: eliminateDramatic 1s ease forwards;
}

/* THE final elimination: slow spotlight with screen impact */
.eliminate-final {
  animation: eliminateFinal 1.5s cubic-bezier(0.25, 0, 0.3, 1) forwards;
}

@keyframes eliminateSlide {
  0% { transform: translateX(0); opacity: 1; }
  40% { transform: translateX(-8px); opacity: 1; }
  100% { transform: translateX(100%); opacity: 0; }
}

@keyframes eliminateSpotlight {
  0% { box-shadow: inset 0 0 0 rgba(0,0,0,0); opacity: 1; transform: scale(1); filter: brightness(1); }
  40% { box-shadow: inset 0 0 60px rgba(0,0,0,0.6); opacity: 1; transform: scale(1.02); filter: brightness(0.7) saturate(0); }
  100% { box-shadow: inset 0 0 80px rgba(0,0,0,0.9); opacity: 0; transform: scale(0.3); filter: brightness(0.3) saturate(0); }
}

@keyframes eliminateDramatic {
  0% { transform: scale(1); opacity: 1; filter: brightness(1); border-color: var(--border); }
  15% { transform: scale(1.06); filter: brightness(1.2); border-color: var(--danger); box-shadow: 0 0 20px rgba(220,38,38,0.4); }
  30% { transform: scale(1.03) translateX(-6px); filter: brightness(0.9); }
  40% { transform: scale(1.03) translateX(6px); }
  50% { transform: scale(1.03) translateX(-4px); }
  60% { transform: scale(1.03) translateX(0); box-shadow: inset 0 0 40px rgba(0,0,0,0.5); filter: brightness(0.6) saturate(0); }
  100% { transform: scale(0.1); opacity: 0; filter: brightness(0.2) saturate(0); }
}

@keyframes eliminateFinal {
  0% { transform: scale(1); opacity: 1; filter: brightness(1); border-color: var(--border); }
  10% { transform: scale(1.08); filter: brightness(1.3); border-color: var(--danger); box-shadow: 0 0 30px rgba(220,38,38,0.5); }
  25% { transform: scale(1.05) translateX(-8px); }
  30% { transform: scale(1.05) translateX(8px); }
  35% { transform: scale(1.05) translateX(-6px); }
  40% { transform: scale(1.05) translateX(6px); }
  45% { transform: scale(1.05) translateX(0); }
  55% { box-shadow: inset 0 0 60px rgba(0,0,0,0.7); filter: brightness(0.5) saturate(0); transform: scale(1.05); }
  100% { box-shadow: inset 0 0 80px rgba(0,0,0,0.9); transform: scale(0); opacity: 0; filter: brightness(0) saturate(0); }
}

/* Winner glow on surviving card */
.option-card.winner-glow {
  border-color: #FFD700 !important;
  box-shadow: 0 0 20px rgba(255,215,0,0.4), 0 0 40px rgba(255,215,0,0.2) !important;
  animation: winnerPulse 1s ease-in-out infinite;
}

@keyframes winnerPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(255,215,0,0.4), 0 0 40px rgba(255,215,0,0.2); }
  50% { box-shadow: 0 0 30px rgba(255,215,0,0.6), 0 0 60px rgba(255,215,0,0.3); }
}

/* Screen shake for final elimination */
@keyframes screenShake {
  0%, 100% { transform: translateX(0); }
  10% { transform: translateX(-10px); }
  20% { transform: translateX(10px); }
  30% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  50% { transform: translateX(-6px); }
  60% { transform: translateX(6px); }
  70% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.screen-shake {
  animation: screenShake 0.4s ease-in-out;
}

@keyframes fadeSlideUp {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Lobby animated background */
#screen-lobby {
  position: relative;
}

#screen-lobby::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 20px,
    rgba(128,128,128,0.03) 20px,
    rgba(128,128,128,0.03) 40px
  );
  background-size: 200% 200%;
  animation: lobbyBgSlide 25s linear infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes lobbyBgSlide {
  0% { background-position: 0 0; }
  100% { background-position: 100px 100px; }
}

/* Player join animation */
.player-card-join {
  animation: playerJoinPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes playerJoinPop {
  0% { transform: translateY(30px) scale(0.8); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* ============================================================
   Result Screen
   ============================================================ */
.result-screen {
  text-align: center;
  width: 100%;
  position: relative;
}

#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
}

.result-card {
  background: var(--bg-card);
  border: 2px solid #FFD700;
  border-radius: 16px;
  padding: 32px 24px;
  margin: 20px 0;
  animation: resultPodiumRise 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  box-shadow:
    0 0 30px rgba(255,215,0,0.3),
    0 0 60px rgba(255,215,0,0.15),
    0 8px 32px rgba(0,0,0,0.2);
}

@keyframes resultPodiumRise {
  0% { transform: translateY(80px) scale(0.9); opacity: 0; }
  60% { transform: translateY(-10px) scale(1.03); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

#result-winner {
  font-size: 2rem;
  font-weight: 900;
  color: #FFD700;
  margin-bottom: 8px;
  text-shadow: 0 0 20px rgba(255,215,0,0.4);
  animation: winnerTextReveal 0.6s cubic-bezier(0.68,-0.55,0.265,1.55) 0.4s both;
}

@keyframes winnerTextReveal {
  0% { transform: scale(0.5); opacity: 0; text-shadow: 0 0 0 rgba(255,215,0,0); }
  100% { transform: scale(1); opacity: 1; text-shadow: 0 0 20px rgba(255,215,0,0.4), 0 0 40px rgba(255,215,0,0.2); }
}

.result-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

#result-submitter {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 16px;
}

#result-topic {
  font-size: 1rem;
  color: var(--text-dim);
}

#result-players {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 12px;
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-top: 20px;
}

/* ============================================================
   Utilities
   ============================================================ */
.shake {
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.gap-sm { margin-bottom: 12px; }
.gap-md { margin-bottom: 20px; }
.gap-lg { margin-bottom: 32px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }
.text-sm { font-size: 0.85rem; }
.w-full { width: 100%; }

/* ============================================================
   Footer / Branding
   ============================================================ */
.footer {
  text-align: center;
  padding: 20px 0;
  margin-top: auto;
}

.footer a {
  color: var(--text-dim);
  font-size: 0.8rem;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (min-width: 600px) {
  .app { padding: 32px; }
  .logo { font-size: 3rem; }
  .landing-emoji { font-size: 5rem; }
  .option-card { padding: 18px 24px; }
}

/* Bookmark hint */
.bookmark-hint, .submit-bookmark-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 8px;
  opacity: 0.7;
}

/* YouTube mode */
.yt-mode-hint {
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: #dc2626;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
}

[data-theme="dark"] .yt-mode-hint,
.dark .yt-mode-hint {
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.3);
  color: #f87171;
}

.yt-input {
  font-size: 0.85rem !important;
}

.option-card.yt-card {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.option-yt-thumb {
  width: 48px;
  height: 36px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}

.yt-title {
  font-size: 0.9rem;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--bg-input);
  border-radius: 24px;
  transition: background 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* Button press feedback */
.btn-primary:active, .btn-secondary:active, .btn-decide:active {
  transform: scale(0.96);
  transition: transform 0.1s ease;
}

/* Accessibility: focus visible */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
