/* ========================================
   LEBEAU MOTEL — Main Stylesheet
   Neon / retro / warm roadside vibe
   ======================================== */

:root {
  --bg: #0c0a0e;
  --bg2: #14101a;
  --bg3: #1c1622;
  --surface: #1e1828;
  --surface2: #2a2235;
  --border: #352a42;
  --text: #f0e8e0;
  --text2: #a8949c;
  --accent: #e84393;
  --accent2: #fd79a8;
  --gold: #fdcb6e;
  --green: #55efc4;
  --red: #ff7675;
  --neon: #e84393;
  --neon-glow: rgba(232, 67, 147, 0.3);
  --radius: 12px;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  user-select: none;
}

.hidden { display: none !important; }

/* ========================================
   WELCOME SCREEN
   ======================================== */

#welcome {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(12, 10, 14, 0.75);
  z-index: 1000;
  backdrop-filter: blur(3px);
}

.welcome-box {
  background: rgba(30, 24, 40, 0.95);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 40px;
  text-align: center;
  width: 380px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
}

.welcome-box h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 4px;
  color: var(--accent2);
  margin-bottom: 4px;
  text-shadow: 0 0 20px var(--neon-glow), 0 0 40px var(--neon-glow);
}

.subtitle {
  color: var(--text2);
  font-size: 13px;
  margin-bottom: 20px;
  font-style: italic;
}

.avatar-preview-container {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

#avatar-preview {
  background: var(--bg2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.customization {
  text-align: left;
}

.customization label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text2);
  margin: 10px 0 6px;
}

.customization input[type="text"] {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}

.customization input[type="text"]:focus {
  border-color: var(--accent);
}

.color-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}

.color-swatch:hover {
  transform: scale(1.1);
}

.color-swatch.active {
  border-color: var(--accent);
  transform: scale(1.15);
}

#btn-play {
  display: block;
  width: 100%;
  margin-top: 20px;
  padding: 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
  transition: background 0.2s;
}

#btn-play:hover { background: var(--accent2); }

/* ========================================
   GAME LAYOUT
   ======================================== */

#game {
  position: fixed;
  inset: 0;
}

#viewport {
  position: absolute;
  inset: 0;
}

#viewport canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* ========================================
   HUD
   ======================================== */

#hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: linear-gradient(180deg, rgba(10,10,15,0.9) 0%, rgba(10,10,15,0) 100%);
  pointer-events: none;
  z-index: 10;
}

#hud > * { pointer-events: auto; }

#hud-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

#room-name {
  font-weight: 700;
  font-size: 15px;
}

#room-property {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
}

#room-property:empty {
  display: none;
}

#room-visitors {
  color: var(--text2);
  font-size: 12px;
}

#hud-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

#coins {
  font-weight: 700;
  color: var(--gold);
  font-size: 14px;
}

#coins::before {
  content: 'MRR $';
  font-size: 10px;
  opacity: 0.7;
}

#hud-right button {
  padding: 6px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

#hud-right button:hover { background: var(--surface2); }

#hud-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

#xp-display {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent2);
  letter-spacing: 0.5px;
}

/* XP bar removed — MRR is the single metric now */

/* XP gain popup */
.xp-popup {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--green);
  font-size: 16px;
  font-weight: 800;
  pointer-events: none;
  animation: xpFloat 1.5s ease-out forwards;
  z-index: 30;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

@keyframes xpFloat {
  0% { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-40px); }
}

/* Level up popup */
.level-up-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--accent);
  color: #fff;
  padding: 16px 32px;
  border-radius: 12px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 2px;
  pointer-events: none;
  animation: levelPulse 3s ease-out forwards;
  z-index: 30;
  box-shadow: 0 0 40px var(--neon-glow);
}

@keyframes levelPulse {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  15% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
  30% { transform: translate(-50%, -50%) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

/* ========================================
   CHAT
   ======================================== */

#chat {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 380px;
  max-height: 300px;
  display: flex;
  flex-direction: column;
  z-index: 10;
}

#chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  mask-image: linear-gradient(to bottom, transparent 0%, black 30%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 30%);
}

.chat-msg {
  font-size: 13px;
  line-height: 1.4;
  padding: 4px 0;
}

.chat-msg .author {
  font-weight: 700;
  margin-right: 6px;
}

.chat-msg.system {
  color: var(--text2);
  font-style: italic;
  font-size: 12px;
}

.chat-channel {
  font-size: 10px;
  font-weight: 600;
  color: var(--text2);
  opacity: 0.7;
}

.chat-channel-all {
  color: var(--gold);
  opacity: 1;
}

.chat-mention {
  color: var(--accent2);
  font-weight: 600;
}

#chat-input-area {
  position: relative;
  display: flex;
  gap: 6px;
  padding: 6px 10px 10px;
  align-items: center;
}

#chat-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  background: #27272a;
  border: 1px solid #3f3f46;
  border-radius: 8px;
  transition: border-color 0.15s;
}

#chat-input-wrap:focus-within { border-color: var(--accent); }

#chat-channel-badge {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent);
  border: none;
  border-right: 1px solid #3f3f46;
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  border-radius: 7px 0 0 7px;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
#chat-channel-badge:hover { background: rgba(99, 102, 241, 0.25); }
#chat-channel-badge.channel-all {
  background: rgba(234, 179, 8, 0.15);
  color: var(--gold);
}
#chat-channel-badge.channel-all:hover { background: rgba(234, 179, 8, 0.25); }

#chat-input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 7px 0 7px 10px;
  color: #f4f4f5;
  font-size: 12px;
  outline: none;
  font-family: inherit;
  min-width: 0;
}

#chat-input::placeholder { color: #52525b; }

#btn-emoji {
  background: none;
  border: none;
  padding: 2px 8px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  opacity: 0.35;
  transition: opacity 0.15s;
  flex-shrink: 0;
}

#btn-emoji:hover { opacity: 0.8; }

#btn-fontsize {
  background: none;
  border: none;
  padding: 2px 6px;
  cursor: pointer;
  font-size: 11px;
  color: #52525b;
  font-weight: 700;
  font-family: inherit;
  transition: color 0.15s;
  flex-shrink: 0;
  line-height: 1;
}

#btn-fontsize:hover { color: #a1a1aa; }

#btn-send {
  background: var(--accent);
  border: none;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}

#btn-send:hover { background: var(--accent2); }

/* ========================================
   PANELS (Navigator, Inventory)
   ======================================== */

.panel {
  position: absolute;
  top: 60px;
  right: 16px;
  width: 320px;
  max-height: calc(100vh - 120px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  z-index: 20;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.panel-header h2 {
  font-size: 15px;
  font-weight: 700;
}

.panel-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text2);
  font-size: 18px;
  cursor: pointer;
}

.panel-close:hover { background: var(--surface2); color: var(--text); }

.panel-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.tab {
  flex: 1;
  padding: 10px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

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

#room-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.room-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.room-card:hover {
  background: var(--bg3);
  border-color: var(--accent);
}

.room-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.room-card-name {
  font-weight: 600;
  font-size: 14px;
}

.room-card-desc {
  color: var(--text2);
  font-size: 11px;
}

.room-card-visitors {
  color: var(--green);
  font-size: 12px;
  font-weight: 600;
}

/* ========================================
   INVENTORY
   ======================================== */

#inventory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 12px;
  overflow-y: auto;
}

.inv-item {
  aspect-ratio: 1;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  font-size: 11px;
  color: var(--text2);
  transition: border-color 0.15s;
}

.inv-item:hover { border-color: var(--accent); }

/* ========================================
   SPEECH BUBBLES (3D overlay)
   ======================================== */

.speech-bubble {
  position: absolute;
  left: 0;
  top: 0;
  background: #27272a;
  border: 1px solid #52525b;
  color: #f4f4f5;
  padding: 4px 10px;
  border-radius: 10px 10px 10px 2px;
  font-size: 11px;
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  will-change: transform, opacity;
  opacity: 0;
  margin-top: 6px;
  transition: opacity 0.25s, margin-top 0.25s ease-out;
  z-index: 5;
}

.speech-bubble.show {
  opacity: 1;
  margin-top: 0;
}

/* ========================================
   NAME LABELS
   ======================================== */

.name-label {
  position: absolute;
  left: 0;
  top: 0;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  pointer-events: none;
  will-change: transform;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  z-index: 4;
  transition: opacity 0.3s;
}

.name-label.distant {
  opacity: 0.25;
  font-size: 9px;
}

.name-badge {
  font-size: 9px;
  font-weight: 600;
  opacity: 0.7;
  line-height: 1;
  margin-bottom: 1px;
}

.name-label.npc {
  border: 1px solid rgba(253, 203, 110, 0.4);
  background: rgba(253, 203, 110, 0.1);
  border-radius: 4px;
  padding: 2px 5px;
}

.name-label.npc .name-badge {
  opacity: 0.9;
  font-size: 8px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ========================================
   TILE HOVER
   ======================================== */

.tile-cursor {
  cursor: pointer;
}

/* ========================================
   PLAYER CONTEXT MENU
   ======================================== */

.ctx-menu {
  position: fixed;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  z-index: 100;
  min-width: 140px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  animation: ctxIn 0.12s ease-out;
}

@keyframes ctxIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.ctx-menu button {
  display: block;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
}

.ctx-menu button:hover {
  background: var(--surface2);
}

.ctx-menu button.ctx-danger {
  color: var(--red);
}

.ctx-menu button.ctx-disabled {
  color: var(--text2);
  opacity: 0.4;
  cursor: not-allowed;
}

.ctx-menu .ctx-header {
  padding: 8px 12px 4px;
  font-size: 11px;
  color: var(--text2);
  font-weight: 600;
}

/* ========================================
   EMOJI PICKER
   ======================================== */

#btn-emoji, #btn-fontsize {
  width: 34px;
  height: 34px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text2);
  font-size: 13px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#btn-emoji:hover, #btn-fontsize:hover {
  background: var(--surface2);
  color: var(--text);
}

#emoji-picker {
  position: absolute;
  bottom: 100%;
  right: 0;
  background: #27272a;
  border: 1px solid #3f3f46;
  border-radius: 10px;
  padding: 6px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  width: fit-content;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.4);
  z-index: 15;
}

#emoji-picker.hidden { display: none; }

.emoji-btn {
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.emoji-btn:hover {
  background: #3f3f46;
}

/* ========================================
   AUTOCOMPLETE
   ======================================== */

#chat-autocomplete {
  position: absolute;
  bottom: 100%;
  left: 10px;
  right: 10px;
  background: #27272a;
  border: 1px solid #3f3f46;
  border-radius: 8px;
  overflow: hidden;
  z-index: 15;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.4);
}

#chat-autocomplete.hidden { display: none; }

.ac-item {
  padding: 6px 10px;
  font-size: 11px;
  color: #d4d4d8;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ac-item:hover, .ac-item.active {
  background: #3f3f46;
}

.ac-cmd {
  color: var(--accent2);
  font-weight: 600;
  min-width: 50px;
}

.ac-desc {
  color: #71717a;
  font-size: 10px;
}

/* ========================================
   FONT SIZE MODES
   ======================================== */

#chat.font-small .chat-msg { font-size: 10px; }
#chat.font-small .chat-msg .author { font-size: 10px; }
#chat.font-normal .chat-msg { font-size: 12px; }
#chat.font-normal .chat-msg .author { font-size: 12px; }
#chat.font-big .chat-msg { font-size: 14px; }
#chat.font-big .chat-msg .author { font-size: 14px; }

/* ========================================
   FLOATING EMOJI
   ======================================== */

.floating-emoji {
  position: absolute;
  left: 0;
  top: 0;
  font-size: 22px;
  pointer-events: none;
  will-change: transform;
  z-index: 6;
  animation: emojiFloat 2s ease-out forwards;
}

@keyframes emojiFloat {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

/* ========================================
   KICKED/BANNED OVERLAY
   ======================================== */

.kicked-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.kicked-message {
  background: var(--surface);
  border: 2px solid var(--red);
  border-radius: 16px;
  padding: 32px 48px;
  color: var(--red);
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  max-width: 400px;
}

/* ========================================
   RESPONSIVE
   ======================================== */

/* ========================================
   LEADERBOARD
   ======================================== */

#leaderboard {
  position: absolute;
  top: 56px;
  right: 16px;
  width: 200px;
  background: rgba(10, 10, 15, 0.85);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  z-index: 10;
  backdrop-filter: blur(4px);
}

.lb-title {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text2);
  margin-bottom: 6px;
  text-align: center;
}

.lb-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  font-size: 12px;
}

.lb-row.lb-player {
  background: rgba(99, 102, 241, 0.15);
  border-radius: 4px;
  padding: 3px 4px;
  margin: 0 -4px;
}

.lb-row.lb-alert {
  animation: lbPulse 1s ease-in-out infinite;
}

@keyframes lbPulse {
  0%, 100% { background: transparent; }
  50% { background: rgba(255, 118, 117, 0.2); }
}

.lb-rank {
  font-weight: 700;
  font-size: 11px;
  width: 18px;
  text-align: right;
  color: var(--text2);
}

.lb-rank.lb-gold { color: #ffd700; }
.lb-rank.lb-silver { color: #c0c0c0; }
.lb-rank.lb-bronze { color: #cd7f32; }

.lb-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.lb-mrr {
  font-family: 'Courier New', monospace;
  font-weight: 700;
  font-size: 11px;
  color: var(--green);
  white-space: nowrap;
}

/* ========================================
   EVENT OVERLAY (Server Down etc.)
   ======================================== */

.event-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.event-flash {
  position: absolute;
  inset: 0;
  background: rgba(255, 0, 0, 0.15);
  animation: eventFlash 0.5s ease-in-out infinite alternate;
}

@keyframes eventFlash {
  from { opacity: 0.3; }
  to { opacity: 0.8; }
}

.event-box {
  position: relative;
  text-align: center;
  z-index: 1;
}

.event-subtitle {
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 6px;
}

.event-title {
  font-size: 28px;
  font-weight: 900;
  color: var(--red);
  letter-spacing: 4px;
  text-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
  margin-bottom: 12px;
}

.event-countdown {
  font-size: 72px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 30px rgba(255, 0, 0, 0.6);
  font-family: 'Courier New', monospace;
}

/* ========================================
   MINI-GAME OVERLAY
   ======================================== */

.minigame-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
  backdrop-filter: blur(2px);
}

.minigame-container {
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: 16px;
  padding: 24px 32px;
  text-align: center;
  min-width: 320px;
  max-width: 400px;
  position: relative;
}

.minigame-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.minigame-title {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 3px;
  color: var(--accent2);
  text-shadow: 0 0 10px var(--neon-glow);
}

.minigame-timer {
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
  font-family: 'Courier New', monospace;
}

.minigame-score {
  font-size: 16px;
  font-weight: 700;
  color: var(--green);
  font-family: 'Courier New', monospace;
}

.minigame-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: none;
  color: var(--text2);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
}

.minigame-close:hover { color: var(--text); }

/* Diner Rush specific */
.dr-order-area {
  margin: 16px 0;
}

.dr-order-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--text2);
  margin-bottom: 8px;
}

.dr-order-emoji {
  font-size: 56px;
  line-height: 1;
  transition: transform 0.1s;
}

.dr-order-emoji.dr-correct {
  animation: drCorrect 0.3s ease-out;
}

.dr-order-emoji.dr-wrong {
  animation: drWrong 0.3s ease-out;
}

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

@keyframes drWrong {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

.dr-options {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
}

.dr-option-btn {
  width: 72px;
  height: 72px;
  font-size: 36px;
  background: var(--bg2);
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.1s, border-color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dr-option-btn:hover {
  transform: scale(1.1);
  border-color: var(--accent);
}

.dr-option-btn:active {
  transform: scale(0.95);
}

.dr-result-score {
  font-size: 24px;
  font-weight: 700;
  color: var(--green);
  margin: 20px 0 12px;
}

.dr-cook-comment {
  font-size: 13px;
  color: var(--text2);
  font-style: italic;
  margin-bottom: 24px;
}

.dr-play-again, .dr-close-btn {
  display: block;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 8px;
  transition: background 0.15s;
}

.dr-play-again {
  background: var(--accent);
  color: #fff;
}

.dr-play-again:hover { background: var(--accent2); }

.dr-close-btn {
  background: var(--surface2);
  color: var(--text);
}

.dr-close-btn:hover { background: var(--border); }

/* ========================================
   HINT OVERLAY
   ======================================== */

.hint-overlay {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 10, 15, 0.85);
  color: var(--text2);
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  z-index: 25;
  pointer-events: none;
  border: 1px solid var(--border);
  transition: opacity 1s ease-out;
}

.hint-overlay.hint-fade {
  opacity: 0;
}

/* ========================================
   WIN CELEBRATION
   ======================================== */

.win-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  animation: winFadeIn 0.5s ease-out;
}

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

.win-box {
  text-align: center;
  animation: winBounce 0.6s ease-out;
}

@keyframes winBounce {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

.win-trophy {
  font-size: 72px;
  margin-bottom: 16px;
}

.win-message {
  font-size: 22px;
  font-weight: 800;
  color: var(--gold);
  text-shadow: 0 0 20px rgba(253, 203, 110, 0.4);
  max-width: 400px;
  line-height: 1.4;
}

/* ========================================
   RESPONSIVE
   ======================================== */

/* ========================================
   SLOT MACHINE
   ======================================== */

.slot-subtitle {
  color: var(--text2);
  font-size: 13px;
  margin-bottom: 16px;
}

.slot-reels {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}

.slot-reel {
  width: 72px;
  height: 72px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  transition: border-color 0.2s;
}

.slot-reel-done {
  border-color: var(--accent);
}

.slot-bets {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
}

.slot-bet-btn {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  padding: 8px 20px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.slot-bet-btn:hover {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.15);
}

.slot-disabled {
  pointer-events: none;
  opacity: 0.4;
}

.slot-result {
  font-size: 16px;
  font-weight: 700;
  min-height: 24px;
  margin-top: 4px;
}

.slot-win { color: var(--green); }
.slot-loss { color: var(--red); }

/* ========================================
   COMMAND HINTS (bottom-right, above Vibe Jam widget)
   ======================================== */

#cmd-hints {
  position: fixed;
  bottom: 60px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
  z-index: 10;
  pointer-events: none;
  opacity: 0.45;
}

.cmd-hint {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text2);
  white-space: nowrap;
}

.cmd-hint i {
  font-size: 13px;
  color: var(--accent2);
}

.cmd-icon {
  width: 12px;
  height: 16px;
  color: var(--accent2);
  flex-shrink: 0;
}

@media (max-width: 640px) {
  #chat { width: 100%; }
  .panel { right: 8px; left: 8px; width: auto; }
  .welcome-box { width: 90vw; padding: 24px 20px; }
  #leaderboard { width: 160px; right: 8px; top: 52px; }
  .lb-row { font-size: 11px; }
}
