:root {
  --bg: #f4f1e8;
  --ink: #151515;
  --muted: #57595f;
  --panel: rgba(255, 255, 255, 0.82);
  --line: rgba(20, 20, 20, 0.12);
  --shadow: 0 12px 35px rgba(22, 30, 39, 0.14);

  --chatgpt: #22a86f;
  --gemini: #f39f32;
  --claude: #2686e8;
  --openrouter: #7c3aed;
  --deepseek: #4d6bfe;
  --mistral: #f97316;
  --accent: #2686e8;
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  height: 100vh;
  width: 100%;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 12% 18%, #dbeaf4, transparent 40%),
    radial-gradient(circle at 92% 75%, #f8deb8, transparent 35%), var(--bg);
  overflow: hidden;
  overflow-x: hidden;
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(circle at center, black 35%, transparent 85%);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.2rem;
  gap: 1rem;
}

.brand h1 {
  margin: 0;
  font-size: 1.25rem;
}

.brand p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.menu-toggle {
  position: fixed;
  top: 0.7rem;
  right: 0.75rem;
  z-index: 10020;
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(8px);
  border-radius: 8px;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(22, 30, 39, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  pointer-events: auto;
}

.menu-toggle:hover {
  border-color: rgba(20, 20, 20, 0.3);
}

.menu-open .menu-toggle {
  background: #111;
  color: #fff;
  border-color: #111;
}

.panel-toggles {
  position: fixed;
  top: 3.6rem;
  right: 0.75rem;
  z-index: 10010;
  display: grid;
  gap: 0.42rem;
  width: min(60vw, 180px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.menu-open .panel-toggles {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.panel-toggle,
.icon-btn {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(8px);
  border-radius: 8px;
  font-size: 0.74rem;
  cursor: pointer;
  padding: 0.55rem 0.45rem;
  box-shadow: 0 8px 20px rgba(22, 30, 39, 0.1);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.panel-toggle:hover,
.icon-btn:hover {
  border-color: rgba(20, 20, 20, 0.3);
}

.panel-toggle--toktok {
  background: #1a6cf6;
  border-color: #1a6cf6;
  color: #fff;
  font-weight: 600;
  margin-top: 0.35rem;
  order: 999;
}

.panel-toggle--toktok:hover {
  background: #1558d0;
  border-color: #1558d0;
}

#admin-toggle {
  background: #111;
  border-color: #111;
  color: #fff;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  padding: 0 1.2rem 1.2rem;
  height: calc(100vh - 86px);
}

.chat-panel,
.archive-panel,
.roman-panel,
.admin-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 1.1rem;
}

.archive-panel {
  position: fixed;
  top: 4.8rem;
  left: 1.2rem;
  z-index: 10120;
  width: min(88vw, 340px);
  height: calc(100vh - 6rem);
  overflow: hidden;
  padding: 0.85rem;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 0.7rem;
  transform: translateX(calc(-100% - 1.6rem));
  transition: transform 0.24s ease;
  pointer-events: auto;
  isolation: isolate;
}

.archive-open .archive-panel {
  transform: translateX(0);
}

.roman-panel {
  position: fixed;
  top: 4.8rem;
  left: 1.2rem;
  z-index: 10120;
  width: min(90vw, 380px);
  height: calc(100vh - 6rem);
  overflow: hidden;
  padding: 0.85rem;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 0.7rem;
  transform: translateX(calc(-100% - 1.6rem));
  transition: transform 0.24s ease;
  pointer-events: auto;
  isolation: isolate;
}

.roman-open .roman-panel {
  transform: translateX(0);
}

.roman-open .panel-backdrop {
  display: block;
}

.roman-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.roman-panel-head h2 {
  margin: 0;
  font-size: 1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roman-paragraphs {
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  padding-right: 0.2rem;
}

.roman-paragraph {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.roman-paragraph-num {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent, #6b46c1);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.roman-paragraph-text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text);
}

.roman-empty {
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  margin-top: 2rem;
}

/* Backdrop semi-transparent derrière les panels — clic dessus = ferme le panel */
.panel-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10110;
  background: rgba(0, 0, 0, 0.28);
}
.archive-open .panel-backdrop,
.viewer-open .panel-backdrop,
.panel-modal-open .panel-backdrop {
  display: block;
}

.archive-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.archive-head h2 {
  margin: 0;
  font-size: 1rem;
}

.archive-head button {
  padding: 0.45rem 0.65rem;
  font-size: 0.78rem;
}

.archive-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 0.12rem;
}

.archive-empty {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.archive-row {
  display: flex;
  align-items: stretch;
}

.archive-share-btn {
  flex: 0 0 auto;
  background: transparent;
  border: none;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
  padding: 0 0.6rem;
  cursor: pointer;
  transition: color 0.15s, background 0.12s;
  border-radius: 0 6px 6px 0;
  white-space: nowrap;
  align-self: stretch;
  display: flex;
  align-items: center;
}

.archive-share-btn:hover {
  color: var(--ink);
  background: rgba(0,0,0,0.04);
}

.archive-item {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  padding: 0.7rem 0.65rem 0.65rem;
  flex: 1 1 0;
  min-width: 0;
  border: 0;
  border-radius: 6px 0 0 6px;
  background: transparent;
  cursor: pointer;
  transition: background 0.12s;
}

.archive-item.active {
  background: rgba(255, 255, 255, 0.88);
  box-shadow: inset 3px 0 0 #111;
}

.archive-item:hover {
  background: rgba(255, 255, 255, 0.72);
}

.arc-topic {
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.arc-meta {
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.66rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.arc-stats {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  margin-top: 0.1rem;
}

.arc-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.18rem 0.42rem;
  border-radius: 999px;
  white-space: nowrap;
  line-height: 1.4;
}

.arc-model {
  background: rgba(15, 23, 42, 0.07);
  color: #1e293b;
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.arc-vibe {
  background: rgba(249, 115, 22, 0.08);
  color: #9a3412;
  border: 1px solid rgba(249, 115, 22, 0.18);
}

.arc-quote {
  font-size: 0.67rem;
  color: var(--muted);
  font-style: italic;
  line-height: 1.45;
  margin: 0.1rem 0 0;
  overflow: hidden;
  max-height: 2.1em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.arc-summary {
  font-size: 0.67rem;
  color: var(--ink);
  line-height: 1.5;
  margin: 0.25rem 0 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  max-height: 3.2em;
  border-left: 2px solid rgba(99,102,241,0.3);
  padding-left: 0.45rem;
}

.arc-summary-loading {
  color: var(--muted);
  font-style: italic;
  border-left-color: rgba(0,0,0,0.1);
  animation: arc-pulse 1.4s ease-in-out infinite;
}

@keyframes arc-pulse {
  0%, 100% { opacity: 0.5; }
  50%       { opacity: 1; }
}

.chat-panel {
  height: 100%;
  width: min(100%, 1180px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  gap: 0.9rem;
  overflow: hidden;
}

.chat-head {
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.68);
  padding: 0.75rem 0.9rem;
}

.chat-head-top { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

.chat-head-label {
  margin: 0;
  font-size: 0.74rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: "IBM Plex Mono", monospace;
}

.debate-timer { font-family: "IBM Plex Mono", monospace; font-size: 0.72rem; font-weight: 600; color: #e53e3e; background: rgba(229,62,62,0.1); border: 1px solid rgba(229,62,62,0.25); border-radius: 5px; padding: 0.1rem 0.35rem; animation: timerPulse 2s ease-in-out infinite; }
.debate-timer--long { color: #dd6b20; background: rgba(221,107,32,0.12); border-color: rgba(221,107,32,0.3); }
@keyframes timerPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.65; } }
.planning-badge { font-family: "IBM Plex Mono", monospace; font-size: 0.72rem; font-weight: 600; color: #6b46c1; background: rgba(107,70,193,0.1); border: 1px solid rgba(107,70,193,0.3); border-radius: 5px; padding: 0.1rem 0.45rem; animation: timerPulse 2s ease-in-out infinite; }

.xp-boost-badge { font-size: 0.72rem; font-weight: 700; color: #fff; background: linear-gradient(135deg, #e67e22, #f39c12); border-radius: 5px; padding: 0.1rem 0.4rem; animation: boostPulse 1.5s ease-in-out infinite; }
@keyframes boostPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }

.xp-boost-btn { background: none; border: 1px solid var(--border); border-radius: 6px; padding: 0.25rem 0.5rem; font-size: 0.78rem; cursor: pointer; color: var(--muted); transition: all 0.12s; }
.xp-boost-btn.active { background: linear-gradient(135deg,#e67e22,#f39c12); border-color: #e67e22; color: #fff; font-weight: 700; }
.xp-boost-btn:hover { border-color: #e67e22; color: #e67e22; }

.chat-head h2 {
  margin: 0.2rem 0 0;
  font-size: 1.12rem;
  font-weight: 700;
}

.scoreboard {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.65rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  color: var(--muted);
}

.scoreboard span {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.75);
  padding: 0.28rem 0.42rem;
}

.scoreboard strong {
  color: var(--ink);
}

.avatar-strip {
  overflow: hidden;
  margin-top: 0.65rem;
  position: relative;
  mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
}

.avatar-strip-track {
  display: flex;
  width: 200%; /* 10 avatars × (W/5) = 2W pour 5 visibles sur desktop */
  animation: avatarTicker 24s linear infinite;
}

.avatar-strip:hover .avatar-strip-track {
  animation-play-state: paused;
}

.avatar {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  padding: 0.38rem;
  min-width: 0;
  /* flex sizing : chaque slot = 10% du track = W/visible */
  flex: 0 0 calc(10% - 0.4rem);
  margin: 0 0.2rem;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.vote-section {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  margin-top: 0.05rem;
}

.vote-btn {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.58rem;
  line-height: 1.4;
  padding: 0.1rem 0.25rem;
  border-radius: 4px;
  border: 1px solid rgba(20, 20, 20, 0.18);
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
  cursor: pointer;
  width: 100%;
  text-align: center;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vote-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(20, 20, 20, 0.35);
}

.vote-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.vote-btn.voted {
  background: rgba(20, 20, 20, 0.07);
  border-color: rgba(20, 20, 20, 0.3);
  font-weight: 600;
}

@keyframes vote-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 0, 0.55); border-color: rgba(255,107,0,0.7); }
  50%       { box-shadow: 0 0 0 5px rgba(255, 107, 0, 0); border-color: rgba(255,107,0,0.3); }
}
.vote-btn.vote-pulse,
.chat-vote-btn.vote-pulse {
  animation: vote-pulse 1.4s ease-in-out infinite;
  border-color: rgba(255, 107, 0, 0.7);
}

.vote-bar-track {
  width: 100%;
  height: 3px;
  background: rgba(20, 20, 20, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.vote-bar-fill {
  height: 100%;
  background: rgba(20, 20, 20, 0.38);
  border-radius: 2px;
  width: 0%;
  transition: width 0.45s ease;
}

.avatar-face {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  color: #fff;
  font-weight: 700;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  position: relative;
  overflow: hidden;
}

.avatar-letters {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.avatar-emoji {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  font-family: sans-serif;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* emoji-pop: emoji visible, letters hidden */
@keyframes emoji-pop-kf {
  0%   { }
  15%  { }
  85%  { }
  100% { }
}

.avatar.emoji-pop .avatar-emoji {
  opacity: 1;
  transform: scale(1);
}

.avatar.emoji-pop .avatar-letters {
  opacity: 0;
  transform: scale(0.6);
}

.avatar.chatgpt .avatar-face {
  background: var(--chatgpt);
}

.avatar.gemini .avatar-face {
  background: var(--gemini);
}

.avatar.claude .avatar-face {
  background: var(--claude);
}

.avatar.openrouter .avatar-face {
  background: var(--openrouter);
}

.avatar.deepseek .avatar-face {
  background: var(--deepseek);
}

.avatar.mistral .avatar-face {
  background: var(--mistral);
}

.avatar.quota-exceeded {
  background: rgba(239, 68, 68, 0.07);
  border-color: rgba(239, 68, 68, 0.28);
}

.avatar.quota-exceeded .avatar-name {
  color: #dc2626;
}

.avatar.quota-exceeded .avatar-face {
  opacity: 0.45;
}

.avatar-name,
.avatar-mood {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar-name {
  font-size: 0.78rem;
  font-weight: 700;
}

.avatar-mood {
  color: var(--muted);
  font-size: 0.68rem;
  font-family: "IBM Plex Mono", monospace;
}

.avatar.speaking {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(20, 20, 20, 0.12);
  animation: avatarPulse 0.9s ease-in-out infinite;
}

.avatar.chatgpt.speaking {
  border-color: color-mix(in srgb, var(--chatgpt) 65%, black 10%);
}

.avatar.gemini.speaking {
  border-color: color-mix(in srgb, var(--gemini) 65%, black 10%);
}

.avatar.claude.speaking {
  border-color: color-mix(in srgb, var(--claude) 65%, black 10%);
}

.avatar.openrouter.speaking {
  border-color: color-mix(in srgb, var(--openrouter) 65%, black 10%);
}

.avatar.deepseek.speaking {
  border-color: color-mix(in srgb, var(--deepseek) 65%, black 10%);
}

.avatar.mistral.speaking {
  border-color: color-mix(in srgb, var(--mistral) 65%, black 10%);
}

.duel-card {
  margin-top: 0.6rem;
  border: 1px solid rgba(20, 20, 20, 0.18);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(17, 17, 17, 0.92), rgba(59, 48, 37, 0.88));
  color: #fff;
  padding: 0.58rem 0.68rem;
  box-shadow: 0 10px 26px rgba(20, 20, 20, 0.16);
  animation: popIn 0.22s ease-out;
}

.duel-card strong,
.duel-card span {
  display: block;
}

.duel-card strong {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: "IBM Plex Mono", monospace;
}

.duel-card span {
  margin-top: 0.18rem;
  font-size: 0.88rem;
}

.chat-frame {
  flex: 1;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: #fff;
  overflow: hidden;
}

.chat-log {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.bubble {
  max-width: min(86%, 820px);
  border-radius: 1rem;
  padding: 0.8rem;
  border: 1px solid var(--line);
  animation: fadeIn 0.22s ease-out;
}

.meta {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.35rem;
  font-size: 0.75rem;
  font-family: "IBM Plex Mono", monospace;
  color: #1f2937;
}

.bubble p {
  margin: 0;
  line-height: 1.45;
}

.bubble p.typing::after {
  content: "▍";
  display: inline-block;
  margin-left: 1px;
  color: var(--muted);
  animation: typingCursor 0.65s step-end infinite;
}

.bubble.chatgpt {
  align-self: flex-start;
  background: color-mix(in srgb, var(--chatgpt) 17%, white);
  border-color: color-mix(in srgb, var(--chatgpt) 32%, black 10%);
}

.bubble.gemini {
  align-self: center;
  background: color-mix(in srgb, var(--gemini) 18%, white);
  border-color: color-mix(in srgb, var(--gemini) 35%, black 10%);
}

.bubble.claude {
  align-self: flex-end;
  background: color-mix(in srgb, var(--claude) 17%, white);
  border-color: color-mix(in srgb, var(--claude) 30%, black 10%);
}

.bubble.openrouter {
  align-self: flex-start;
  background: color-mix(in srgb, var(--openrouter) 14%, white);
  border-color: color-mix(in srgb, var(--openrouter) 30%, black 10%);
}

.bubble.deepseek {
  align-self: center;
  background: color-mix(in srgb, var(--deepseek) 14%, white);
  border-color: color-mix(in srgb, var(--deepseek) 30%, black 10%);
}

.bubble.mistral {
  align-self: flex-end;
  background: color-mix(in srgb, var(--mistral) 12%, white);
  border-color: color-mix(in srgb, var(--mistral) 30%, black 10%);
}

.story-page {
  align-self: center;
  width: min(100%, 900px);
  border: 1px solid rgba(30, 41, 59, 0.16);
  border-left: 5px solid #111827;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(17, 24, 39, 0.035) 0 1px, transparent 1px 100%),
    #fffdf7;
  padding: 1.05rem 1.1rem 1rem;
  box-shadow: 0 18px 42px rgba(17, 24, 39, 0.12);
  animation: popIn 0.24s ease-out;
}

.story-page-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.2rem 0.8rem;
  align-items: end;
  padding-bottom: 0.6rem;
  margin-bottom: 0.7rem;
  border-bottom: 1px solid rgba(17, 24, 39, 0.12);
}

.story-page-kicker {
  grid-column: 1 / -1;
  color: #7c2d12;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.story-page-head strong {
  color: #111827;
  font-size: 1rem;
  line-height: 1.15;
}

.story-page-head em {
  color: #64748b;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.74rem;
  font-style: normal;
  text-align: right;
}

.story-page-text {
  margin: 0;
  color: #1f2937;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.06rem;
  line-height: 1.78;
}

.story-page-actions {
  margin-top: 0.75rem;
  justify-content: flex-end;
}

.bubble.viewer {
  align-self: center;
  background: rgba(255, 255, 255, 0.75);
  border: 1.5px dashed rgba(20,20,20,0.25);
  border-radius: 10px;
  padding: 0.4rem 0.75rem;
  max-width: 82%;
  font-size: 0.88rem;
}

.bubble.viewer p {
  margin: 0.15rem 0 0;
}

.viewer-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  display: block;
}

.system-note {
  align-self: center;
  font-size: 0.78rem;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
}

.time-separator {
  align-self: center;
  font-size: 0.72rem;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  opacity: 0.65;
  margin: 0.6rem 0 0.2rem;
  letter-spacing: 0.03em;
}

.reaction-note {
  align-self: center;
  max-width: 88%;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: none;
  padding: 0.45rem 0.6rem;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  font-weight: 400;
  animation: popIn 0.22s ease-out;
}

.topic-form {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 0.8rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}

input,
select,
textarea {
  padding: 0.75rem;
  border-radius: 0.7rem;
  border: 1px solid var(--line);
  font-family: inherit;
  font-size: 16px;
  background: #fff;
}

input.field-invalid {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
  background: #fff5f5;
}

.field-error {
  display: block;
  margin-top: 0.35rem;
  color: #b91c1c;
  font-size: 0.78rem;
  font-family: "IBM Plex Mono", monospace;
}

.field-error[hidden] {
  display: none !important;
}

input[type="range"] {
  padding: 0;
  border: 0;
  background: transparent;
}

.toggle-line {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.toggle-line input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
}

.muted-inline {
  color: var(--muted);
  font-size: 0.78rem;
  font-family: "IBM Plex Mono", monospace;
}

.topic-actions {
  display: flex;
  gap: 0.5rem;
}

.topic-actions button {
  flex: 1;
}

.link-button {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0.35rem 0;
  color: #111;
  text-decoration: underline;
  text-align: center;
}

.recover-box {
  display: grid;
  gap: 0.35rem;
  padding-top: 0.2rem;
}

.recover-box button {
  width: 100%;
  padding: 0.62rem 0.72rem;
  font-size: 0.82rem;
}

.recover-box p {
  min-height: 1rem;
  margin: 0;
}

.auth-helper-box {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.75rem;
  padding: 0.75rem;
  border: 1px solid rgba(20, 20, 20, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(16px);
}

.auth-helper-box p {
  margin: 0;
}

.auth-helper-box .link-button {
  justify-self: start;
  text-align: left;
  padding-left: 0;
}

.auth-helper-box input {
  width: 100%;
}

.auth-helper-box[hidden] {
  display: none !important;
}

.export-actions button {
  padding: 0.62rem 0.72rem;
  font-size: 0.82rem;
}

button {
  font: inherit;
  border-radius: 0.7rem;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0.75rem 0.9rem;
  cursor: pointer;
}

#start-btn {
  background: #111;
  color: #fff;
}

#auth-submit-btn,
#login-btn {
  background: #111;
  border-color: #111;
  color: #fff;
}

.admin-panel {
  padding: 1rem;
  position: fixed;
  top: 4.8rem;
  right: 0.75rem;
  width: min(92vw, 360px);
  max-height: calc(100vh - 6rem);
  overflow: auto;
  backdrop-filter: blur(12px);
  transform: translateX(115%);
  transition: transform 0.24s ease;
  z-index: 10120;
  pointer-events: auto;
  isolation: isolate;
}

.admin-panel.open {
  transform: translateX(0);
  z-index: 10130;
}

.settings-panel {
  width: min(92vw, 420px);
}

.settings-panel.open {
  transform: translateX(0);
}

.panel-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.panel-headline h2,
.admin-panel h2 {
  margin: 0;
}

.panel-close-x {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  min-width: 28px;
  font-size: 0.85rem;
  cursor: pointer;
  color: #a0a0b8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.12s;
  padding: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.panel-close-x:hover { background: rgba(255,255,255,0.14); color: #fff; }

.panel-close {
  display: none;
  padding: 0.45rem 0.65rem;
  font-size: 0.78rem;
}

.panel-close-bottom {
  display: block;
  width: 100%;
  margin-top: 1.5rem;
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
  text-align: center;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.panel-close-bottom:hover {
  background: var(--surface2);
  color: var(--fg);
}

.auth-session {
  display: grid;
  gap: 0.75rem;
}

.auth-session p {
  margin: 0;
  color: var(--muted);
}

.auth-session button {
  background: #111;
  border-color: #111;
  color: #fff;
}

.admin-config[hidden],
.user-list[hidden],
.auth-session[hidden],
#auth-email-label[hidden],
#auth-form[hidden] {
  display: none;
}

.password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.password-wrap input {
  width: 100%;
  padding-right: 2.2rem;
}
.password-eye {
  position: absolute;
  right: 0.4rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0.1rem 0.2rem;
  color: var(--muted);
  opacity: 0.7;
}
.password-eye:hover { opacity: 1; }

.auth-login-mode #auth-email-label {
  display: none;
}

.viewer-panel {
  position: fixed;
  top: 4.8rem;
  right: 1.2rem;
  z-index: 10120;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 8px;
  width: min(88vw, 360px);
  height: calc(100vh - 6rem);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  transform: translateX(calc(100% + 1.6rem));
  transition: transform 0.24s ease;
  pointer-events: auto;
  isolation: isolate;
}

/* Explicit row assignments so layout is correct regardless of panel visibility */
.viewer-head     { grid-row: 1; }
.chat-vote-panel { grid-row: 2; }
.viewer-messages { grid-row: 3; }
.viewer-form     { grid-row: 4; }

.poll-chat-card {
  align-self: center;
  width: min(92%, 420px);
  border: 1.5px solid rgba(38, 134, 232, 0.25);
  border-radius: 10px;
  background: rgba(240, 246, 255, 0.82);
  padding: 0.6rem 0.7rem 0.65rem;
  box-shadow: 0 2px 10px rgba(38, 134, 232, 0.08);
}

.poll-chat-card-label {
  font-size: 0.68rem;
  font-family: "IBM Plex Mono", monospace;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 0.45rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.poll-chat-card-timer {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.62rem;
}

.inline-poll {
  display: grid;
  gap: 0.22rem;
}

.inline-poll-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
  padding: 0.32rem 0.48rem;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-size: 0.78rem;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
  width: 100%;
}

.inline-poll-option:hover:not(:disabled) {
  background: #f0f4ff;
  border-color: rgba(20, 20, 20, 0.28);
}

.inline-poll-option:disabled {
  opacity: 0.7;
  cursor: default;
}

.inline-poll-option.voted {
  background: rgba(38, 134, 232, 0.1);
  border-color: rgba(38, 134, 232, 0.4);
  font-weight: 600;
}

.inline-poll-option.leading:not(.voted) {
  background: rgba(34, 168, 111, 0.08);
  border-color: rgba(34, 168, 111, 0.35);
}

.inline-poll-votes {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.6rem;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.poll-login-hint {
  margin: 0.25rem 0 0;
  font-size: 0.64rem;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
}

.chat-vote-panel {
  display: none;
  border-bottom: 1px solid var(--line);
  padding: 0.5rem 0.7rem 0.55rem;
  background: rgba(255, 255, 255, 0.6);
}

.chat-vote-panel.visible {
  display: block;
}

.chat-vote-label {
  margin: 0 0 0.38rem;
  font-size: 0.66rem;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.chat-vote-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.28rem;
}

.chat-vote-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  min-width: 0;
}

.chat-vote-model-name {
  font-size: 0.56rem;
  font-family: "IBM Plex Mono", monospace;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  text-align: center;
}

.chat-vote-btn {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.6rem;
  line-height: 1.35;
  padding: 0.18rem 0.2rem;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  width: 100%;
  text-align: center;
  transition: background 0.15s;
}

.chat-vote-btn:hover:not(:disabled) {
  background: #f4f4f4;
}

.chat-vote-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.chat-vote-btn.voted {
  background: rgba(20, 20, 20, 0.07);
  border-color: rgba(20, 20, 20, 0.3);
  font-weight: 700;
}

.chat-vote-bar-track {
  width: 100%;
  height: 2px;
  background: rgba(20, 20, 20, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.chat-vote-bar-fill {
  height: 100%;
  background: rgba(20, 20, 20, 0.38);
  transition: width 0.4s ease;
}

.viewer-open .viewer-panel {
  transform: translateX(0);
}

.viewer-head {
  border-bottom: 1px solid var(--line);
  padding: 0.75rem;
}

.viewer-head-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.viewer-head h2 {
  margin: 0;
  font-size: 1rem;
}

.viewer-head p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.xp-bar-container {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.4rem;
  flex-wrap: wrap;
}

.xp-level {
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.xp-bar-track {
  flex: 1;
  height: 5px;
  background: rgba(20,20,20,0.1);
  border-radius: 3px;
  min-width: 40px;
}

.xp-bar-track.urgence { animation: urgencePulse 1s ease-in-out infinite; }
@keyframes urgencePulse { 0%,100% { box-shadow: 0 0 0 0 rgba(230,126,34,0); } 50% { box-shadow: 0 0 0 3px rgba(230,126,34,0.3); } }

.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #22a86f, #f39f32);
  border-radius: 3px;
  transition: width 0.6s ease;
}

.xp-bar-track.urgence .xp-bar-fill { background: linear-gradient(90deg, #e67e22, #f1c40f); }

.xp-label {
  font-size: 0.68rem;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  white-space: nowrap;
}

.xp-rival { font-size: 0.68rem; color: #6c47d8; font-family: "IBM Plex Mono", monospace; font-weight: 600; }
.xp-joker { font-size: 0.68rem; color: #2980b9; font-family: "IBM Plex Mono", monospace; }
.msg-level-badge { display: inline-flex; align-items: center; gap: 0.15rem; font-size: 0.7rem; margin-left: 0.2rem; vertical-align: middle; background: rgba(0,0,0,0.06); border-radius: 4px; padding: 0.05rem 0.3rem; }
.msg-level-badge em { font-style: normal; color: var(--muted); font-size: 0.68rem; }

.viewer-count {
  font-size: 0.68rem;
  font-family: "IBM Plex Mono", monospace;
  color: var(--muted);
  background: rgba(20,20,20,0.06);
  border-radius: 12px;
  padding: 0.15rem 0.5rem;
  white-space: nowrap;
}

.viewer-messages {
  min-height: 0;
  overflow: auto;
  padding: 0.75rem;
  display: grid;
  align-content: start;
  gap: 0.55rem;
}

.viewer-message {
  display: grid;
  gap: 0.1rem;
  border-bottom: 1px solid rgba(20, 20, 20, 0.08);
  padding-bottom: 0.45rem;
  font-size: 0.86rem;
}

.viewer-message strong {
  color: #111;
}

.viewer-message.admin-message {
  border: 1px solid rgba(17, 17, 17, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  padding: 0.45rem;
}

.viewer-message.admin-message strong {
  color: #b45309;
}

.viewer-message.mod-message {
  border: 1px solid rgba(108, 71, 216, 0.25);
  border-radius: 8px;
  background: rgba(108, 71, 216, 0.06);
  padding: 0.45rem;
}

.viewer-message.mod-message strong {
  color: #6c47d8;
}

.mod-badge { font-size: 0.78rem; margin-left: 0.2rem; vertical-align: middle; }

.viewer-message span {
  color: var(--muted);
}

.viewer-form {
  display: flex;
  gap: 0.4rem;
  border-top: 1px solid var(--line);
  padding: 0.35rem;
}

.viewer-form input {
  min-width: 0;
  flex: 1;
  padding: 0.42rem 0.55rem;
  border-radius: 0.48rem;
  font-size: 16px;
}

.viewer-form button {
  flex: 0 0 auto;
  min-width: 96px;
  padding: 0.42rem 0.55rem;
  border-radius: 0.48rem;
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: visible;
  background: #111;
  border-color: #111;
  color: #fff;
}

.viewer-form button:disabled {
  background: #d8d8d8;
  border-color: #c8c8c8;
  color: #333;
}

.user-list {
  display: grid;
  gap: 0.45rem;
}

.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem;
  font-size: 0.85rem;
}

.user-row-info {
  flex: 1;
  min-width: 0;
}

.user-row-title {
  font-weight: 600;
  color: var(--ink);
  min-width: 0;
}

.user-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.5rem;
  margin-top: 0.2rem;
  font-size: 0.72rem;
  color: var(--muted);
}

.user-presence {
  font-weight: 700;
}

.user-presence.connected {
  color: #15803d;
}

.user-presence.offline {
  color: #6b7280;
}

.user-row-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.mod-btn { background: none; border: 1px solid var(--border); border-radius: 6px; padding: 0.2rem 0.4rem; font-size: 0.78rem; cursor: pointer; color: var(--muted); transition: all 0.12s; }
.mod-btn.active { background: rgba(108,71,216,0.12); border-color: #6c47d8; color: #6c47d8; font-weight: 700; }
.mod-btn:hover { border-color: #6c47d8; color: #6c47d8; }
.msg-hide-btn { background: none; border: none; cursor: pointer; font-size: 0.78rem; color: var(--muted); padding: 0.1rem 0.2rem; border-radius: 4px; transition: color 0.12s; }
.msg-hide-btn:hover { color: #dc2626; }

.live-mode {
  background: #111;
}

.live-mode .bg-grid {
  display: none;
}

.live-mode .topbar {
  position: static;
  z-index: 20;
  padding: 0;
}

.live-mode .brand {
  display: none;
}

.live-mode .layout {
  grid-template-columns: minmax(0, 1fr);
  width: min(100vw, 840px);
  height: 100dvh;
  margin: 0 auto;
  padding: 0.45rem;
}

.live-mode .archive-panel {
  position: fixed;
  top: 4.8rem;
  left: 0.75rem;
  width: min(86vw, 340px);
  height: calc(100dvh - 5.6rem);
  border-radius: 8px;
  box-shadow: none;
  padding: 0.55rem;
}

.live-mode .archive-head h2 {
  font-size: 0.82rem;
}

.live-mode .archive-item {
  padding: 0.48rem 0.5rem;
}

.live-mode .arc-topic {
  font-size: 0.72rem;
}

.live-mode .arc-meta {
  font-size: 0.58rem;
}

.live-mode .arc-badge {
  font-size: 0.56rem;
  padding: 0.12rem 0.32rem;
}

.live-mode .arc-quote,
.live-mode .arc-summary {
  display: none;
}

.live-mode .viewer-panel {
  position: fixed;
  top: 4.8rem;
  right: 0.75rem;
  width: min(86vw, 360px);
  height: calc(100dvh - 5.6rem);
  display: grid;
  grid-template-rows: auto auto 1fr auto;
}

.live-mode .chat-panel {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: linear-gradient(180deg, #e8f4f2 0%, #f7f7f1 52%, #f2ecdf 100%);
  padding: 0.55rem;
  gap: 0.5rem;
}

.live-mode .chat-head {
  background: rgba(255, 255, 255, 0.88);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
}

.live-mode .chat-head-label {
  font-size: 0.68rem;
}

.live-mode .chat-head h2 {
  font-size: 1rem;
  line-height: 1.15;
}

.live-mode .scoreboard {
  gap: 0.28rem;
  margin-top: 0.42rem;
  font-size: 0.62rem;
}

.live-mode .scoreboard span {
  padding: 0.18rem 0.28rem;
}

.live-mode .avatar-strip {
  margin-top: 0.42rem;
}

.live-mode .avatar {
  grid-template-columns: auto;
  justify-items: center;
  gap: 0.18rem;
  padding: 0.3rem 0.22rem;
}

.live-mode .vote-btn {
  font-size: 0.52rem;
}

.live-mode .vote-bar-track {
  height: 2px;
}

.live-mode .avatar-face {
  width: 1.7rem;
  height: 1.7rem;
  font-size: 0.68rem;
}

.live-mode .avatar-emoji {
  font-size: 0.92rem;
}

.live-mode .avatar-name {
  font-size: 0.62rem;
}

.live-mode .avatar-mood {
  max-width: 4.6rem;
  font-size: 0.56rem;
}

.live-mode .duel-card {
  margin-top: 0.38rem;
  padding: 0.42rem 0.5rem;
  border-radius: 8px;
}

.live-mode .duel-card strong {
  font-size: 0.62rem;
}

.live-mode .duel-card span {
  font-size: 0.74rem;
}

.live-mode .chat-frame {
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
}

.live-mode .chat-log {
  padding: 0.55rem;
  gap: 0.55rem;
}

.live-mode .bubble {
  max-width: 96%;
  border-radius: 8px;
  padding: 0.62rem;
  font-size: 0.92rem;
}

.live-mode .meta {
  gap: 0.35rem;
  margin-bottom: 0.26rem;
  font-size: 0.62rem;
  flex-wrap: wrap;
}

.live-mode .reaction-note {
  max-width: 94%;
  padding: 0.36rem 0.5rem;
  font-size: 0.68rem;
  background: rgba(255, 255, 255, 0.78);
}

.live-mode .admin-panel {
  z-index: 10120;
  top: 4.8rem;
}

.live-mode .admin-panel.open {
  z-index: 10130;
}

.muted {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0.3rem 0 0.9rem;
}

.profiles {
  display: grid;
  gap: 0.8rem;
}

.profile-card {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  padding: 0.75rem;
  display: grid;
  gap: 0.55rem;
}

.profile-card h3 {
  margin: 0;
  font-size: 1rem;
}

label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.86rem;
}

select {
  padding: 0.6rem;
  border-radius: 0.6rem;
  border: 1px solid var(--line);
  background: #fff;
  font-family: inherit;
  font-size: 16px;
}

@media (max-width: 700px) {
  /* ── Masquer titre, fond quadrillé — plein écran mobile ─────────────────── */
  .brand { display: none; }
  .bg-grid { display: none; }
  .topbar { padding: 0; }

  body {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .layout {
    grid-template-columns: 1fr;
    height: 100vh;
    padding: 0;
  }

  .chat-panel {
    padding: 0;
    gap: 0.3rem;
    border-radius: 0;
    border: none;
    box-shadow: none;
    background: transparent;
    width: 100%;
  }

  .chat-head {
    border: none;
    border-radius: 0;
    background: transparent;
    padding: 0.5rem 0.75rem 0.3rem;
  }

  .chat-frame {
    border: none;
    border-radius: 0;
    background: transparent;
  }

  .chat-log {
    padding: 0.4rem 0.6rem;
    gap: 0.4rem;
    -webkit-overflow-scrolling: touch;
  }

  /* ── Taille réduite des bulles sur mobile ─────────────────────────────────── */
  .chat-head h2 {
    font-size: 0.88rem;
    margin: 0.1rem 0 0;
  }

  .scoreboard {
    font-size: 0.6rem;
    gap: 0.25rem;
    margin-top: 0.35rem;
  }

  .scoreboard span {
    padding: 0.15rem 0.3rem;
  }

  .bubble {
    padding: 0.45rem 0.6rem;
    border-radius: 0.7rem;
    max-width: 92%;
  }

  .bubble p {
    font-size: 0.8rem;
    line-height: 1.38;
  }

  .meta {
    font-size: 0.6rem;
    margin-bottom: 0.15rem;
    gap: 0.4rem;
  }

  /* ── Avatars ──────────────────────────────────────────────────────────────── */
  .avatar-strip-track {
    width: 250%;
  }

  .avatar {
    grid-template-columns: auto;
    justify-items: center;
    gap: 0.18rem;
    padding: 0.3rem 0.22rem;
  }

  .avatar-face {
    width: 1.7rem;
    height: 1.7rem;
    font-size: 0.68rem;
  }

  .avatar-name { font-size: 0.62rem; }
  .avatar-mood { max-width: 4.6rem; font-size: 0.56rem; }
  .vote-section { grid-column: 1; }

  .archive-panel {
    top: 4.4rem;
    left: 0.5rem;
    width: min(92vw, 340px);
    height: calc(100vh - 5.2rem);
  }

  .viewer-panel {
    top: 4.4rem;
    right: 0.5rem;
    width: min(92vw, 360px);
    height: calc(100vh - 5.2rem);
  }

  body:not(.menu-open).panel-modal-open .panel-toggles {
    opacity: 0;
    pointer-events: none;
  }

  .viewer-form {
    display: grid;
    grid-template-columns: 1fr;
  }

  .viewer-form button {
    width: 100%;
    min-width: 0;
  }

  .admin-panel {
    top: 4.4rem;
    right: 0.5rem;
    z-index: 10120;
    width: min(92vw, 360px);
    height: calc(100dvh - 5.2rem);
    max-height: calc(100dvh - 5.2rem);
    border-radius: 8px;
    border: 1px solid var(--line);
    padding: 0.85rem;
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
    transform: translateX(calc(100% + 1.6rem));
  }

  .admin-panel.open {
    transform: translateX(0);
    z-index: 10130;
  }

  .settings-panel {
    width: min(92vw, 420px);
  }

  .panel-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .topic-actions {
    display: grid;
  }

  .chat-panel {
    min-height: 72vh;
    height: auto;
  }

  .live-mode {
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
  }

  .live-mode .layout {
    grid-template-columns: 1fr;
    width: 100vw;
    height: 100dvh;
    padding: 0.35rem;
  }

  .live-mode .archive-panel {
    left: 0.5rem;
    width: min(94vw, 340px);
    height: calc(100dvh - 5.2rem);
    padding: 0.4rem;
  }

  .live-mode .archive-list {
    display: grid;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .live-mode .archive-item {
    min-width: 0;
  }

  .live-mode .chat-panel {
    height: 100%;
    min-height: 0;
  }

  .live-mode .viewer-panel {
    right: 0.5rem;
    width: min(94vw, 360px);
    height: calc(100dvh - 5.2rem);
    min-height: 0;
  }

  .live-mode .admin-panel {
    top: 4.4rem;
    right: 0.5rem;
    z-index: 10120;
    width: min(94vw, 360px);
    height: calc(100dvh - 5.2rem);
    max-height: calc(100dvh - 5.2rem);
    border-radius: 8px;
  }

  .live-mode .settings-panel {
    width: min(94vw, 420px);
  }

  .live-mode .viewer-head {
    padding: 0.45rem 0.55rem;
  }

  .live-mode .viewer-messages {
    height: auto;
    padding: 0.45rem 0.55rem;
    gap: 0.35rem;
  }

  .live-mode .viewer-message {
    font-size: 0.78rem;
  }

  .live-mode .viewer-form {
    padding: 0.28rem;
    gap: 0.28rem;
    display: grid;
    grid-template-columns: 1fr;
  }

  .live-mode .viewer-form input,
  .live-mode .viewer-form button {
    padding: 0.34rem 0.46rem;
    border-radius: 0.42rem;
  }

  .live-mode .viewer-form input {
    font-size: 16px;
  }

  .live-mode .viewer-form button {
    width: 100%;
    min-width: 0;
    font-size: 0.76rem;
  }

  .live-mode .icon-btn {
    width: 2.1rem;
    height: 2.1rem;
    font-size: 0.95rem;
  }

  .live-mode .admin-panel input,
  .live-mode .admin-panel select,
  .live-mode .admin-panel button {
    min-height: 42px;
  }
}

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

@keyframes popIn {
  from {
    transform: scale(0.96) translateY(6px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

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

@keyframes avatarTicker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes avatarPulse {
  0%,
  100% {
    filter: saturate(1);
  }
  50% {
    filter: saturate(1.3);
  }
}

/* ── Welcome popup ─────────────────────────────────────────────────────────── */

.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 10500;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity 0.6s ease;
}
.intro-overlay[hidden] {
  display: none !important;
}
.intro-overlay.hiding {
  opacity: 0;
  pointer-events: none;
}
body:not(.intro-gone) .menu-toggle,
body:not(.intro-gone) .panel-toggles {
  pointer-events: none;
}
.intro-overlay.gone {
  display: none;
  pointer-events: none;
}
.intro-gif {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
}
.intro-skip {
  position: absolute;
  bottom: max(1rem, env(safe-area-inset-bottom, 0px) + 0.6rem);
  right: 1rem;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.22);
  color: rgba(255,255,255,0.75);
  padding: 0.28rem 0.65rem;
  border-radius: 12px;
  font-size: 0.7rem;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background 0.2s, color 0.2s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.intro-skip:hover { background: rgba(255,255,255,0.2); color: #fff; }

/* ── Level-up animation ─────────────────────────────────────────────────────── */
.levelup-overlay {
  position: fixed; inset: 0; z-index: 9500;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #f4f2f1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.levelup-overlay[hidden] { display: none; }
.levelup-overlay.visible { opacity: 1; }
.levelup-overlay.hiding  { opacity: 0; }

.levelup-gif {
  width: min(380px, 80vw);
  height: auto;
}

.levelup-name {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: #111;
  margin-top: 1rem;
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s 0.3s ease, transform 0.4s 0.3s ease;
}
.levelup-overlay.visible .levelup-name { opacity: 1; transform: none; }

.levelup-right {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.9rem;
  color: rgba(0,0,0,0.6);
  margin-top: 0.5rem;
  text-align: center;
  max-width: 320px;
  line-height: 1.5;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s 0.5s ease, transform 0.4s 0.5s ease;
}
.levelup-overlay.visible .levelup-right { opacity: 1; transform: none; }

.welcome-overlay[hidden] {
  display: none !important;
}

.welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 10110;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(10, 12, 18, 0.72);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.welcome-overlay.visible {
  opacity: 1;
}

.welcome-overlay.hiding {
  opacity: 0;
  pointer-events: none;
}

.welcome-modal {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 20px;
  padding: 2.2rem 2rem 1.8rem;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 32px 80px rgba(0,0,0,0.28), 0 0 0 1px rgba(20,20,20,0.06);
  transform: translateY(18px);
  transition: transform 0.35s cubic-bezier(.22,1,.36,1);
}

.welcome-overlay.visible .welcome-modal {
  transform: translateY(0);
}

.welcome-glow {
  position: absolute;
  top: -60px;
  right: -60px;
  width: 200px;
  height: 200px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(34,168,111,0.18) 0%, transparent 70%);
  pointer-events: none;
}

.welcome-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  font-family: "IBM Plex Mono", monospace;
  letter-spacing: 0.08em;
  border-radius: 6px;
  padding: 0.18rem 0.5rem;
  margin-bottom: 0.9rem;
}

.welcome-badge::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  animation: livePulse 1.2s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.7); }
}

.welcome-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.55rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
  color: var(--ink);
  line-height: 1.2;
}

.welcome-sub {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 1.4rem;
  line-height: 1.5;
}

.welcome-steps {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-bottom: 1.6rem;
}

.welcome-step {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.ws-icon {
  font-size: 1.3rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 0.05rem;
}

.welcome-step div {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.welcome-step strong {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
}

.welcome-step span {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
}

.welcome-step em {
  color: var(--ink);
  font-style: normal;
  font-weight: 600;
}

.welcome-btn {
  width: 100%;
  padding: 0.8rem 1rem;
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, transform 0.12s;
}

.welcome-btn:hover {
  background: #2a2a2a;
  transform: translateY(-1px);
}

.welcome-btn:active {
  transform: translateY(0);
}

.welcome-hint {
  text-align: center;
  font-size: 0.72rem;
  color: rgba(87,89,95,0.55);
  margin: 0.65rem 0 0;
  font-family: "IBM Plex Mono", monospace;
}

/* ── Guide button inside welcome modal ── */
.welcome-guide-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  margin-top: 0.6rem;
  padding: 0.6rem 1rem;
  background: transparent;
  color: var(--accent, #2686e8);
  border: 1.5px solid rgba(38,134,232,0.35);
  border-radius: 12px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  letter-spacing: 0.01em;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}
.welcome-guide-btn:hover {
  background: rgba(38,134,232,0.08);
  border-color: rgba(38,134,232,0.6);
}

.welcome-notif-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  margin-top: 0.6rem;
  padding: 0.65rem 1rem;
  background: rgba(38,134,232,0.10);
  color: var(--accent, #2686e8);
  border: 1.5px solid rgba(38,134,232,0.4);
  border-radius: 12px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
}
.welcome-notif-btn:hover { background: rgba(38,134,232,0.18); border-color: rgba(38,134,232,0.7); }
.welcome-notif-btn.active { background: rgba(34,168,111,0.12); border-color: rgba(34,168,111,0.5); color: #22a86f; }
.welcome-notif-btn:disabled { opacity: 0.45; cursor: default; }

.panel-toggle--notif { font-size: 0.82rem; padding: 0.35rem 0.75rem; }
.panel-toggle--notif.notif-active { color: #2686e8; }
.panel-toggle--alert { border-color: #e67e22 !important; color: #e67e22 !important; animation: alertPulse 1.8s ease-in-out infinite; }
@keyframes alertPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(230,126,34,0); } 50% { box-shadow: 0 0 0 3px rgba(230,126,34,0.3); } }

/* iOS install prompt */
.ios-install-prompt {
  position: fixed;
  bottom: 1.2rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  z-index: 9200;
  background: #1a1a2e;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.45);
  max-width: min(92vw, 380px);
  width: max-content;
  transition: transform 0.35s cubic-bezier(0.34,1.36,0.64,1);
  pointer-events: all;
}
.ios-install-prompt.show { transform: translateX(-50%) translateY(0); }
.ios-install-icon { font-size: 1.6rem; flex-shrink: 0; }
.ios-install-text { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.82rem; line-height: 1.35; }
.ios-install-text strong:first-child { font-size: 0.88rem; }
.ios-install-close { background: rgba(255,255,255,0.1); border: none; color: #ccc; border-radius: 50%; width: 44px; height: 44px; min-width: 44px; cursor: pointer; font-size: 1rem; flex-shrink: 0; display: flex; align-items: center; justify-content: center; margin-left: 0.5rem; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.ios-install-close:hover, .ios-install-close:active { background: rgba(255,255,255,0.22); color: #fff; }

/* Niveaux dans le popup */
.welcome-levels {
  margin: 1rem 0 0.5rem;
  background: rgba(20,20,30,0.04);
  border-radius: 10px;
  padding: 0.75rem 0.9rem 0.6rem;
  border: 1px solid rgba(20,20,30,0.08);
}
.welcome-levels-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 0.55rem;
  font-family: "IBM Plex Mono", monospace;
}
.welcome-level-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.welcome-level-list li {
  display: grid;
  grid-template-columns: 1.6rem 1fr auto;
  grid-template-rows: auto auto;
  align-items: baseline;
  column-gap: 0.4rem;
  row-gap: 0.05rem;
  font-size: 0.78rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(20,20,30,0.06);
}
.welcome-level-list li:last-child { border-bottom: none; }
.wl-emoji { font-size: 1rem; grid-row: 1 / 3; align-self: center; }
.wl-name { font-weight: 700; color: var(--ink); }
.wl-xp { font-family: "IBM Plex Mono", monospace; font-size: 0.65rem; color: var(--muted); white-space: nowrap; }
.wl-perk { grid-column: 2 / 4; font-size: 0.72rem; color: #444; font-weight: 500; }
.wl-desc { grid-column: 2 / 4; font-size: 0.66rem; color: var(--muted); line-height: 1.4; margin-top: 0.05rem; }
.welcome-xp-hint {
  margin: 0.6rem 0 0;
  font-size: 0.68rem;
  font-family: "IBM Plex Mono", monospace;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 480px) {
  .wl-desc { display: none; }
}

@media (max-width: 480px) {
  .welcome-modal {
    padding: 1.6rem 1.3rem 1.4rem;
  }
  .welcome-title {
    font-size: 1.3rem;
  }
}

/* XP gain flash */
.xp-flash {
  position: fixed;
  bottom: 8rem;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--ink);
  color: #fff;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
  z-index: 8000;
}
.xp-flash.xp-flash-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Streak toast */
.streak-toast {
  position: fixed;
  bottom: 5.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: linear-gradient(135deg, #ff6b00, #ff9a00);
  color: #fff;
  font-family: "IBM Plex Mono", monospace;
  border-radius: 14px;
  padding: 0.7rem 1.1rem 0.65rem 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  z-index: 8100;
  box-shadow: 0 4px 18px rgba(255,107,0,0.45);
  max-width: 92vw;
}
.streak-toast.streak-toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.streak-toast-flames {
  font-size: 1.4rem;
  line-height: 1;
  animation: streak-flame-pulse 0.6s ease-in-out infinite alternate;
}
@keyframes streak-flame-pulse {
  from { transform: scale(1); }
  to   { transform: scale(1.2) rotate(-5deg); }
}
.streak-toast-count {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1;
}
.streak-toast-label {
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 0.9;
  line-height: 1.2;
}
.streak-toast-sub {
  font-size: 0.65rem;
  opacity: 0.85;
  border-left: 1px solid rgba(255,255,255,0.4);
  padding-left: 0.45rem;
  margin-left: 0.1rem;
  line-height: 1.3;
}
.streak-toast-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0 0 0 0.3rem;
  margin-left: auto;
  line-height: 1;
}
.streak-toast-close:hover { color: #fff; }

/* Pièces XP volantes */
@keyframes xp-coin-fly {
  0%   { opacity: 1; transform: translate(0, 0) scale(1); }
  60%  { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--drift, 0px), -90px) scale(0.5); }
}
.xp-coin {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  font-size: 1.1rem;
  color: #f5c842;
  text-shadow: 0 0 6px rgba(245,200,66,0.8);
  animation: xp-coin-fly 0.85s ease-out forwards;
  line-height: 1;
}
.xp-coin.mission-coin {
  font-size: 2rem;
  animation-duration: 1.1s;
}

/* Panneau statistiques admin */
.stats-panel { margin: 1.2rem 0; }
.stats-panel h3 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 0.6rem; }
.admin-stats { font-size: 0.78rem; }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  margin-bottom: 0.7rem;
}
.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 0.3rem;
  background: rgba(20,20,40,0.04);
  border-radius: 8px;
  border: 1px solid rgba(20,20,40,0.08);
}
.stat-val { font-size: 1.2rem; font-weight: 700; font-family: "IBM Plex Mono", monospace; line-height: 1.1; }
.stat-lbl { font-size: 0.6rem; color: var(--muted); text-align: center; margin-top: 0.15rem; }
.stat-bars {
  display: flex;
  align-items: flex-end;
  gap: 0.25rem;
  height: 80px;
  padding: 1.1rem 0.2rem 0;
  border-bottom: 1px solid rgba(20,20,40,0.1);
  position: relative;
}
.stat-bar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  position: relative;
}
.stat-bar-count {
  font-size: 0.6rem;
  font-weight: 700;
  font-family: "IBM Plex Mono", monospace;
  color: #5050bb;
  margin-bottom: 0.15rem;
  line-height: 1;
}
.stat-bar-fill {
  width: 100%;
  background: linear-gradient(180deg, #6060cc, #a0a0ee);
  border-radius: 2px 2px 0 0;
  min-height: 3px;
  transition: height 0.4s ease;
}
.stat-bar-label { font-size: 0.55rem; color: var(--muted); margin-top: 0.2rem; }

.stat-section-title { font-size: 0.72rem; font-weight: 700; color: var(--muted); margin: 0.9rem 0 0.4rem; text-transform: uppercase; letter-spacing: 0.04em; }
.stat-ref-list { display: flex; flex-direction: column; gap: 0.3rem; }
.stat-ref-row { display: grid; grid-template-columns: 6.5rem 1fr 2rem; align-items: center; gap: 0.4rem; }
.stat-ref-label { font-size: 0.72rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-ref-bar-wrap { height: 10px; background: rgba(0,0,0,0.07); border-radius: 5px; overflow: hidden; }
.stat-ref-bar-fill { height: 100%; border-radius: 5px; transition: width 0.4s ease; min-width: 3px; }
.stat-ref-count { font-size: 0.68rem; font-weight: 700; font-family: "IBM Plex Mono", monospace; color: var(--muted); text-align: right; }
.stat-ref-empty { font-size: 0.72rem; color: var(--muted); margin: 0.2rem 0; font-style: italic; }

/* Reply preview au-dessus de l'input */
.reply-preview {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.6rem;
  background: rgba(100,100,220,0.08);
  border-left: 2px solid #6060cc;
  font-size: 0.74rem;
  flex-wrap: wrap;
}
.reply-preview-label { font-weight: 700; color: #5050bb; white-space: nowrap; }
.reply-preview-text { color: var(--muted); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-cancel-btn {
  background: none; border: none; cursor: pointer; color: var(--muted); font-size: 0.8rem; padding: 0 0.2rem; line-height: 1;
}
.reply-cancel-btn:hover { color: var(--ink); }

/* Bouton reply */
.reply-btn {
  background: none; border: none; cursor: pointer; color: var(--muted);
  font-size: 0.78rem; padding: 0.1rem 0.3rem; border-radius: 4px; line-height: 1;
  transition: background 0.12s, color 0.12s;
}
.reply-btn:hover { background: rgba(100,100,220,0.1); color: #5050bb; }

/* Actions groupées (like + reply) */
.bubble-actions { display: flex; align-items: center; gap: 0.2rem; margin-top: 0.3rem; }
.msg-actions { display: flex; align-items: center; gap: 0.2rem; justify-self: start; }

/* Contexte de réponse dans les bulles */
.bubble-reply-context {
  font-size: 0.68rem; color: #5050bb; margin-bottom: 0.25rem;
  font-family: "IBM Plex Mono", monospace;
}
.msg-reply-context {
  font-size: 0.68rem; color: #5050bb; margin-bottom: 0.15rem;
  font-family: "IBM Plex Mono", monospace;
}
.msg-reply-context em { color: var(--muted); font-style: normal; }

/* Panneau cartes spéciales */
.card-panel {
  padding: 0.7rem 0.8rem 0.6rem;
  background: #fffbf0;
}
.card-panel-floating {
  position: fixed;
  top: 3.6rem;
  right: 1rem;
  z-index: 10135;
  width: 300px;
  border: 1px solid rgba(20,20,20,0.12);
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.18);
  pointer-events: auto;
  isolation: isolate;
}
.power-block { border-top: 1px solid rgba(0,0,0,0.07); padding: 0.55rem 0 0.3rem; margin-top: 0.3rem; }
.power-block:first-of-type { border-top: none; margin-top: 0; padding-top: 0; }
.power-label { font-size: 0.8rem; font-weight: 700; color: var(--ink); margin: 0 0 0.15rem; }
.power-hint { font-size: 0.75rem; color: var(--muted); margin: 0.1rem 0 0; }
.power-hint.used { color: #c07000; }
.power-badge { font-size: 0.68rem; font-weight: 400; background: #f0e8ff; color: #7040c0; border-radius: 4px; padding: 0 0.3rem; margin-left: 0.3rem; }
.power-btn { font-size: 0.78rem; padding: 0.3rem 0.6rem; border-radius: 6px; background: var(--accent); color: #fff; border: none; cursor: pointer; white-space: nowrap; }
.power-btn.danger { background: #c0392b; }
.power-btn:hover { opacity: 0.88; }
.power-status { font-size: 0.72rem; margin: 0.25rem 0 0; min-height: 1em; }

.card-panel-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  margin: 0 0 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: "IBM Plex Mono", monospace;
}
.card-cooldown-timer {
  font-weight: 400;
  color: #c07000;
  font-size: 0.68rem;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.3rem;
}
.card-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  background: #fff;
  border: 1px solid rgba(20,20,20,0.12);
  border-radius: 8px;
  padding: 0.4rem 0.3rem;
  cursor: pointer;
  font-size: 0.65rem;
  color: var(--ink);
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  text-align: center;
  line-height: 1.2;
  position: relative;
}
.card-btn:hover:not([disabled]) { background: #fff7e0; border-color: #f0b940; transform: translateY(-1px); }
.card-btn:active:not([disabled]) { transform: translateY(0); }
.card-btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.card-icon { font-size: 1.1rem; }
.card-name { font-size: 0.6rem; color: var(--muted); }
.card-btn.card-gifted { border: 2px solid #f0b940; background: #fffbee; box-shadow: 0 0 0 2px rgba(240,185,64,0.25); position: relative; }
.card-btn.card-gifted:hover:not([disabled]) { background: #fff3cc; border-color: #e09900; }
.card-btn.card-locked { opacity: 0.38; position: relative; }
.card-gift-tag { font-size: 0.7rem; position: absolute; top: 2px; right: 3px; }
.card-lock-icon { font-size: 0.65rem; position: absolute; top: 2px; right: 3px; }
.card-gifted-badge { font-size: 0.65rem; background: #f0b940; color: #5a3a00; border-radius: 6px; padding: 1px 6px; margin-left: 6px; font-weight: 600; vertical-align: middle; }

/* XP privilege badge */
.xp-privilege {
  width: 100%;
  font-size: 0.68rem;
  color: #6c6c8a;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  background: rgba(100,100,200,0.08);
  font-family: "IBM Plex Mono", monospace;
}
.xp-privilege.used { color: var(--muted); background: none; text-decoration: line-through; }
.xp-privilege.active { color: #22a86f; background: rgba(34,168,111,0.1); }
.xp-privilege.gold { color: #c59b00; background: rgba(197,155,0,0.1); }

/* XP notification dans TokTok */
.xp-notification {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.6rem;
  margin: 0.25rem 0;
  background: linear-gradient(90deg, rgba(34,168,111,0.12), rgba(243,159,50,0.08));
  border-left: 2px solid #22a86f;
  border-radius: 0 6px 6px 0;
  font-size: 0.72rem;
  transition: opacity 1.5s ease;
}
.xp-notification.xp-notif-fade { opacity: 0.35; }
.xp-notif-badge {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 700;
  color: #22a86f;
  white-space: nowrap;
}
.xp-notif-detail { color: var(--muted); }

/* Bouton like */
.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.72rem;
  color: var(--muted);
  padding: 0.15rem 0.35rem;
  border-radius: 20px;
  transition: background 0.15s, color 0.15s;
  margin-top: 0.3rem;
  line-height: 1;
}
.like-btn:hover { background: rgba(100,100,200,0.1); color: var(--ink); }
.like-btn.liked { color: #e05c5c; }
.like-btn.liked .like-icon { filter: none; }
.like-icon { font-size: 0.8rem; }
.like-count { font-family: "IBM Plex Mono", monospace; font-size: 0.68rem; }

/* Like wrap + aimé par */
.like-wrap { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 0.15rem; }
.liked-by {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.6rem;
  color: var(--muted);
  line-height: 1.2;
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Like sur bulles IA */
.bubble .like-wrap { margin-top: 0.35rem; }
.bubble .like-btn { display: flex; }

/* Like sur messages TokTok */
.viewer-message .like-wrap { justify-self: start; margin-top: 0.1rem; }
.viewer-message .like-btn { margin-top: 0; }

/* ─── Missions panel (floating via .card-panel-floating) ──────────────────── */
.mission-item { display: flex; align-items: center; gap: 0.4rem; padding: 0.3rem 0; border-bottom: 1px solid rgba(20,20,20,0.05); }
.mission-item:last-child { border-bottom: none; }
.mission-item.done { opacity: 0.5; }
.mission-icon { font-size: 1rem; flex-shrink: 0; }
.mission-info { flex: 1; min-width: 0; }
.mission-name { font-size: 0.75rem; font-weight: 600; display: block; }
.mission-desc { font-size: 0.65rem; color: var(--muted); display: block; }
.mission-prog { font-size: 0.65rem; color: #22a86f; font-family: monospace; }
.mission-xp { font-family: "IBM Plex Mono", monospace; font-size: 0.72rem; font-weight: 700; color: #22a86f; flex-shrink: 0; }
.mission-item.done .mission-xp { color: var(--muted); }

/* ─── Mission complete banner ──────────────────────────────────────────────── */
.mission-jackpot { position: fixed; top: 7.5rem; left: 50%; transform: translateX(-50%) scale(0.8); z-index: 8600; background: linear-gradient(135deg,#f39c12,#e67e22); color:#fff; border-radius: 12px; padding: 0.55rem 1.1rem; font-weight: 700; font-size: 0.9rem; box-shadow: 0 6px 24px rgba(230,126,34,0.5); opacity: 0; transition: opacity 0.25s, transform 0.25s; pointer-events: none; white-space: nowrap; }
.mission-jackpot.jackpot { background: linear-gradient(135deg,#e74c3c,#c0392b); box-shadow: 0 6px 32px rgba(231,76,60,0.6); font-size: 1rem; }
.mission-jackpot.show { opacity: 1; transform: translateX(-50%) scale(1); }

/* ── Retournement animation ── */
@keyframes retournement-spin {
  0%   { transform: rotate(0deg) scale(1); }
  40%  { transform: rotate(200deg) scale(1.3); }
  70%  { transform: rotate(340deg) scale(1.1); }
  100% { transform: rotate(360deg) scale(1); }
}
/* ─── Daily Spin Wheel ──────────────────────────────────────────────────────── */
.spin-overlay {
  position: fixed; inset: 0; z-index: 9300;
  background:
    radial-gradient(circle at 18% 20%, rgba(38,134,232,0.14), transparent 32%),
    radial-gradient(circle at 82% 78%, rgba(243,159,50,0.18), transparent 30%),
    rgba(244, 241, 232, 0.52);
  backdrop-filter: blur(14px) saturate(1.1);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  opacity: 0; transition: opacity 0.3s;
  pointer-events: none;
}
.spin-overlay.visible { opacity: 1; pointer-events: auto; }

.spin-reminder {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 10140;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(20,27,45,0.82);
  color: #fff;
  backdrop-filter: blur(14px);
  border-radius: 999px;
  padding: 0.7rem 0.95rem;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0,0,0,0.28);
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.12s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.spin-reminder-visible .spin-reminder {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.spin-reminder:hover {
  background: rgba(31,45,75,0.9);
}

.spin-modal {
  background: linear-gradient(145deg, rgba(255,255,255,0.88) 0%, rgba(250,246,239,0.94) 100%);
  border: 1px solid rgba(20,20,20,0.08);
  border-radius: 18px;
  padding: 1.5rem 1.5rem 1.8rem;
  max-width: 380px; width: 100%;
  text-align: center;
  position: relative;
  box-shadow: 0 18px 48px rgba(22,30,39,0.16);
  backdrop-filter: blur(18px);
}

.spin-modal::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(135deg, rgba(38,134,232,0.10), transparent 36%),
    linear-gradient(315deg, rgba(243,159,50,0.10), transparent 34%);
  pointer-events: none;
}

.spin-close {
  position: absolute; top: 0.5rem; right: 0.5rem;
  background: rgba(20,20,20,0.05); border: none; color: #666;
  border-radius: 50%; width: 44px; height: 44px;
  cursor: pointer; font-size: 1rem; display: flex; align-items: center; justify-content: center;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.spin-close:hover { background: rgba(20,20,20,0.10); color: #111; }

.spin-tag {
  display: inline-block; background: rgba(38,134,232,0.10); color: #1a6cf6;
  border: 1px solid rgba(38,134,232,0.20); border-radius: 20px;
  font-size: 0.7rem; font-weight: 700; padding: 0.2rem 0.65rem;
  letter-spacing: 0.04em; text-transform: uppercase; margin: 0 0 0.5rem;
}
.spin-title {
  margin: 0 0 0.2rem; font-size: 1.55rem; font-weight: 900; color: #151515;
}
.spin-subtitle {
  margin: 0 0 1.2rem; font-size: 0.82rem; color: rgba(21,21,21,0.58);
}

.spin-wheel-wrap {
  position: relative; display: inline-block;
  margin: 0 auto 1.2rem;
  filter: drop-shadow(0 8px 22px rgba(22,30,39,0.18));
}

.spin-pointer {
  position: absolute; top: -14px; left: 50%;
  transform: translateX(-50%);
  font-size: 1.4rem; line-height: 1;
  color: #151515;
  filter: drop-shadow(0 2px 4px rgba(255,255,255,0.4));
  z-index: 2;
}

#spin-canvas {
  display: block; border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.72);
}

.spin-btn {
  background: linear-gradient(135deg, #2686e8, #1a6cf6);
  color: #fff; border: none; border-radius: 12px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem; font-weight: 800; letter-spacing: 0.06em;
  padding: 0.75rem 2.5rem; cursor: pointer;
  box-shadow: 0 4px 16px rgba(38,134,232,0.4);
  transition: transform 0.12s, box-shadow 0.12s;
}
.spin-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(38,134,232,0.55); }
.spin-btn:disabled { opacity: 0.55; cursor: default; transform: none; }

.spin-result {
  margin-top: 1.1rem; padding: 0.85rem 1rem;
  background: rgba(255,255,255,0.56); border: 1px solid rgba(20,20,20,0.08);
  border-radius: 12px; color: #151515;
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.35s, transform 0.35s;
  font-size: 0.9rem; line-height: 1.45;
}
.spin-result.show { opacity: 1; transform: translateY(0); }
.spin-result-emoji { font-size: 2rem; display: block; margin-bottom: 0.3rem; }
.spin-result p { margin: 0; }
.spin-result strong { color: #fbbf24; }
.spin-result-next {
  margin-top: 0.55rem !important;
  font-size: 0.8rem;
  color: rgba(21,21,21,0.58);
}

@media (max-width: 720px) {
  .spin-reminder {
    right: 0.75rem;
    left: 0.75rem;
    bottom: 0.75rem;
    text-align: center;
  }
}

.retournement-overlay {
  position: fixed; inset: 0; z-index: 9400;
  background: rgba(0,0,0,0.82);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
.retournement-overlay.show { opacity: 1; }
.retournement-inner { text-align: center; }
.retournement-icon {
  font-size: 5rem; line-height: 1;
  animation: retournement-spin 0.9s cubic-bezier(0.34,1.36,0.64,1) forwards;
  display: block;
}
.retournement-title {
  font-size: 2.2rem; font-weight: 900; letter-spacing: -0.02em;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  margin: 0.5rem 0 0.25rem;
}
.retournement-sub {
  font-size: 1rem; color: rgba(255,255,255,0.75); font-weight: 500;
}

.pos-dramatic-overlay { position: fixed; inset: 0; z-index: 9200; background: rgba(0,0,0,0.75); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.3s; pointer-events: none; }
.pos-dramatic-overlay.show { opacity: 1; }
.pos-dramatic-box { text-align: center; }
.pos-dramatic-countdown { font-size: 7rem; font-weight: 900; color: #fff; font-family: "Space Grotesk"; line-height: 1; animation: countdownPop 0.8s ease-in-out; }
@keyframes countdownPop { 0% { transform: scale(0.5); opacity: 0; } 50% { transform: scale(1.2); } 100% { transform: scale(1); opacity: 1; } }

.levelup-toktok { background: linear-gradient(135deg, rgba(108,71,216,0.1), rgba(108,71,216,0.05)); border: 1px solid rgba(108,71,216,0.2); border-radius: 8px; padding: 0.4rem 0.55rem; }

.mission-complete-banner { position: fixed; top: 4rem; left: 50%; transform: translateX(-50%) translateY(-20px); z-index: 8500; background: linear-gradient(135deg, #22a86f, #1a8a58); color: white; border-radius: 12px; padding: 0.7rem 1.2rem; display: flex; align-items: center; gap: 0.6rem; box-shadow: 0 8px 32px rgba(34,168,111,0.4); opacity: 0; transition: opacity 0.3s, transform 0.3s; pointer-events: none; min-width: 240px; }
.mission-complete-banner.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.mission-complete-banner strong { font-size: 0.82rem; display: block; }
.mission-complete-banner p { font-size: 0.72rem; margin: 0; opacity: 0.85; }
.mission-complete-banner span:first-child { font-size: 1.4rem; }
.mission-complete-banner .mission-xp { margin-left: auto; font-size: 0.9rem; font-weight: 700; white-space: nowrap; }

/* ─── Mention badge ────────────────────────────────────────────────────────── */
.mention-badge { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.8); z-index: 9500; background: linear-gradient(135deg, #1a1a2e, #2a1a3e); color: white; border-radius: 16px; padding: 1.2rem 1.6rem; display: flex; align-items: center; gap: 0.8rem; box-shadow: 0 12px 48px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.1); opacity: 0; transition: opacity 0.3s, transform 0.3s; pointer-events: none; max-width: 340px; width: 90%; }
.mention-badge.mention-badge-show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.mention-badge-icon { font-size: 2.2rem; flex-shrink: 0; }
.mention-badge strong { font-size: 0.9rem; display: block; }
.mention-badge p { font-size: 0.75rem; margin: 0.2rem 0 0; opacity: 0.75; font-style: italic; }

/* ─── Share button ─────────────────────────────────────────────────────────── */
.share-btn { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 0.85rem; padding: 0.2rem 0.35rem; border-radius: 4px; transition: background 0.12s, color 0.12s; line-height: 1; display: inline-flex; align-items: center; vertical-align: middle; }
.share-btn:hover { background: rgba(20,20,20,0.08); color: var(--ink); }

/* ─── Share modal ──────────────────────────────────────────────────────────── */
.share-modal-overlay { position: fixed; inset: 0; z-index: 9000; background: rgba(0,0,0,0.72); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.share-modal { background: #16181f; border: 1px solid rgba(255,255,255,0.08); border-radius: 20px; padding: 1.4rem; max-width: 480px; width: 100%; box-shadow: 0 32px 80px rgba(0,0,0,0.6); }
.share-modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.share-modal-title { font-size: 0.92rem; font-weight: 700; margin: 0; color: #f0f0f8; letter-spacing: 0.01em; }
.share-card-preview { border-radius: 12px; overflow: hidden; margin-bottom: 1rem; box-shadow: 0 8px 32px rgba(0,0,0,0.5); }
.share-card-preview canvas { width: 100%; display: block; }
.share-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.share-actions button { flex: 1; padding: 0.6rem 0.9rem; border-radius: 10px; border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.06); color: #d0d0e0; cursor: pointer; font-size: 0.8rem; font-weight: 600; transition: background 0.15s, border-color 0.15s; white-space: nowrap; }
.share-actions button:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.22); }
.share-actions .share-primary { background: linear-gradient(135deg, #5b3fd4, #3b82f6); border-color: transparent; color: #fff; }
.share-actions .share-primary:hover { background: linear-gradient(135deg, #6d52e0, #5096f8); }
.share-modal-close { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); border-radius: 50%; width: 28px; height: 28px; font-size: 0.85rem; cursor: pointer; color: #a0a0b8; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background 0.12s; }
.share-modal-close:hover { background: rgba(255,255,255,0.14); color: #fff; }

/* ─── Streak flame ─────────────────────────────────────────────────────────── */
.streak-flame { font-size: 0.72rem; margin-left: 0.25rem; vertical-align: middle; opacity: 0.9; }

/* ─── Announced topic banner ───────────────────────────────────────────────── */
.announced-topic-banner { display: flex; align-items: center; gap: 0.5rem; background: linear-gradient(90deg,rgba(251,191,36,0.12),rgba(251,191,36,0.04)); border: 1px solid rgba(251,191,36,0.3); border-radius: 10px; padding: 0.55rem 0.8rem; margin: 0 0 0.6rem; font-size: 0.8rem; }

.no-debate-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 3rem 1.5rem; min-height: 60vh; gap: 0.6rem; }
.no-debate-badge { background: rgba(100,100,120,0.12); color: var(--muted); font-size: 0.65rem; font-weight: 700; letter-spacing: 0.1em; border-radius: 20px; padding: 0.25rem 0.75rem; margin-bottom: 0.5rem; }
.no-debate-title { font-size: 1.4rem; font-weight: 700; margin: 0; color: var(--ink); }
.no-debate-sub { font-size: 0.9rem; color: var(--muted); margin: 0 0 1rem; max-width: 320px; }
.no-debate-hint { font-size: 0.82rem; color: var(--muted); font-style: italic; margin: 0; }
.no-debate-schedule { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.2rem; width: 100%; max-width: 380px; text-align: left; margin-top: 0.5rem; }
.no-debate-schedule-label { font-size: 0.72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 0.7rem; }
.no-debate-item { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
.no-debate-item:last-child { border-bottom: none; padding-bottom: 0; }
.no-debate-num { background: var(--ink); color: #fff; font-size: 0.65rem; font-weight: 700; width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 2px; }
.no-debate-topic { font-size: 0.88rem; font-weight: 600; color: var(--ink); margin: 0 0 0.15rem; }
.no-debate-date { font-size: 0.72rem; color: var(--muted); margin: 0; }
.no-debate-refresh { margin-top: 1.2rem; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 0.45rem 1rem; font-size: 0.82rem; cursor: pointer; color: var(--muted); touch-action: manipulation; -webkit-tap-highlight-color: transparent; transition: border-color 0.15s, color 0.15s; }
.no-debate-refresh:hover { border-color: var(--ink); color: var(--ink); }
.ann-icon { font-size: 1.1rem; flex-shrink: 0; }
.ann-text { color: var(--ink); flex: 1; }
.ann-text strong { color: #b45309; }
.ann-when { display: inline-block; background: rgba(251,191,36,0.2); border-radius: 4px; padding: 0.05rem 0.35rem; margin-left: 0.4rem; font-size: 0.74rem; color: #92400e; }

/* ─── Weekly leaderboard ───────────────────────────────────────────────────── */
/* ─── Leaderboard modal ────────────────────────────────────────────────────── */
.leaderboard-overlay { position: fixed; inset: 0; z-index: 10110; background: rgba(0,0,0,0.65); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.leaderboard-overlay[hidden] { display: none !important; }
.leaderboard-modal { background: #fff; border: 1px solid rgba(0,0,0,0.08); border-radius: 20px; padding: 1.4rem; max-width: 420px; width: 100%; box-shadow: 0 24px 64px rgba(0,0,0,0.22); }
.leaderboard-modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.1rem; }
.leaderboard-modal-title { font-size: 1rem; font-weight: 700; margin: 0; color: #111; }
.leaderboard-modal-body { display: flex; flex-direction: column; gap: 0.1rem; }
.lb-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.6rem; border-radius: 10px; font-size: 0.84rem; }
.lb-row:nth-child(odd) { background: #f7f7fa; }
.lb-row.lb-me { background: #eef2ff; outline: 1px solid #c7d2fe; }
.lb-rank { width: 1.6rem; text-align: center; font-size: 1rem; flex-shrink: 0; }
.lb-avatar { font-size: 1rem; flex-shrink: 0; }
.lb-name { flex: 1; font-weight: 600; color: #1a1a2e; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-level { font-size: 0.72rem; color: #888; white-space: nowrap; }
.lb-streak { font-size: 0.7rem; margin-left: 0.2rem; opacity: 0.85; }
.lb-xp { font-size: 0.78rem; font-weight: 700; color: #4f46e5; white-space: nowrap; }
.leaderboard-modal .share-modal-close { background: #f0f0f4; border-color: #e0e0e8; color: #666; }
.leaderboard-modal .share-modal-close:hover { background: #e4e4ec; color: #111; }

/* ─── Admin announce panel ─────────────────────────────────────────────────── */
.announce-panel { border-top: 1px solid var(--border); padding-top: 1rem; margin-top: 1rem; }
.announce-panel h3 { font-size: 0.88rem; font-weight: 700; margin: 0 0 0.3rem; }
.announce-panel input { padding: 0.45rem 0.6rem; border-radius: 7px; border: 1px solid var(--border); background: var(--surface); font-size: 0.8rem; }
.announce-panel button { padding: 0.45rem 0.8rem; border-radius: 7px; border: 1px solid var(--border); background: var(--surface); font-size: 0.8rem; cursor: pointer; white-space: nowrap; }

/* ─── Schedule queue ───────────────────────────────────────────────────────── */
.proposed-topics-list { margin-top: 0.5rem; display: flex; flex-direction: column; gap: 0.4rem; }
.proposed-topic-row { display: flex; flex-direction: column; gap: 0.35rem; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 0.5rem 0.6rem; }
.proposed-topic-meta { display: flex; align-items: flex-start; gap: 0.4rem; flex-wrap: wrap; }
.proposed-topic-author { font-size: 0.72rem; font-weight: 700; color: var(--accent); flex-shrink: 0; }
.proposed-topic-text { font-size: 0.8rem; color: var(--ink); flex: 1; }
.proposed-topic-actions { display: flex; gap: 0.35rem; }

.schedule-queue-list { margin-top: 0.6rem; display: flex; flex-direction: column; gap: 0.3rem; }
.sq-empty { font-size: 0.78rem; color: var(--muted); margin: 0.3rem 0 0; }
.sq-item { display: flex; align-items: center; gap: 0.4rem; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 0.4rem 0.55rem; font-size: 0.78rem; }
.sq-date { flex-shrink: 0; font-size: 0.7rem; color: #b45309; font-weight: 600; white-space: nowrap; }
.sq-topic { flex: 1; color: var(--ink); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sq-actions { display: flex; gap: 0.2rem; flex-shrink: 0; }
.sq-btn { background: none; border: 1px solid var(--border); border-radius: 5px; padding: 0.1rem 0.35rem; font-size: 0.72rem; cursor: pointer; color: var(--muted); transition: background 0.12s; }
.sq-btn:hover { background: rgba(0,0,0,0.06); color: var(--ink); }
.sq-remove:hover { background: #fee2e2; border-color: #fca5a5; color: #dc2626; }

/* ─── Position publique ────────────────────────────────────────────────────── */
.position-panel { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; padding: 0.7rem 0.8rem; margin: 0 0 0.5rem; }
.pos-title { font-size: 0.78rem; font-weight: 700; margin: 0 0 0.5rem; color: var(--ink); }
.pos-btns { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; }
.pos-btn { flex: 1; padding: 0.45rem 0.5rem; border-radius: 8px; border: 2px solid transparent; font-size: 0.82rem; font-weight: 700; cursor: pointer; transition: all 0.15s; }
.pos-pour { background: #dcfce7; color: #15803d; border-color: #86efac; }
.pos-pour:hover { background: #bbf7d0; }
.pos-contre { background: #fee2e2; color: #dc2626; border-color: #fca5a5; }
.pos-contre:hover { background: #fecaca; }
.pos-chosen { font-size: 0.82rem; margin-bottom: 0.5rem; color: var(--ink); }
.pos-login-hint { font-size: 0.74rem; color: var(--muted); margin: 0 0 0.4rem; }
.pos-bar { display: flex; height: 22px; border-radius: 6px; overflow: hidden; gap: 2px; margin-bottom: 0.25rem; }
.pos-bar-pour { background: #22c55e; display: flex; align-items: center; justify-content: center; transition: width 0.4s ease; min-width: 0; }
.pos-bar-contre { background: #ef4444; display: flex; align-items: center; justify-content: center; transition: width 0.4s ease; min-width: 0; }
.pos-bar-pour span, .pos-bar-contre span { font-size: 0.7rem; color: #fff; font-weight: 700; padding: 0 4px; white-space: nowrap; overflow: hidden; }
.pos-labels { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--muted); }
.pos-result { border-radius: 8px; padding: 0.6rem; text-align: center; }
.pos-result.pos-won { background: #fefce8; border: 1px solid #fde68a; }
.pos-result.pos-lost { background: #fef2f2; border: 1px solid #fecaca; }
.pos-result.pos-nul { background: #f8fafc; border: 1px solid #e2e8f0; }
.pos-result-title { font-weight: 700; margin: 0 0 0.2rem; font-size: 0.88rem; }
.pos-result-label { margin: 0; font-size: 0.78rem; color: var(--muted); }
.pos-result-stats { margin: 0.2rem 0 0; font-size: 0.72rem; color: var(--muted); }
.pos-bonus { color: #15803d; font-weight: 700; font-size: 0.82rem; margin: 0.3rem 0 0; }

/* ─── Position reveal overlay ──────────────────────────────────────────────── */
.pos-reveal-overlay { position: fixed; inset: 0; z-index: 9500; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.55); backdrop-filter: blur(4px); animation: fadeIn 0.3s ease; }
.pos-reveal-card { background: #fff; border-radius: 24px; padding: 2rem 2.2rem; max-width: 340px; width: 90%; text-align: center; box-shadow: 0 32px 80px rgba(0,0,0,0.3); }
.pos-reveal-card.pos-reveal-won { border-top: 4px solid #22c55e; }
.pos-reveal-card.pos-reveal-lost { border-top: 4px solid #ef4444; }
.pos-reveal-card.pos-reveal-nul { border-top: 4px solid #94a3b8; }
.pos-reveal-emoji { font-size: 3rem; margin-bottom: 0.5rem; }
.pos-reveal-title { font-size: 1.3rem; font-weight: 800; margin: 0 0 0.4rem; }
.pos-reveal-label { color: #555; margin: 0 0 0.3rem; }
.pos-reveal-stats { font-size: 0.82rem; color: #888; margin: 0 0 0.5rem; }
.pos-reveal-bonus { color: #15803d; font-weight: 700; font-size: 1rem; margin: 0 0 1rem; }
.pos-reveal-close { background: #111; color: #fff; border: none; border-radius: 10px; padding: 0.6rem 1.5rem; font-size: 0.88rem; cursor: pointer; }

/* ─── Slot machine ─────────────────────────────────────────────────────────── */
.slot-overlay {
  position: fixed; inset: 0; z-index: 9300;
  background:
    radial-gradient(circle at 22% 18%, rgba(168,85,247,0.16), transparent 32%),
    radial-gradient(circle at 78% 80%, rgba(234,179,8,0.18), transparent 30%),
    rgba(244,241,232,0.52);
  backdrop-filter: blur(14px) saturate(1.1);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  opacity: 0; transition: opacity 0.3s;
  pointer-events: none;
}
.slot-overlay.visible { opacity: 1; pointer-events: auto; }

.slot-reminder {
  position: fixed;
  right: 1rem;
  bottom: 4rem;
  z-index: 10140;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(100,20,120,0.85);
  color: #fff;
  backdrop-filter: blur(14px);
  border-radius: 999px;
  padding: 0.7rem 0.95rem;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0,0,0,0.28);
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.12s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
body.slot-reminder-visible .slot-reminder {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.slot-reminder:hover { background: rgba(120,30,150,0.92); }

.slot-modal {
  background: linear-gradient(145deg, rgba(255,255,255,0.9) 0%, rgba(250,244,255,0.96) 100%);
  border: 1px solid rgba(20,20,20,0.08);
  border-radius: 18px;
  padding: 1.5rem 1.5rem 1.8rem;
  max-width: 400px; width: 100%;
  text-align: center;
  position: relative;
  box-shadow: 0 18px 48px rgba(22,30,39,0.16);
  backdrop-filter: blur(18px);
  max-height: 90vh; overflow-y: auto;
}
.slot-modal::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(135deg, rgba(168,85,247,0.08), transparent 36%),
    linear-gradient(315deg, rgba(234,179,8,0.08), transparent 34%);
  pointer-events: none;
}

.slot-close {
  position: absolute; top: 0.5rem; right: 0.5rem;
  background: rgba(20,20,20,0.05); border: none; color: #666;
  border-radius: 50%; width: 44px; height: 44px;
  cursor: pointer; font-size: 1rem; display: flex; align-items: center; justify-content: center;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.slot-close:hover { background: rgba(20,20,20,0.10); color: #111; }

.slot-tag {
  display: inline-block; background: rgba(168,85,247,0.10); color: #7c3aed;
  border: 1px solid rgba(168,85,247,0.22); border-radius: 20px;
  font-size: 0.7rem; font-weight: 700; padding: 0.2rem 0.65rem;
  letter-spacing: 0.04em; text-transform: uppercase; margin: 0 0 0.5rem;
}
.slot-title { margin: 0 0 0.2rem; font-size: 1.5rem; font-weight: 900; color: #151515; }
.slot-subtitle { margin: 0 0 1.2rem; font-size: 0.82rem; color: rgba(21,21,21,0.58); }

.slot-machine {
  width: 100%;
  max-width: 340px;
  margin: 0 auto 0.5rem;
}

.slot-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: url('/bandit-manchot.png') center/contain no-repeat;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.35));
}

/* The three reel windows — overlaid on the image's white squares */
/* Window positions (% of 512px image): x=83-190, 193-309, 322-428 / y=193-380 */
.slot-reel {
  position: absolute;
  top: 37.5%;
  height: 35.5%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  overflow: visible;
}
.slot-reel::before, .slot-reel::after { display: none; }

#slot-reel-0 { left: 15.5%; width: 21%; }
#slot-reel-1 { left: 37.7%; width: 22.7%; }
#slot-reel-2 { left: 62.9%; width: 20.7%; }

.reel-display {
  font-size: min(48px, 13vw);
  line-height: 1;
  text-align: center;
  user-select: none;
}
.reel-display.reel-spin {
  animation: reelSpin 0.1s steps(1, end) infinite;
  filter: blur(1.5px);
}
.reel-display.reel-land {
  animation: reelBounce 0.45s cubic-bezier(0.34,1.56,0.64,1);
}
.reel-display.reel-held {
  filter: drop-shadow(0 0 10px #fbbf24);
}

@keyframes reelSpin {
  0%   { transform: translateY(-4px); }
  50%  { transform: translateY(4px); }
  100% { transform: translateY(-4px); }
}
@keyframes reelBounce {
  0%   { transform: scale(1.3) translateY(-6px); opacity: 0.7; }
  60%  { transform: scale(0.92) translateY(2px); opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.slot-hold-row {
  display: flex;
  justify-content: space-around;
  padding: 0 13%;
  margin-top: 0.3rem;
}

.hold-btn {
  background: rgba(251,191,36,0.15);
  border: 1px solid rgba(251,191,36,0.45);
  color: #92400e;
  border-radius: 8px;
  padding: 0.28rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  font-family: "Space Grotesk", sans-serif;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s;
}
.hold-btn:hover { background: rgba(251,191,36,0.28); }
.hold-btn.held { background: rgba(251,191,36,0.35); border-color: #fbbf24; color: #78350f; }
.hold-btn:disabled { opacity: 0.4; cursor: default; }

.slot-paytable {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.7rem;
  justify-content: center;
  margin: 0 0 1rem;
  font-size: 0.72rem;
  color: rgba(21,21,21,0.55);
}

.slot-spin-btn {
  background: linear-gradient(135deg, #c8920a, #f59e0b);
  color: #fff; border: none; border-radius: 12px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem; font-weight: 800; letter-spacing: 0.06em;
  padding: 0.75rem 2.5rem; cursor: pointer;
  box-shadow: 0 4px 16px rgba(245,158,11,0.45);
  transition: transform 0.12s, box-shadow 0.12s;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.slot-spin-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(245,158,11,0.6); }
.slot-spin-btn:disabled { opacity: 0.55; cursor: default; transform: none; }

.slot-result {
  margin-top: 0.8rem; padding: 0.85rem 1rem;
  background: rgba(255,255,255,0.56); border: 1px solid rgba(20,20,20,0.08);
  border-radius: 12px; color: #151515;
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.35s, transform 0.35s;
  font-size: 0.9rem; line-height: 1.45;
}
.slot-result.show { opacity: 1; transform: translateY(0); }
.slot-result strong { color: #b45309; }
.slot-result.win strong { color: #d97706; }
.slot-result-next { margin-top: 0.55rem !important; font-size: 0.8rem; color: rgba(21,21,21,0.55); }

.slot-frame.reel-win {
  animation: winFlash 0.6s ease-out 3;
}
@keyframes winFlash {
  0%,100% { filter: drop-shadow(0 8px 24px rgba(0,0,0,0.35)); }
  50%      { filter: drop-shadow(0 0 28px rgba(251,191,36,0.9)) drop-shadow(0 8px 24px rgba(251,191,36,0.6)); }
}

@media (max-width: 720px) {
  .quiz-modal { width: min(100%, 100vw - 1rem); padding: 1.2rem 1rem 1.1rem; }
  .slot-reminder { right: 0.75rem; left: 0.75rem; bottom: 4rem; text-align: center; }
  .mystery-reminder { right: 0.75rem; left: 0.75rem; bottom: 25rem; text-align: center; }
  .quiz-reminder { right: 0.75rem; left: 0.75rem; bottom: 21.5rem; text-align: center; }
  .scratch-reminder { right: 0.75rem; left: 0.75rem; bottom: 14.5rem; text-align: center; }
  .chest-reminder { right: 0.75rem; left: 0.75rem; bottom: 18rem; text-align: center; }
  .reel-display { font-size: min(44px, 12vw); }
}

/* ─── Black Jack ───────────────────────────────────────────────────────────── */
.bj-overlay {
  position: fixed; inset: 0; z-index: 9300;
  background:
    radial-gradient(circle at 20% 20%, rgba(34,197,94,0.14), transparent 32%),
    radial-gradient(circle at 80% 80%, rgba(16,185,129,0.12), transparent 30%),
    rgba(240,253,244,0.6);
  backdrop-filter: blur(14px) saturate(1.1);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  opacity: 0; transition: opacity 0.3s;
  pointer-events: none;
}
.bj-overlay.visible { opacity: 1; pointer-events: auto; }

.dice-reminder {
  position: fixed;
  right: 1rem; bottom: 11rem;
  z-index: 10140;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(30,50,130,0.88);
  color: #fff;
  backdrop-filter: blur(14px);
  border-radius: 999px;
  padding: 0.7rem 0.95rem;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.84rem; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0,0,0,0.28);
  opacity: 0; transform: translateY(16px); pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
body.dice-reminder-visible .dice-reminder { opacity: 1; transform: translateY(0); pointer-events: auto; }
.dice-reminder:hover { background: rgba(45,70,180,0.92); }

.mystery-reminder,
.quiz-reminder,
.scratch-reminder,
.chest-reminder {
  position: fixed;
  right: 1rem;
  z-index: 10145;
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
  backdrop-filter: blur(14px);
  border-radius: 999px;
  padding: 0.7rem 0.95rem;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0,0,0,0.28);
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.mystery-reminder {
  bottom: 25rem;
  background: rgba(86, 34, 138, 0.9);
}
body.mystery-reminder-visible .mystery-reminder {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.mystery-reminder:hover { background: rgba(104, 44, 164, 0.94); }

.quiz-reminder {
  bottom: 21.5rem;
  background: rgba(29, 130, 128, 0.9);
}
body.quiz-reminder-visible .quiz-reminder {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.quiz-reminder:hover { background: rgba(34, 150, 148, 0.94); }

.scratch-reminder {
  bottom: 14.5rem;
  background: rgba(175, 45, 120, 0.88);
}
body.scratch-reminder-visible .scratch-reminder {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.scratch-reminder:hover { background: rgba(198, 54, 137, 0.92); }

.chest-reminder {
  bottom: 18rem;
  background: rgba(180, 120, 20, 0.9);
}
body.chest-reminder-visible .chest-reminder {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.chest-reminder:hover { background: rgba(208, 145, 34, 0.94); }

.mystery-overlay,
.quiz-overlay,
.scratch-overlay,
.chest-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.mystery-overlay {
  z-index: 9470;
  background:
    radial-gradient(circle at 20% 20%, rgba(166,104,255,0.18), transparent 35%),
    radial-gradient(circle at 80% 80%, rgba(255,189,87,0.14), transparent 35%),
    rgba(21,10,35,0.74);
  backdrop-filter: blur(14px);
}

.quiz-overlay {
  z-index: 9460;
  background:
    radial-gradient(circle at 20% 20%, rgba(60,210,190,0.16), transparent 35%),
    radial-gradient(circle at 80% 80%, rgba(70,140,255,0.14), transparent 35%),
    rgba(10,26,34,0.72);
  backdrop-filter: blur(14px);
}

.scratch-overlay {
  z-index: 9450;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,94,170,0.18), transparent 35%),
    radial-gradient(circle at 80% 80%, rgba(255,174,0,0.12), transparent 35%),
    rgba(35,10,35,0.72);
  backdrop-filter: blur(14px);
}

.chest-overlay {
  z-index: 9440;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,211,107,0.18), transparent 35%),
    radial-gradient(circle at 80% 80%, rgba(255,164,28,0.14), transparent 35%),
    rgba(32,20,8,0.68);
  backdrop-filter: blur(14px);
}

.mystery-overlay.visible,
.quiz-overlay.visible,
.scratch-overlay.visible,
.chest-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.mystery-modal,
.quiz-modal,
.scratch-modal,
.chest-modal {
  width: min(100%, 430px);
  border-radius: 20px;
  padding: 1.5rem 1.35rem 1.45rem;
  text-align: center;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.mystery-modal {
  background: linear-gradient(160deg, #2f134f 0%, #5f1a7d 100%);
  border: 1px solid rgba(244,220,255,0.14);
  box-shadow: 0 18px 48px rgba(28,8,42,0.56);
}

.quiz-modal {
  background: linear-gradient(160deg, #0f3d48 0%, #135c69 100%);
  border: 1px solid rgba(190,255,247,0.14);
  box-shadow: 0 18px 48px rgba(8,34,38,0.55);
}

.scratch-modal {
  background: linear-gradient(160deg, #38123a 0%, #7a1954 100%);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 18px 48px rgba(40,8,35,0.55);
}

.chest-modal {
  background: linear-gradient(160deg, #4a2f0d 0%, #9a6012 100%);
  border: 1px solid rgba(255,231,173,0.16);
  box-shadow: 0 18px 48px rgba(48,26,6,0.5);
}

.mystery-close,
.quiz-close,
.scratch-close,
.chest-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(255,255,255,0.08);
  border: none;
  color: rgba(255,255,255,0.7);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mystery-tag,
.quiz-tag,
.scratch-tag,
.chest-tag {
  margin: 0 0 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.72);
}

.mystery-title,
.quiz-title,
.scratch-title,
.chest-title {
  margin: 0 0 0.6rem;
  font-size: 1.55rem;
  font-weight: 800;
  color: #fff;
}

.mystery-subtitle,
.quiz-subtitle,
.scratch-subtitle,
.chest-subtitle {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: rgba(255,255,255,0.82);
}

.mystery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.mystery-card {
  aspect-ratio: 0.72;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.16);
  background:
    radial-gradient(circle at 50% 15%, rgba(255,255,255,0.18), transparent 26%),
    linear-gradient(160deg, rgba(255,255,255,0.14), rgba(255,255,255,0.05)),
    linear-gradient(135deg, rgba(172,102,255,0.25), rgba(255,194,92,0.12));
  color: #fff;
  min-height: 122px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.mystery-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.24);
  border-color: rgba(255,255,255,0.24);
}

.mystery-card.revealed {
  background: linear-gradient(160deg, rgba(255,240,199,0.22), rgba(255,255,255,0.08));
}

.mystery-card.picked {
  border-color: rgba(255,230,150,0.5);
  box-shadow: 0 0 0 2px rgba(255,230,150,0.2), 0 12px 28px rgba(0,0,0,0.28);
}

.mystery-card-back {
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mystery-card-face {
  font-size: 2rem;
}

.mystery-card-label {
  font-size: 0.76rem;
  font-weight: 700;
  text-align: center;
  padding: 0 0.45rem;
}

.mystery-result {
  padding: 0.95rem 1rem;
  border-radius: 14px;
  background: rgba(255,255,255,0.12);
  color: #f8ecff;
  border: 1px solid rgba(255,255,255,0.14);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.mystery-result.show {
  opacity: 1;
  transform: translateY(0);
}

.mystery-result strong {
  display: block;
  font-size: 1rem;
}

.mystery-result span {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  opacity: 0.88;
}

.quiz-body {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.quiz-question {
  text-align: left;
  border-radius: 16px;
  padding: 0.9rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
}

.quiz-question-label {
  margin: 0 0 0.25rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(221,255,249,0.74);
}

.quiz-question-title {
  margin: 0 0 0.75rem;
  color: #fff;
  font-size: 1rem;
  line-height: 1.35;
}

.quiz-options {
  display: grid;
  gap: 0.55rem;
}

.quiz-option,
.quiz-submit-btn {
  border-radius: 12px;
  font-family: "Space Grotesk", sans-serif;
}

.quiz-option {
  text-align: left;
  padding: 0.78rem 0.9rem;
  font-weight: 600;
  color: #eefdfb;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.quiz-option:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,0.12);
}

.quiz-option.selected {
  background: rgba(118, 255, 228, 0.18);
  border-color: rgba(118, 255, 228, 0.4);
}

.quiz-submit-btn {
  width: 100%;
  padding: 0.9rem 1rem;
  font-size: 0.96rem;
  font-weight: 800;
  color: #07343b;
  background: linear-gradient(135deg, #9bfff1, #5bd3ff);
  border: none;
  box-shadow: 0 12px 28px rgba(78,192,218,0.25);
  cursor: pointer;
}

.quiz-submit-btn:disabled {
  opacity: 0.5;
  cursor: default;
  box-shadow: none;
}

.quiz-result {
  margin-top: 0.9rem;
  padding: 0.95rem 1rem;
  border-radius: 14px;
  background: rgba(255,255,255,0.1);
  color: #eefdfb;
  border: 1px solid rgba(255,255,255,0.14);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.quiz-result.show {
  opacity: 1;
  transform: translateY(0);
}

.quiz-result.score-3 {
  background: rgba(255,210,90,0.18);
  border-color: rgba(255,230,150,0.28);
  color: #fff6d7;
}

.quiz-result strong {
  display: block;
  font-size: 1rem;
}

.quiz-result span {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.82rem;
  opacity: 0.9;
}

.quiz-result-list {
  list-style: none;
  margin: 0.85rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.quiz-result-list li {
  font-size: 0.78rem;
  line-height: 1.35;
  color: rgba(240,255,252,0.88);
}

.quiz-result-list li.good {
  color: #d9fff1;
}

.quiz-result-list li.bad {
  color: #ffd9d9;
}

.quiz-result-list li span {
  margin-top: 0.08rem;
  font-size: 0.76rem;
  opacity: 0.78;
}

.scratch-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.9rem;
}

.scratch-tile {
  aspect-ratio: 1;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.16);
  background: linear-gradient(145deg, rgba(255,220,235,0.22), rgba(255,255,255,0.08));
  color: #fff;
  position: relative;
  overflow: hidden;
  min-height: 82px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  --scratch-reveal: 0;
}

.scratch-tile:not(.revealed):hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0,0,0,0.18);
}

.scratch-tile .scratch-cover,
.scratch-tile .scratch-symbol {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scratch-cover {
  z-index: 2;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: transparent;
  transition: opacity 0.22s ease;
}

.scratch-cover-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 14px;
}

.scratch-cover-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: 0 1px 2px rgba(0,0,0,0.15);
  opacity: max(0, calc(1 - (var(--scratch-reveal) * 2.2)));
  transition: opacity 0.14s ease;
  pointer-events: none;
}

.scratch-symbol {
  font-size: 2rem;
  opacity: calc(var(--scratch-reveal) * 1.15);
  transform: scale(calc(0.82 + (var(--scratch-reveal) * 0.18)));
  transition: opacity 0.12s linear, transform 0.12s ease;
  z-index: 1;
}

.scratch-tile.revealed .scratch-cover {
  opacity: 0;
}

.scratch-tile.revealed .scratch-symbol {
  opacity: 1;
  transform: scale(1);
}

.scratch-progress {
  margin: 0 0 0.8rem;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.78);
  font-family: "IBM Plex Mono", monospace;
}

.scratch-result,
.chest-result {
  padding: 0.9rem 1rem;
  border-radius: 14px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.scratch-result.show,
.chest-result.show {
  opacity: 1;
  transform: translateY(0);
}

.scratch-result {
  background: rgba(255,255,255,0.12);
  color: #fff2f7;
  border: 1px solid rgba(255,255,255,0.14);
}

.scratch-result.big-win {
  background: rgba(255,190,85,0.18);
  color: #fff6d8;
  border-color: rgba(255,220,110,0.3);
}

.scratch-result strong,
.chest-result strong {
  display: block;
  font-size: 1rem;
}

.scratch-result span,
.chest-result span {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  opacity: 0.88;
}

.chest-visual {
  position: relative;
  width: min(250px, 72vw);
  margin: 0 auto 1rem;
  min-height: 180px;
}

.chest-visual-image {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 14px 28px rgba(0,0,0,0.28));
  transition: opacity 0.28s ease, transform 0.4s ease, filter 0.28s ease;
}

.chest-visual-closed,
.chest-visual-opened {
  position: absolute;
  inset: 0;
}

.chest-visual-closed {
  opacity: 1;
  transform: scale(1);
}

.chest-visual-opened {
  opacity: 0;
  transform: scale(0.92) translateY(8px);
}

.chest-visual.opened .chest-visual-closed {
  opacity: 0;
  transform: scale(0.95) translateY(10px);
}

.chest-visual.opened .chest-visual-opened {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.chest-visual.gold .chest-visual-image {
  filter:
    drop-shadow(0 0 16px rgba(255,214,102,0.45))
    drop-shadow(0 14px 28px rgba(0,0,0,0.28))
    saturate(1.08)
    brightness(1.04);
}

.chest-visual.opened .chest-visual-opened {
  animation: chestPop 0.45s ease;
}

@keyframes chestPop {
  0% { transform: scale(0.88) translateY(12px); }
  65% { transform: scale(1.04) translateY(-4px); }
  100% { transform: scale(1) translateY(0); }
}

.chest-open-btn {
  background: linear-gradient(135deg, #ffcf54, #f59e0b);
  color: #3c2500;
  border: none;
  border-radius: 12px;
  padding: 0.78rem 1.4rem;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(255,180,0,0.28);
}

.chest-result.bronze {
  background: rgba(255,234,201,0.14);
  color: #fff5dd;
  border: 1px solid rgba(255,224,158,0.18);
}

.chest-result.gold {
  background: rgba(255,224,112,0.2);
  color: #fff7d6;
  border: 1px solid rgba(255,231,142,0.28);
}

.dice-overlay {
  position: fixed; inset: 0; z-index: 9500;
  background:
    radial-gradient(circle at 20% 20%, rgba(30,60,200,0.18), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(100,180,255,0.12), transparent 40%),
    rgba(8,12,35,0.72);
  backdrop-filter: blur(14px);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  opacity: 0; transition: opacity 0.3s;
  pointer-events: none;
}
.dice-overlay.visible { opacity: 1; pointer-events: auto; }

.dice-modal {
  background: linear-gradient(160deg, #0a0f2e 0%, #12205c 100%);
  border: 1px solid rgba(100,140,255,0.20);
  border-radius: 20px;
  padding: 1.5rem 1.5rem 1.6rem;
  max-width: 420px; width: 100%;
  text-align: center;
  position: relative;
  box-shadow: 0 18px 48px rgba(0,0,60,0.55);
  max-height: 90vh; overflow-y: auto;
}

.dice-close {
  position: absolute; top: 0.5rem; right: 0.5rem;
  background: rgba(255,255,255,0.08); border: none; color: rgba(255,255,255,0.6);
  border-radius: 50%; width: 44px; height: 44px;
  cursor: pointer; font-size: 1rem; display: flex; align-items: center; justify-content: center;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.dice-close:hover { background: rgba(255,255,255,0.16); color: #fff; }

.dice-tag {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: rgba(130,160,255,0.7); margin: 0 0 0.3rem;
}
.dice-title { font-size: 1.5rem; font-weight: 800; color: #fff; margin: 0 0 1.2rem; }

.dice-table { margin-bottom: 1rem; }

.dice-row {
  display: flex; justify-content: center; gap: 0.6rem; flex-wrap: nowrap;
  margin-bottom: 0.8rem;
  width: 100%;
}

.die-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  flex: 0 0 62px;
  width: 62px;
  min-width: 62px;
}

.die {
  width: 62px; height: 62px;
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,0.96), rgba(255,255,255,0.82) 42%, rgba(225,232,245,0.98) 100%);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  color: #1a1a2e;
  border: 1px solid rgba(255,255,255,0.88);
  box-shadow:
    0 10px 24px rgba(6,10,20,0.35),
    inset 0 1px 0 rgba(255,255,255,0.95),
    inset 0 -4px 10px rgba(140,155,190,0.18);
  transition: transform 0.18s, box-shadow 0.18s, background 0.18s;
  user-select: none;
  cursor: default;
  position: relative;
  overflow: hidden;
}
.die.held {
  background:
    radial-gradient(circle at 30% 25%, rgba(255,249,219,0.98), rgba(254,230,143,0.95) 45%, rgba(245,191,36,0.92) 100%);
  border-color: rgba(255,228,138,0.98);
  box-shadow:
    0 12px 28px rgba(251,191,36,0.4),
    inset 0 1px 0 rgba(255,255,255,0.92),
    inset 0 -6px 12px rgba(180,120,0,0.18);
  transform: translateY(-3px);
}
.die::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.45);
  pointer-events: none;
}
.die-face {
  width: 40px;
  height: 40px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  place-items: center;
}
.die-pip {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #3f4b65, #101827 72%);
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.12s, transform 0.12s;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.18);
}
.die-pip.show {
  opacity: 1;
  transform: scale(1);
}
.die-placeholder {
  font-size: 1.5rem;
  font-weight: 800;
  color: rgba(26,26,46,0.55);
}
.die.is-empty {
  background: linear-gradient(180deg, rgba(248,250,255,0.75), rgba(219,227,242,0.72));
}
@keyframes dieRoll {
  0%   { transform: rotate(-10deg) scale(0.92) translateY(1px); }
  50%  { transform: rotate(10deg) scale(1.06) translateY(-2px); }
  100% { transform: rotate(-10deg) scale(0.92) translateY(1px); }
}
.die.rolling { animation: dieRoll 0.12s linear infinite; }

.die-hold-btn {
  background: rgba(255,255,255,0.10); border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.75); border-radius: 8px;
  padding: 0.25rem 0.45rem; font-size: 0.65rem; font-weight: 700;
  cursor: pointer; transition: background 0.15s;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  width: 100%;
  min-height: 24px;
  white-space: nowrap;
}
.die-hold-btn.held { background: rgba(251,191,36,0.25); border-color: #fbbf24; color: #fde68a; }
.die-hold-btn:hover { background: rgba(255,255,255,0.18); }
.die-hold-btn[hidden] {
  display: block !important;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.dice-rolls-left {
  font-size: 0.8rem; color: rgba(150,170,255,0.8); margin: 0 0 0.5rem;
}

@media (max-width: 480px) {
  .dice-row {
    gap: 0.35rem;
  }
  .die-wrap {
    flex-basis: 54px;
    width: 54px;
    min-width: 54px;
  }
  .die {
    width: 54px;
    height: 54px;
  }
  .die-face {
    width: 34px;
    height: 34px;
  }
  .die-hold-btn {
    font-size: 0.57rem;
    padding: 0.22rem 0.2rem;
    min-height: 22px;
  }
}

.dice-result {
  padding: 0.7rem 1rem; border-radius: 12px;
  font-weight: 800; font-size: 1.05rem; margin-bottom: 0.6rem;
  opacity: 0; transform: scale(0.9);
  transition: opacity 0.3s, transform 0.3s;
}
.dice-result.show { opacity: 1; transform: scale(1); }
.dice-result.big-win { background: rgba(251,191,36,0.20); color: #fde68a; border: 1px solid rgba(251,191,36,0.35); }
.dice-result.win { background: rgba(52,211,153,0.18); color: #6ee7b7; border: 1px solid rgba(52,211,153,0.3); }
.dice-result.consolation { background: rgba(100,116,139,0.18); color: #94a3b8; border: 1px solid rgba(100,116,139,0.25); }
.dice-result span { display: block; font-size: 0.85rem; margin-top: 0.15rem; opacity: 0.85; }

.dice-actions { display: flex; gap: 0.6rem; justify-content: center; margin-bottom: 0.8rem; flex-wrap: wrap; }

.dice-roll-btn {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff; border: none; border-radius: 12px;
  padding: 0.75rem 1.6rem; font-size: 1rem; font-weight: 700;
  cursor: pointer; transition: transform 0.12s, opacity 0.12s;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 16px rgba(37,99,235,0.45);
}
.dice-roll-btn:hover:not(:disabled) { transform: translateY(-2px); }
.dice-roll-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.dice-score-btn {
  background: linear-gradient(135deg, #059669, #047857);
  color: #fff; border: none; border-radius: 12px;
  padding: 0.75rem 1.4rem; font-size: 1rem; font-weight: 700;
  cursor: pointer; transition: transform 0.12s;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 16px rgba(5,150,105,0.4);
}
.dice-score-btn:hover { transform: translateY(-2px); }

.dice-payinfo {
  font-size: 0.67rem; color: rgba(130,160,255,0.45);
  line-height: 1.5; margin: 0;
}

@media (max-width: 720px) {
  .dice-reminder { right: 0.75rem; left: 0.75rem; bottom: 11rem; text-align: center; }
  .die { font-size: 1.5rem; }
}

.bj-reminder {
  position: fixed;
  right: 1rem; bottom: 7.5rem;
  z-index: 10140;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(20,80,45,0.88);
  color: #fff;
  backdrop-filter: blur(14px);
  border-radius: 999px;
  padding: 0.7rem 0.95rem;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.84rem; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0,0,0,0.28);
  opacity: 0; transform: translateY(16px); pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
body.bj-reminder-visible .bj-reminder { opacity: 1; transform: translateY(0); pointer-events: auto; }
.bj-reminder:hover { background: rgba(20,100,55,0.92); }

.bj-modal {
  background: linear-gradient(160deg, #0d3320 0%, #1a5c30 100%);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 20px;
  padding: 1.4rem 1.4rem 1.6rem;
  max-width: 420px; width: 100%;
  text-align: center;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  max-height: 90vh; overflow-y: auto;
}

.bj-close {
  position: absolute; top: 0.5rem; right: 0.5rem;
  background: rgba(255,255,255,0.08); border: none; color: rgba(255,255,255,0.7);
  border-radius: 50%; width: 40px; height: 40px;
  cursor: pointer; font-size: 1rem; display: flex; align-items: center; justify-content: center;
  touch-action: manipulation;
}
.bj-close:hover { background: rgba(255,255,255,0.16); color: #fff; }

.bj-tag {
  display: inline-block; background: rgba(134,239,172,0.15); color: #86efac;
  border: 1px solid rgba(134,239,172,0.25); border-radius: 20px;
  font-size: 0.7rem; font-weight: 700; padding: 0.2rem 0.65rem;
  letter-spacing: 0.04em; text-transform: uppercase; margin: 0 0 0.4rem;
}
.bj-title { margin: 0 0 1rem; font-size: 1.5rem; font-weight: 900; color: #fff; }

.bj-table {
  background: #0a2e14;
  border: 2px solid rgba(134,239,172,0.2);
  border-radius: 14px;
  padding: 0.9rem;
  margin: 0 0 1rem;
}
.bj-zone { min-height: 90px; }
.bj-zone-label { font-size: 0.75rem; font-weight: 700; color: rgba(134,239,172,0.7); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.5rem; }
.bj-score { color: #fbbf24; font-size: 0.88rem; margin-left: 0.35rem; }
.bj-cards { display: flex; flex-wrap: wrap; gap: 0.45rem; justify-content: center; min-height: 78px; align-items: center; }
.bj-divider { height: 1px; background: rgba(134,239,172,0.15); margin: 0.75rem 0; }

.bj-card {
  width: 52px; height: 74px;
  background: #fff;
  border-radius: 7px;
  border: 1px solid rgba(0,0,0,0.08);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  box-shadow: 0 3px 10px rgba(0,0,0,0.4);
  position: relative;
  animation: cardDeal 0.28s cubic-bezier(0.34,1.36,0.64,1);
  flex-shrink: 0;
}
.bj-card-rank { font-size: 1.1rem; font-weight: 900; line-height: 1; }
.bj-card-suit { font-size: 0.9rem; line-height: 1; margin-top: 1px; }
.bj-card-corner { position: absolute; top: 3px; left: 4px; font-size: 0.6rem; font-weight: 900; line-height: 1; }
.bj-card.red { color: #dc2626; }
.bj-card.black { color: #111; }
.bj-card.back {
  background: repeating-linear-gradient(45deg, #1a3a6e, #1a3a6e 4px, #1e4580 4px, #1e4580 8px);
  border-color: #2a5190;
  color: transparent;
}
@keyframes cardDeal {
  0% { transform: scale(0.6) translateY(-20px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.bj-result {
  margin: 0 0 0.9rem; padding: 0.75rem 1rem;
  border-radius: 12px; font-size: 0.95rem; font-weight: 700;
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.3s, transform 0.3s;
}
.bj-result.show { opacity: 1; transform: translateY(0); }
.bj-result.win   { background: rgba(34,197,94,0.18); color: #86efac; border: 1px solid rgba(34,197,94,0.3); }
.bj-result.lose  { background: rgba(239,68,68,0.18);  color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); }
.bj-result.push  { background: rgba(251,191,36,0.18); color: #fde68a; border: 1px solid rgba(251,191,36,0.3); }

.bj-actions { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; margin-bottom: 0.8rem; }
.bj-btn {
  border: none; border-radius: 10px; padding: 0.65rem 1.3rem;
  font-family: "Space Grotesk", sans-serif; font-size: 0.9rem; font-weight: 700;
  cursor: pointer; transition: transform 0.1s, box-shadow 0.1s;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.bj-btn:disabled { opacity: 0.45; cursor: default; transform: none !important; }
.bj-deal-btn { background: linear-gradient(135deg, #16a34a, #15803d); color: #fff; box-shadow: 0 3px 12px rgba(22,163,74,0.45); }
.bj-deal-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 5px 18px rgba(22,163,74,0.55); }
.bj-hit-btn  { background: linear-gradient(135deg, #2563eb, #1d4ed8); color: #fff; box-shadow: 0 3px 12px rgba(37,99,235,0.4); }
.bj-hit-btn:hover:not(:disabled) { transform: translateY(-2px); }
.bj-stand-btn { background: linear-gradient(135deg, #d97706, #b45309); color: #fff; box-shadow: 0 3px 12px rgba(217,119,6,0.4); }
.bj-stand-btn:hover:not(:disabled) { transform: translateY(-2px); }
.bj-double-btn { background: linear-gradient(135deg, #7c3aed, #6d28d9); color: #fff; box-shadow: 0 3px 12px rgba(124,58,237,0.4); }
.bj-double-btn:hover:not(:disabled) { transform: translateY(-2px); }

.bj-payinfo { font-size: 0.72rem; color: rgba(134,239,172,0.55); margin: 0; }

@media (max-width: 720px) {
  .bj-reminder { right: 0.75rem; left: 0.75rem; bottom: 7.5rem; text-align: center; }
  .bj-card { width: 46px; height: 66px; }
  .bj-card-rank { font-size: 0.95rem; }
}
