@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  touch-action: manipulation;
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

html, body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: #070d1a;
  color: white;
  position: relative;
}

/* ===== BACKGROUND SIMPLIFIÉ ===== */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 70% 40% at 15% 5%, rgba(37,99,235,0.14) 0%, transparent 60%),
    radial-gradient(ellipse 50% 35% at 88% 8%, rgba(234,88,12,0.14) 0%, transparent 55%),
    linear-gradient(160deg, #05091a 0%, #080f22 40%, #0d1525 70%, #111b2e 100%);
}

/* Grid overlay léger */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 38px 38px;
  opacity: 0.4;
}

/* Suppression des orbs animés — trop lourds */
.bg-orb { display: none !important; }
.grain-overlay { display: none !important; }

.hidden { display: none !important; }

/* ===== INTRO OVERLAY ===== */
.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #040810;
  padding: 2vw;
}

.intro-scene {
  width: min(80vw, 100%);
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.intro-hidden {
  opacity: 0;
  transform: scale(0.97);
}

.logo-scene {
  background: linear-gradient(145deg, #060d1e 0%, #0a1428 40%, #111925 65%, #1a0d07 100%);
  border-radius: 2vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6vh 4vw 5vh;
  position: relative;
  overflow: hidden;
  min-height: 65vh;
  border: 1px solid rgba(255,255,255,0.07);
  box-shadow: 0 20px 50px rgba(0,0,0,0.45);
}

.g1 {
  position: absolute;
  top: -80px; left: 50%;
  transform: translateX(-50%);
  width: 500px; height: 280px;
  background: radial-gradient(ellipse, rgba(20,50,160,0.25) 0%, transparent 70%);
  pointer-events: none;
}

.g2 {
  position: absolute;
  bottom: -60px; left: 30%;
  width: 300px; height: 200px;
  background: radial-gradient(ellipse, rgba(200,85,10,0.18) 0%, transparent 70%);
  pointer-events: none;
}

.dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(80,120,220,0.10) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.logo-mark {
  position: relative;
  z-index: 10;
  margin-bottom: 2.5vh;
  animation: logoIn 0.7s cubic-bezier(0.22,1,0.36,1) 0.3s both;
}

@keyframes logoIn {
  from { opacity: 0; transform: translateY(-16px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.wordmark {
  position: relative;
  z-index: 10;
  text-align: center;
  font-family: 'Syne', sans-serif;
  font-size: 4.5vw;
  font-weight: 800;
  letter-spacing: 0.5vw;
  line-height: 1;
  text-transform: uppercase;
  animation: wordmarkIn 0.7s cubic-bezier(0.22,1,0.36,1) 0.5s both;
}

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

.word-under { color: #4f8cff; }
.word-cover { color: #e07a20; }

.sep {
  position: relative;
  z-index: 10;
  width: 16vw; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(79,140,255,0.7), rgba(224,122,32,0.7), transparent);
  margin: 2vh auto 0;
  animation: sepIn 0.5s ease 0.9s both;
}

@keyframes sepIn {
  from { opacity: 0; width: 0; }
  to { opacity: 1; width: 16vw; }
}

.tagline {
  position: relative;
  z-index: 10;
  margin-top: 18px;
  font-size: 11px;
  letter-spacing: 5px;
  color: rgba(255,255,255,0.28);
  text-transform: uppercase;
  font-family: 'DM Sans', sans-serif;
  animation: fadeIn 0.5s ease 1.1s both;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulse-ring {
  0% { r: 38; opacity: 0.5; }
  100% { r: 54; opacity: 0; }
}

.pulse { animation: pulse-ring 2.4s ease-out infinite; }
.pulse2 { animation: pulse-ring 2.4s ease-out 1.2s infinite; }

@media (max-width: 600px) {
  .logo-scene { min-height: 420px; padding: 40px 24px 32px; }
  .wordmark { font-size: 38px; letter-spacing: 4px; }
  .logo-mark svg { width: 100px; height: 100px; }
}

@keyframes scan {
  0%, 100% { transform: translateY(-14px); opacity: 0.6; }
  50% { transform: translateY(14px); opacity: 1; }
}
.scan-line { animation: scan 2.8s ease-in-out infinite; }

/* ===== APP SHELL ===== */
.app-shell {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

/* ===== TOPBAR ===== */
.topbar {
  position: relative;
  z-index: 20;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 4vw;
  margin-bottom: 0.5vw;
  width: 100%;
  padding: 1vw 2vw 0;
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-self: center;
}

.brand-logo-svg {
  width: clamp(28px, 3vw, 56px);
  height: clamp(28px, 3vw, 56px);
  flex-shrink: 0;
}

.brand-logo {
  margin: 0;
  font-family: 'Syne', sans-serif;
  font-size: clamp(18px, 2.2vw, 40px);
  font-weight: 800;
  letter-spacing: 0.25vw;
  line-height: 1;
  text-transform: uppercase;
}

.brand-under { color: #4f8cff; }
.brand-cover { color: #e07a20; }

.topbar-side {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
}

.topbar-left { justify-content: flex-start; }
.topbar-right { justify-content: flex-end; }

.top-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.09);
  box-shadow: 0 3px 12px rgba(0,0,0,0.18);
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.90);
  font-family: 'DM Sans', sans-serif;
}

.top-room-clickable {
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  letter-spacing: 0.5px;
}

.top-room-clickable::after { display: none !important; }

.top-room-clickable:hover {
  background: rgba(79,140,255,0.16) !important;
  border-color: rgba(79,140,255,0.35) !important;
}

.top-room-clickable:active { transform: scale(0.97); }

@keyframes copyFlash {
  0%   { background: rgba(34,197,94,0.28) !important; border-color: rgba(34,197,94,0.55) !important; }
  100% { background: rgba(255,255,255,0.07) !important; border-color: rgba(255,255,255,0.09) !important; }
}

.top-room-clickable.copy-flash { animation: copyFlash 0.9s ease forwards; }
.copy-icon { opacity: 0.5; flex-shrink: 0; transition: opacity 0.15s ease; }
.top-room-clickable:hover .copy-icon { opacity: 0.85; }

.status-banner {
  position: absolute;
  right: 0;
  top: 62px;
  background: rgba(37,99,235,0.93);
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  animation: fadeSlide 0.22s ease;
}

.status-banner.important { background: rgba(22,163,74,0.94); }

.page-center {
  flex: 1 1 auto;
  position: relative;
  z-index: 10;
  width: 100%;
  padding: 2vh 2vw 3vh;
  overflow-y: auto;
  min-height: 0;
}

/* ===== LANDING ===== */
.start-screen { width: 100%; display: block; padding: 2vh 0; overflow-y: auto; max-height: 100%; }

.landing-stack {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2vh;
  padding-bottom: 48px;
}

.landing-header { display: none !important; }
.mobile-tabs { order: 3; }

.logo-free {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
  width: 100%;
}

.logo-free svg {
  position: relative;
  z-index: 1;
  display: block;
  width: 210px; height: 210px;
  animation: logoFloat 7s ease-in-out infinite;
}

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

.landing-cards {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(12px, 1.5vw, 28px);
  align-items: stretch;
}

.login-card, .rules-card {
  min-height: 72vh;
  background: rgba(15,22,42,0.88);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 1.4vw;
  padding: 2.5vh 2.2vw;
  box-shadow: 0 14px 36px rgba(0,0,0,0.32), inset 0 1px 0 rgba(255,255,255,0.05);
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
  animation: cardIn 0.5s cubic-bezier(0.22,1,0.36,1) both;
}

.login-card { animation-delay: 0.1s; }
.rules-card { animation-delay: 0.18s; }

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

.start-content-full { width: 100%; }

.start-content h2, .rules-card h3 {
  margin-top: 0;
  text-align: center;
  font-family: 'Syne', sans-serif;
}

.start-content h2 { margin-bottom: 0.5vw; font-size: 2.2vw; font-weight: 800; letter-spacing: 0.5px; }
.start-subtitle { margin: 0 0 1.4vw; text-align: center; font-size: 1.1vw; opacity: 0.68; }
.rules-card h3 { margin-bottom: 1vw; color: #fdba74; font-size: 1.7vw; font-weight: 700; }

.rules-card ul {
  margin: 0;
  padding-left: 1.2vw;
  display: grid;
  gap: 0.7vw;
  font-size: 1.05vw;
  line-height: 1.55;
  opacity: 0.86;
}

.rules-card li { padding-left: 4px; }
.rules-card li::marker { color: rgba(224,122,32,0.65); }

.form-block { margin-bottom: 1.1vw; }

.form-block label {
  display: block;
  margin-bottom: 0.5vw;
  font-size: 1vw;
  opacity: 0.83;
  font-weight: 500;
}

.separator {
  text-align: center;
  margin: 1vw 0;
  opacity: 0.50;
  font-size: 1vw;
  position: relative;
}

.separator::before, .separator::after {
  content: "";
  position: absolute;
  top: 50%;
  width: calc(50% - 24px);
  height: 1px;
  background: rgba(255,255,255,0.10);
}
.separator::before { left: 0; }
.separator::after { right: 0; }

.join-row { display: grid; grid-template-columns: 1fr 160px; gap: 12px; }

.mobile-tabs {
  display: none;
  width: 100%;
  gap: 10px;
  justify-content: center;
  margin-top: 16px;
  order: 3;
}

.mobile-tab-btn {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.58);
  padding: 10px 22px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: 'DM Sans', sans-serif;
}

.mobile-tab-btn.active {
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  border-color: rgba(255,255,255,0.20);
  color: white;
  box-shadow: 0 3px 12px rgba(59,130,246,0.30);
}

.mobile-tab-btn:hover:not(.active) {
  background: rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.82);
}

/* ===== MOBILE GAME TABS ===== */
.mobile-game-tabs {
  display: none;
  flex-shrink: 0;
  flex-direction: row;
  gap: 6px;
  padding: 6px 8px;
  background: rgba(5,9,20,0.88);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  overflow-x: auto;
  scrollbar-width: none;
}

.mobile-game-tabs::-webkit-scrollbar { display: none; }

.mobile-game-tab {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.09);
  color: rgba(255,255,255,0.62);
  cursor: pointer;
  transition: all 0.15s ease;
}

.mobile-game-tab::after { display: none; }

.mobile-game-tab.active {
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  border-color: rgba(255,255,255,0.18);
  color: white;
  box-shadow: 0 2px 8px rgba(59,130,246,0.28);
}

.mobile-game-tab:hover:not(.active) {
  background: rgba(255,255,255,0.11);
  color: rgba(255,255,255,0.82);
}

.mobile-game-tab.vote-tab {
  background: rgba(249,115,22,0.18);
  border-color: rgba(249,115,22,0.38);
  color: #fdba74;
  animation: voteTabPulse 2s ease-in-out infinite;
}

.mobile-game-tab.vote-tab.active {
  background: linear-gradient(180deg, #f97316, #ea580c);
  border-color: rgba(255,255,255,0.20);
  color: white;
  box-shadow: 0 2px 12px rgba(249,115,22,0.38);
  animation: none;
}

@keyframes voteTabPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(249,115,22,0); }
  50% { box-shadow: 0 0 10px rgba(249,115,22,0.32); }
}

/* ===== SLIDERS ===== */
.duration-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  outline: none;
  padding: 0;
  margin: 10px 0;
  cursor: pointer;
  display: block;
}

.duration-slider::-webkit-slider-runnable-track {
  -webkit-appearance: none;
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
}

.duration-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(37,99,235,0.45);
  border: 2px solid rgba(255,255,255,0.22);
  margin-top: -9px;
}

.duration-slider::-moz-range-track {
  height: 6px; border-radius: 999px;
  background: rgba(255,255,255,0.14); border: none;
}

.duration-slider::-moz-range-thumb {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(37,99,235,0.45);
  border: 2px solid rgba(255,255,255,0.22);
}

/* ===== GAME LAYOUT ===== */
.game-layout {
  width: 100%; height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: 22vw 1fr;
  grid-template-rows: 1fr;
  gap: 1.4vw;
  margin: 0 auto;
  overflow: hidden;
}

.panel { min-height: 0; }

.panel-left {
  display: flex;
  flex-direction: column;
  gap: 1vh;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
  max-height: 100%;
}

.panel-left::-webkit-scrollbar { width: 4px; }
.panel-left::-webkit-scrollbar-track { background: transparent; }
.panel-left::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.10); border-radius: 999px; }

.panel-center { min-height: 0; }

/* ===== CARDS ===== */
.card {
  background: rgba(12,18,38,0.90);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 1.4vw;
  padding: 1.4vh 1.4vw;
  box-shadow: 0 8px 22px rgba(0,0,0,0.24), inset 0 1px 0 rgba(255,255,255,0.04);
  animation: fadeUp 0.25s cubic-bezier(0.22,1,0.36,1);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  pointer-events: none;
}

.compact-card h2 {
  margin-top: 0; margin-bottom: 14px;
  font-family: 'Syne', sans-serif;
  font-size: 16px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; opacity: 0.68;
}

.compact-card label { display: flex; align-items: center; gap: 6px; }
.compact-card label span { color: #4f8cff; font-weight: 700; min-width: 32px; }

.room-card {
  height: 100%; min-height: 0;
  display: flex; flex-direction: column;
  padding-top: 1.5vh; overflow: hidden;
}

.room-actions-bottom {
  margin-top: 1vh;
  display: flex; gap: 0.6vw;
  justify-content: flex-end; flex-wrap: wrap;
}

.room-content {
  flex: 1 1 auto; min-height: 0;
  display: grid; grid-template-columns: 230px 1fr;
  gap: 16px; overflow: hidden;
}

/* ===== VOTE CARD ===== */
.vote-card-active {
  background: rgba(12,6,2,0.92) !important;
  border: 1px solid rgba(249,115,22,0.45) !important;
  box-shadow: 0 8px 28px rgba(194,65,12,0.18), inset 0 1px 0 rgba(249,115,22,0.15) !important;
  animation: voteCardIn 0.30s cubic-bezier(0.22,1,0.36,1) both !important;
}

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

.vote-card-active::before {
  content: "" !important;
  position: absolute !important;
  top: 0; left: 0; right: 0 !important;
  height: 2px !important;
  background: linear-gradient(90deg, transparent, #f97316, #fbbf24, #f97316, transparent) !important;
  background-size: 200% 100% !important;
  animation: voteBarSweep 2.2s linear infinite !important;
  pointer-events: none !important;
}

@keyframes voteBarSweep {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.vote-card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }

.vote-card-header h2 {
  margin: 0 !important; color: #fdba74 !important;
  opacity: 1 !important; font-size: 15px !important;
}

.vote-pulse-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #f97316; flex-shrink: 0;
  box-shadow: 0 0 8px rgba(249,115,22,0.55);
  animation: dotBlink 1.2s ease-in-out infinite;
}

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

/* Players box */
.players-box, .chat-box, .end-box, .waiting-box {
  min-height: 0; display: flex; flex-direction: column;
}

.players-box {
  background: rgba(255,255,255,0.022);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 18px; padding: 14px; overflow: hidden;
}

.players-box h3 {
  margin: 0 0 12px;
  font-family: 'Syne', sans-serif;
  font-size: 13px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase; opacity: 0.58;
}

.players-box ul {
  list-style: none; margin: 0; padding: 0;
  overflow: auto; display: flex; flex-direction: column; gap: 8px;
}

.players-box li {
  padding: 11px 14px; border-radius: 13px;
  background: rgba(8,14,30,0.65);
  border: 1px solid rgba(255,255,255,0.05);
  font-size: 14px; line-height: 1.35;
  transition: background 0.15s ease;
}

.players-box li.player-current {
  border: 1px solid rgba(249,115,22,0.45);
  background: linear-gradient(135deg, rgba(249,115,22,0.10), rgba(37,99,235,0.08));
}

.players-box li .player-name { display: block; font-weight: 600; }
.players-box li .player-sub { display: block; margin-top: 3px; font-size: 12px; opacity: 0.62; font-weight: 500; }

/* Chat + sub areas */
.chat-box, .end-box, .waiting-box {
  background: rgba(255,255,255,0.022);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 18px; padding: 14px; overflow: hidden;
}

/* Waiting */
.waiting-box {
  justify-content: flex-start;
  background: rgba(8,14,30,0.90);
  border: 1px solid rgba(96,165,250,0.18);
}

.waiting-title {
  font-family: 'Syne', sans-serif;
  font-size: 26px; font-weight: 800;
  text-align: center; margin-bottom: 10px;
  text-transform: uppercase; letter-spacing: 3px;
  background: linear-gradient(135deg, #60a5fa, #93c5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.waiting-box p { text-align: center; font-size: 16px; margin-bottom: 18px; opacity: 0.72; }

.waiting-meta {
  display: grid; grid-template-columns: repeat(2, minmax(160px, 1fr)); gap: 10px;
}

.waiting-meta-item {
  padding: 13px 14px; border-radius: 14px;
  background: rgba(8,14,30,0.60);
  border: 1px solid rgba(255,255,255,0.05);
  text-align: center;
  transition: border-color 0.15s;
}

.waiting-meta-item:hover { border-color: rgba(96,165,250,0.22); }

.waiting-meta-label {
  display: block; font-size: 11px; opacity: 0.58;
  margin-bottom: 5px; text-transform: uppercase; letter-spacing: 1px; font-weight: 600;
}

/* End game */
.end-box {
  justify-content: center;
  background: rgba(8,14,30,0.92);
  border: 1px solid rgba(249,115,22,0.20);
}

.end-box h2 {
  font-family: 'Syne', sans-serif;
  font-size: 28px; font-weight: 800; text-align: center; margin-bottom: 10px;
}

.end-box p { text-align: center; font-size: 16px; margin-bottom: 16px; opacity: 0.78; }
.end-box ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; overflow: auto; }

/* Reveal items */
.reveal-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 14px;
  background: rgba(8,14,30,0.65);
  border: 1px solid rgba(255,255,255,0.06);
  animation: revealIn 0.35s cubic-bezier(0.22,1,0.36,1) both;
}

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

.reveal-role-badge {
  padding: 4px 10px; border-radius: 8px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px; flex-shrink: 0;
}

.reveal-role-badge.civil { background: rgba(96,165,250,0.16); color: #93c5fd; border: 1px solid rgba(96,165,250,0.22); }
.reveal-role-badge.undercover { background: rgba(251,146,60,0.16); color: #fdba74; border: 1px solid rgba(251,146,60,0.22); }
.reveal-role-badge.mrwhite { background: rgba(248,250,252,0.10); color: #f1f5f9; border: 1px solid rgba(248,250,252,0.18); }
.reveal-main-text { font-size: 14px; font-weight: 500; opacity: 0.90; }

/* Role dolls */
.role-dolls-wrap {
  margin-bottom: 12px; padding: 12px 14px;
  border-radius: 16px; background: rgba(8,14,30,0.55);
  border: 1px solid rgba(255,255,255,0.05);
}

.role-dolls-title { font-size: 11px; font-weight: 700; opacity: 0.58; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 1.5px; }
.role-dolls { display: flex; flex-wrap: wrap; gap: 10px; }

.role-doll { width: 30px; display: flex; flex-direction: column; align-items: center; gap: 3px; animation: dollIn 0.25s ease both; }

@keyframes dollIn {
  from { opacity: 0; transform: scale(0.6); }
  to { opacity: 1; transform: scale(1); }
}

.role-doll-head { width: 12px; height: 12px; border-radius: 50%; background: currentColor; }
.role-doll-body { width: 18px; height: 14px; border-radius: 9px 9px 6px 6px; background: currentColor; }
.role-doll.civil { color: #60a5fa; }
.role-doll.undercover { color: #fb923c; }
.role-doll.mrwhite { color: #f8fafc; }

/* Messages */
.messages {
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto;
  background: rgba(5,10,24,0.88);
  border-radius: 14px; padding: 12px; margin-bottom: 10px;
  border: 1px solid rgba(255,255,255,0.04);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}

.message {
  padding: 9px 10px; border-radius: 10px; margin-bottom: 4px;
  font-size: 14px; line-height: 1.45;
  animation: msgIn 0.18s ease;
}

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

.message-name { display: inline-block; font-weight: 700; color: #93c5fd; margin-right: 8px; font-size: 13px; }
.message-text { color: rgba(255,255,255,0.90); }
.message.system .message-name { color: #fdba74; }
.message.system .message-text { color: rgba(255,255,255,0.78); }

.chat-top-infos { margin-bottom: 10px; }
.phase-line, .speaker-line { margin: 0 0 5px; }
.phase-line { font-size: 14px; font-weight: 700; opacity: 0.88; font-family: 'Syne', sans-serif; letter-spacing: 0.5px; }
.speaker-line { font-size: 14px; color: #fdba74; font-weight: 600; min-height: 20px; }

/* ===== FORM ELEMENTS ===== */
input, button, select {
  border: none; border-radius: 0.9vw;
  padding: 0.9vh 1vw; font-size: 1vw;
  font-family: 'DM Sans', sans-serif;
}

input, select {
  width: 100%;
  background: rgba(255,255,255,0.90);
  color: #111827;
  transition: background 0.12s ease, box-shadow 0.12s ease;
}

input:focus, select:focus {
  outline: none;
  background: rgba(255,255,255,0.96);
  box-shadow: 0 0 0 2px rgba(79,140,255,0.40);
}

input:disabled, select:disabled {
  background: rgba(148,163,184,0.20);
  color: rgba(255,255,255,0.52);
  cursor: not-allowed;
}

button {
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  color: white; cursor: pointer;
  transition: filter 0.12s ease, transform 0.08s ease, box-shadow 0.12s ease;
  box-shadow: 0 4px 0 rgba(0,0,0,0.26), 0 6px 14px rgba(37,99,235,0.22);
  font-weight: 600; position: relative; overflow: hidden;
}

button::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.10) 0%, transparent 60%);
  pointer-events: none; border-radius: inherit;
}

button:hover { filter: brightness(1.08); }

button:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(0,0,0,0.26), 0 2px 6px rgba(37,99,235,0.18);
}

button:disabled { opacity: 0.42; cursor: not-allowed; box-shadow: none; }

.big-btn { width: 100%; min-height: 52px; font-size: 15px; font-weight: 700; letter-spacing: 0.3px; }

.leave-btn {
  background: linear-gradient(180deg, #4b5563, #374151);
  box-shadow: 0 4px 0 rgba(0,0,0,0.26), 0 6px 14px rgba(0,0,0,0.18);
}

.topbar-leave-btn {
  width: auto; min-height: 38px; padding: 9px 14px;
  border-radius: 12px; font-size: 13px; box-shadow: 0 3px 0 rgba(0,0,0,0.20);
}

.row { display: flex; gap: 8px; align-items: center; }
.player-dead { opacity: 0.42; text-decoration: line-through; }

/* Vote buttons */
.vote-btn {
  display: block; width: 100%; text-align: left; margin-bottom: 8px;
  background: rgba(30,10,2,0.80);
  border: 1px solid rgba(249,115,22,0.18);
  color: rgba(255,255,255,0.86); box-shadow: none;
  transition: all 0.15s ease; font-size: 14px; font-weight: 500;
}

.vote-btn:hover:not(:disabled) {
  background: rgba(249,115,22,0.16);
  border-color: rgba(249,115,22,0.45);
  filter: none; transform: none;
}

.vote-btn::after { display: none; }

.vote-btn-selected {
  outline: none !important;
  background: linear-gradient(135deg, rgba(249,115,22,0.28), rgba(194,65,12,0.22)) !important;
  border-color: rgba(249,115,22,0.68) !important;
  color: white !important;
}

.vote-confirm-wrap { margin-top: 10px; }
.vote-confirm-wrap p { margin: 0 0 8px; font-size: 13px; opacity: 0.78; }

#confirmVoteBtn {
  width: 100%;
  background: linear-gradient(180deg, #f97316, #ea580c) !important;
  box-shadow: 0 4px 0 rgba(0,0,0,0.26), 0 6px 18px rgba(249,115,22,0.28) !important;
}

#confirmVoteBtn:hover:not(:disabled) { filter: brightness(1.08); }
#confirmVoteBtn::after { background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, transparent 60%); }

/* ===== TIMER ===== */
.timer-wrap { flex: 0 0 auto; margin-bottom: 16px; }

.timer-header-line {
  display: flex; align-items: center;
  justify-content: space-between; gap: 12px; margin-bottom: 8px;
}

.timer-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; opacity: 0.58; font-family: 'Syne', sans-serif; }

.timer-bar {
  width: 100%; height: 6px;
  background: rgba(255,255,255,0.07);
  border-radius: 999px; overflow: hidden;
}

.timer-fill {
  height: 100%; width: 100%;
  background: #22c55e;
  transition: width 0.15s linear, background 0.35s ease;
  border-radius: 999px;
  will-change: width;
}

.timer-text { font-size: 14px; font-weight: 700; min-width: 40px; text-align: right; font-family: 'Syne', sans-serif; }

/* ===== SECRET CARD ===== */
#secretCard {
  background: rgba(12,18,38,0.90);
  border: 1px solid rgba(96,165,250,0.24);
}

#wordText {
  margin: 8px 0 0;
  font-family: 'Syne', sans-serif;
  font-size: 1.6vw; font-weight: 800;
  line-height: 1.2; letter-spacing: 0.5px;
  color: #ffffff; text-align: center;
  padding: 1vh 1vw; border-radius: 1vw;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.07);
  cursor: pointer;
  user-select: none;
  transition: filter 0.4s ease;
}

#wordText.word-reveal {
  animation: wordReveal 1.2s cubic-bezier(0.22,1,0.36,1) forwards;
}

#wordText.word-hidden {
  filter: blur(10px) !important;
  cursor: pointer;
}

@keyframes wordReveal {
  0%   { opacity: 0; filter: blur(18px); transform: scale(0.92); }
  40%  { opacity: 1; filter: blur(8px);  transform: scale(1.02); }
  100% { opacity: 1; filter: blur(0px);  transform: scale(1); }
}

.word-toggle-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 12px auto 0;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.65);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: none;
  width: auto;
  min-height: auto;
}

.word-toggle-btn:hover {
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.90);
  filter: none;
  transform: none;
  box-shadow: none;
}

.word-toggle-btn::after { display: none; }
.word-toggle-btn:active { transform: scale(0.97); }

#chatHelp, #compositionHelp, #compositionSummary { font-size: 13px; opacity: 0.62; }
#compositionSummary { color: #fdba74; font-weight: 600; opacity: 1; }

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== SCROLLBARS ===== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.10); border-radius: 999px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
  .landing-cards { grid-template-columns: 1fr; width: min(680px, 100%); }
  .login-card, .rules-card { min-height: auto; }
  .game-layout { grid-template-columns: 1fr; }
  .panel-left { order: 2; }
  .panel-center { order: 1; }
}

@media (max-width: 820px) {
  html, body { height: 100dvh; }
  body { overflow: hidden; }

  .app-shell { min-height: 100dvh; height: 100dvh; overflow: hidden; }

  .topbar {
    grid-template-columns: 1fr;
    gap: 4px; min-height: 64px;
    padding: 10px 16px 0; margin-bottom: 0;
    background: rgba(5,9,20,0.94);
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }

  .brand-logo { font-size: 20px; letter-spacing: 3px; text-align: center; }
  .brand-logo-svg { width: 28px; height: 28px; }
  .landing-header { display: none !important; }
  .topbar-left, .topbar-right { justify-content: center; }
  .top-meta { padding: 6px 11px; font-size: 12px; }

  .status-banner { position: static; justify-self: center; max-width: calc(100vw - 24px); text-align: center; font-size: 13px; }

  .page-center {
    padding: 0;
    height: calc(100dvh - 64px);
    overflow: hidden;
    align-items: stretch;
  }

  .start-screen { height: 100%; overflow-y: auto; overflow-x: hidden; padding: 0; padding-bottom: env(safe-area-inset-bottom, 20px); -webkit-overflow-scrolling: touch; }

  .landing-stack { width: 100%; max-width: 100%; margin: 0; gap: 0; padding: 0; padding-bottom: 60px; flex-direction: column; align-items: stretch; }

  .mobile-tabs {
    order: 2; display: flex; width: 100%; gap: 0; margin: 0;
    padding: 10px 16px; background: rgba(5,9,20,0.88);
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }

  .mobile-tab-btn { flex: 1; border-radius: 10px; padding: 10px 12px; font-size: 14px; font-weight: 700; text-align: center; }

  .landing-cards { order: 3; grid-template-columns: 1fr; width: 100%; max-width: 100%; gap: 0; margin: 0; }

  #rulesCard { display: none; }
  #rulesCard.active { display: flex; }
  #roomSetupCard.hidden-tab { display: none; }

  .login-card, .rules-card {
    width: 100%; min-height: auto; max-height: none;
    padding: 24px 20px 32px; border-radius: 0;
    border: none; border-top: 1px solid rgba(255,255,255,0.05);
    background: rgba(10,16,34,0.96); box-shadow: none; overflow: visible;
  }

  .start-content h2 { font-size: 26px; margin-bottom: 6px; text-align: left; }
  .start-subtitle { font-size: 14px; margin-bottom: 20px; text-align: left; }
  .rules-card h3 { font-size: 22px; margin-bottom: 14px; text-align: left; }
  .rules-card ul { gap: 10px; font-size: 14px; }
  .form-block { margin-bottom: 14px; }
  .form-block label { margin-bottom: 7px; font-size: 14px; }

  input:not([type="range"]), select { padding: 14px 15px; font-size: 16px; border-radius: 14px; }
  input[type="range"] { padding: 0; background: transparent; border-radius: 0; height: auto; }
  button { padding: 14px 16px; font-size: 15px; border-radius: 14px; }
  .big-btn { min-height: 52px; font-size: 16px; font-weight: 700; border-radius: 16px; }
  .separator { margin: 16px 0; font-size: 14px; }
  .join-row { grid-template-columns: 1fr; gap: 10px; }

  /* Game mobile */
  .mobile-game-tabs { display: flex; }

  .game-layout { width: 100%; height: 100%; display: flex; flex-direction: column; margin: 0; padding: 0; overflow: hidden; }

  .panel-left { order: 1; flex: 0 0 auto; display: flex; flex-direction: row; gap: 8px; overflow-x: auto; overflow-y: hidden; padding: 8px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .panel-left::-webkit-scrollbar { display: none; }

  .panel-left .card { min-width: calc(100vw - 16px); max-width: calc(100vw - 16px); flex: 0 0 auto; padding: 14px; border-radius: 16px; overflow-y: auto; max-height: 45vh; }

  .panel-center { order: 2; flex: 1 1 auto; min-height: 0; padding: 0 8px 8px; display: flex; flex-direction: column; overflow: hidden; }

  .room-card { flex: 1 1 auto; min-height: 0; padding: 10px; border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; }

  .timer-wrap { margin-bottom: 6px; flex-shrink: 0; }
  .timer-bar { height: 4px; }
  .timer-label, .timer-text { font-size: 11px; }

  .room-content { grid-template-columns: 1fr; gap: 6px; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }

  .players-box, .chat-box, .end-box, .waiting-box { border-radius: 12px; padding: 10px; }
  .players-box { flex: 0 0 auto; max-height: 120px; overflow-y: auto; }
  .players-box h3 { margin-bottom: 6px; font-size: 11px; }
  .players-box ul { gap: 5px; }
  .players-box li { padding: 6px 8px; font-size: 12px; }
  .players-box li .player-sub { font-size: 11px; }

  .chat-box, .waiting-box, .end-box { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .messages { flex: 1 1 auto; min-height: 80px; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 8px; margin-bottom: 6px; }
  .message { padding: 6px 6px; font-size: 13px; }

  .chat-top-infos { margin-bottom: 6px; }
  .phase-line, .speaker-line { font-size: 13px; margin-bottom: 2px; }

  .role-dolls-wrap { margin-bottom: 7px; padding: 8px 9px; border-radius: 11px; }
  .role-dolls-title { font-size: 10px; margin-bottom: 6px; }
  .role-dolls { gap: 6px; }
  .role-doll { width: 22px; }
  .role-doll-head { width: 9px; height: 9px; }
  .role-doll-body { width: 14px; height: 11px; }

  .row { gap: 6px; }
  #chatInput { min-width: 0; font-size: 16px; }
  #sendChatBtn { white-space: nowrap; padding-left: 12px; padding-right: 12px; font-size: 14px; }

  #chatHelp, #compositionHelp, #compositionSummary, .vote-confirm-wrap p { font-size: 11px; }
  .waiting-title, .end-box h2 { font-size: 20px; }
  .waiting-box p, .end-box p { font-size: 14px; margin-bottom: 8px; }
  .waiting-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .waiting-meta-item { padding: 8px 9px; }
  .waiting-meta-label { font-size: 10px; }

  #wordText { font-size: 24px; padding: 13px 10px; border-radius: 12px; }
  .room-actions-bottom { margin-top: 7px; justify-content: stretch; }
  .room-actions-bottom button { flex: 1 1 0; min-height: 44px; font-size: 14px; }
  .card { border-radius: 16px; }
}

/* ===== MOBILE PANELS ===== */
.mobile-panel { display: none; }

@media (max-width: 820px) {
  .mobile-panel { display: block; width: 100%; height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .mobile-panel[style*="display: none"], .mobile-panel[style*="display:none"] { display: none !important; }
  .mobile-panel.hidden { display: none !important; }

  .panel-left { flex: 1 1 auto !important; min-height: 0 !important; overflow: hidden !important; padding: 8px !important; display: flex !important; flex-direction: column !important; }
  .desktop-only-cards { display: none !important; }
  .game-started .panel-center { display: none !important; }
}

.players-list-mobile { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.players-list-mobile-item { padding: 9px 12px; border-radius: 11px; background: rgba(8,14,30,0.65); border: 1px solid rgba(255,255,255,0.05); font-size: 13px; font-weight: 500; }
.players-list-mobile-item.player-current { border-color: rgba(249,115,22,0.45); background: linear-gradient(135deg, rgba(249,115,22,0.10), rgba(37,99,235,0.08)); }
.players-list-mobile-item.player-dead { opacity: 0.38; text-decoration: line-through; }

.vote-not-ready-inner { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; text-align: center; gap: 10px; }
.vote-not-ready-icon { font-size: 36px; opacity: 0.48; margin-bottom: 4px; }
.vote-not-ready-title { margin: 0; font-family: 'Syne', sans-serif; font-size: 17px; font-weight: 700; color: #fdba74; opacity: 0.78; }
.vote-not-ready-sub { margin: 0; font-size: 13px; opacity: 0.52; line-height: 1.5; max-width: 280px; }

.mobile-game-tab.vote-tab.vote-tab-active-phase {
  background: linear-gradient(180deg, #f97316, #ea580c) !important;
  border-color: rgba(255,255,255,0.20) !important;
  color: white !important;
  box-shadow: 0 2px 14px rgba(249,115,22,0.40) !important;
  animation: none !important;
}

@media (max-width: 820px) {
  .mobile-hidden-panel { display: none !important; }
  .panel-left .card:not(.mobile-hidden-panel) { min-width: calc(100vw - 16px); max-width: calc(100vw - 16px); flex: 1 1 auto; min-height: 0; overflow-y: auto; }
}

/* ===== ONGLETS PRIVÉ / PUBLIC ===== */
.landing-mode-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 1.4vw;
  background: rgba(255,255,255,0.04);
  border-radius: 14px;
  padding: 4px;
  border: 1px solid rgba(255,255,255,0.07);
  width: 100%;
  box-sizing: border-box;
}

.landing-mode-tab {
  flex: 1;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.45);
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: none;
  letter-spacing: 0.3px;
}

.landing-mode-tab::after { display: none; }
.landing-mode-tab:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.75); filter: none; transform: none; }

.landing-mode-tab.active {
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  color: white;
  box-shadow: 0 3px 10px rgba(37,99,235,0.30);
}

.landing-mode-tab.active[data-mode="public"] {
  background: linear-gradient(180deg, #e07a20, #b85a10);
  box-shadow: 0 3px 10px rgba(224,122,32,0.30);
}

/* ===== FILTRE ROOMS PUBLIQUES ===== */
.public-filter-bar {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

/* ===== LISTE ROOMS PUBLIQUES ===== */
.public-rooms-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
  margin-bottom: 12px;
}

.public-rooms-empty {
  text-align: center;
  padding: 32px 16px;
  opacity: 0.45;
  font-size: 14px;
}

.public-room-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: border-color 0.15s ease, background 0.15s ease;
  animation: fadeUp 0.2s ease;
}

.public-room-card:hover {
  background: rgba(224,122,32,0.06);
  border-color: rgba(224,122,32,0.28);
}

.public-room-info { flex: 1 1 auto; min-width: 0; }

.public-room-title {
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,0.90);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.public-room-meta {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.public-room-players {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}

.public-room-players.full { color: #ef4444; }
.public-room-players.available { color: #86efac; }

.public-room-join-btn {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  background: linear-gradient(180deg, #e07a20, #b85a10);
  box-shadow: 0 3px 0 rgba(0,0,0,0.24), 0 4px 12px rgba(224,122,32,0.22);
  min-height: auto;
  width: auto;
}

.public-room-join-btn:disabled {
  background: rgba(255,255,255,0.08);
  box-shadow: none;
  color: rgba(255,255,255,0.35);
}

/* Config création room publique */
.public-create-config {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 14px;
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: fadeUp 0.2s ease;
}

@media (max-width: 820px) {
  .landing-mode-tabs { margin-bottom: 14px; }
  .landing-mode-tab { font-size: 13px; padding: 9px 12px; }
  .public-filter-bar { grid-template-columns: 1fr; gap: 8px; }
  .public-rooms-list { max-height: 200px; }
}
#topResumeBtn {
  background: linear-gradient(180deg, #22c55e, #16a34a);
  box-shadow: 0 3px 0 rgba(0,0,0,0.20), 0 5px 12px rgba(34,197,94,0.24);
  font-size: 13px; font-weight: 700; letter-spacing: 0.3px;
  border-radius: 12px; padding: 9px 14px; min-height: 38px; width: auto;
}

#startBtnMobile, #startBtnConfig {
  background: linear-gradient(180deg, #22c55e, #16a34a);
  box-shadow: 0 4px 0 rgba(0,0,0,0.26), 0 6px 16px rgba(34,197,94,0.24);
}

/* ===== MOBILE AREA ===== */
.mobile-area { display: none; width: 100%; box-sizing: border-box; }

@media (max-width: 820px) {
  .desktop-game-layout { display: none !important; }

  #mobileTabBar {
    flex-shrink: 0;
    display: none;
    flex-direction: row; gap: 6px; padding: 6px 8px;
    background: rgba(5,9,20,0.92);
    border-bottom: 1px solid rgba(255,255,255,0.07);
    overflow-x: auto; scrollbar-width: none;
  }

  #mobileTabBar::-webkit-scrollbar { display: none; }

  .mobile-area {
    flex: 1 1 auto; min-height: 0;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
    padding: 10px 12px calc(24px + env(safe-area-inset-bottom, 16px));
    box-sizing: border-box;
  }

  .page-center {
    padding: 0 !important;
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
    height: calc(100dvh - 64px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .start-screen { flex: 1 1 auto; overflow-y: auto; }

  #mobileArea > div { width: 100%; box-sizing: border-box; }

  .mob-panel-chat {
    display: flex !important; flex-direction: column;
    height: calc(100svh - 64px - 50px - 20px);
    max-height: 100%;
  }

  .mob-panel-chat .messages { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }

  .mob-panel-chat .row {
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    background: rgba(8,14,30,0.98);
    padding: 8px 0 4px;
    z-index: 10;
  }

  .mob-panel-word {
    display: flex !important; flex-direction: column;
    align-items: center; justify-content: center;
    min-height: calc(100dvh - 64px - 50px - 40px);
  }
}

@media (min-width: 821px) {
  #mobileTabBar { display: none !important; }
  .mobile-area  { display: none !important; }
  .desktop-game-layout { display: grid !important; }

  .app-shell {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
  }

  .page-center {
    height: calc(100vh - 80px);
    max-height: calc(100vh - 80px);
    overflow: hidden;
    padding: 2vh 2vw !important;
    box-sizing: border-box;
  }

  .game-layout {
    height: 100%;
    max-height: 100%;
    overflow: hidden;
  }

  .panel-left {
    height: 100%;
    max-height: calc(100vh - 130px);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.10) transparent;
  }

  .panel-left::-webkit-scrollbar { width: 4px; }
  .panel-left::-webkit-scrollbar-track { background: transparent; }
  .panel-left::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 999px; }

  .panel-left .card {
    flex-shrink: 0;
  }
}