* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }

body {
  background: 
    linear-gradient(rgba(20, 10, 8, 0.76), rgba(8, 4, 3, 0.88)),
    url('rajasabhe.jpg') center center / cover no-repeat fixed;
  color: #f4ede4; height: 100vh; width: 100vw; overflow: hidden;
  display: flex; flex-direction: column;
}

header {
  height: 48px; background: rgba(20, 11, 10, 0.90); border-bottom: 1px solid #4a2810;
  display: flex; align-items: center; justify-content: space-between; padding: 0 16px; flex-shrink: 0;
  backdrop-filter: blur(8px);
  position: relative;
  z-index: 10000;
}

.header-left { display: flex; align-items: center; gap: 12px; }
header h1 { font-size: 1.05rem; color: #e8d0a9; letter-spacing: 1.5px; font-weight: 800; }
.header-right { display: flex; align-items: center; gap: 7px; }

/* GLOBAL COUNTER PILLS */
.stat-pill {
  font-size: 0.72rem; padding: 4px 9px; border-radius: 20px; font-weight: 700;
  display: flex; align-items: center; gap: 4px; backdrop-filter: blur(6px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.stat-pill.stat-plays { background: rgba(14, 35, 56, 0.88); border: 1px solid #00f0ff; color: #8ecae6; }
.stat-pill.stat-plays strong { color: #ffd700; font-weight: 800; }
.stat-pill.stat-sharanagati { background: rgba(45, 10, 35, 0.88); border: 1px solid #ff007f; color: #ffb3d9; }
.stat-pill.stat-sharanagati strong { color: #00f0ff; font-weight: 800; }

.lang-toggle-btn {
  font-size: 0.74rem; background: linear-gradient(90deg, #ff007f, #7928ca); color: #ffd700;
  padding: 4px 10px; border-radius: 20px; font-weight: 900; border: 1.5px solid #ffd700;
  cursor: pointer; transition: all 0.2s ease; display: flex; align-items: center; gap: 4px;
}
.lang-toggle-btn:hover { transform: scale(1.06); box-shadow: 0 0 14px #ffd700; }

.timer-pill {
  font-size: 0.75rem; background: rgba(28, 14, 24, 0.9); color: #ffd700; padding: 4px 9px;
  border-radius: 20px; font-weight: 800; border: 1px solid #ffd700; font-family: monospace;
}

/* MUSIC PLAYER PILL & GRANULAR AUDIO CONTROLS (M2) */
.music-player-wrapper { position: relative; display: inline-block; z-index: 10001; }
.music-pill-btn {
  font-size: 0.72rem; background: linear-gradient(90deg, #2b1055, #591a75); color: #ffd700;
  padding: 4px 10px; border-radius: 20px; font-weight: 800; border: 1px solid #c77dff;
  cursor: pointer; transition: all 0.2s ease; display: flex; align-items: center; gap: 4px;
}
.music-pill-btn.is-playing { border-color: #00f0ff; color: #00f0ff; animation: musicPulse 1.8s infinite alternate; }
@keyframes musicPulse { 0% { transform: scale(1); } 100% { transform: scale(1.04); } }

.music-tray-dropdown {
  display: none; position: absolute; top: 40px; right: 0; width: 310px;
  background: #14081c; border: 2px solid #a855f7; border-radius: 12px;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.95); padding: 12px 14px; z-index: 10002;
}
.music-tray-dropdown.open { display: flex; flex-direction: column; gap: 10px; }
.music-tray-header { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #3d1b54; padding-bottom: 6px; }
.music-now-playing-title { font-size: 0.76rem; font-weight: 700; color: #ffd700; max-width: 250px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music-close-btn { background: transparent; border: none; color: #a89078; font-size: 0.9rem; cursor: pointer; }

.music-tray-controls { display: flex; align-items: center; justify-content: space-between; gap: 6px; background: rgba(36, 16, 48, 0.85); padding: 6px 8px; border-radius: 6px; }
.music-ctrl-btn { background: #3c1a5e; border: 1px solid #7b2cbf; color: #fff; border-radius: 6px; padding: 4px 7px; cursor: pointer; font-size: 0.75rem; }
.music-ctrl-btn.play-main { background: #ffd700; color: #111; font-weight: 800; }

.audio-sliders-stack {
  display: flex; flex-direction: column; gap: 6px; background: rgba(26, 10, 36, 0.85);
  padding: 8px 10px; border-radius: 6px; border: 1px solid #3d1b54;
}
.music-volume-box { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 0.74rem; color: #e0d0eb; }
.music-volume-box input[type="range"] { width: 140px; accent-color: #ffd700; cursor: pointer; }
.sfx-mute-btn {
  background: #3c1a5e; border: 1px solid #7b2cbf; color: #ffd700; border-radius: 4px;
  padding: 2px 6px; cursor: pointer; font-size: 0.75rem; transition: background 0.15s;
}
.sfx-mute-btn:hover { background: #7b2cbf; }

.music-playlist-list { max-height: 160px; overflow-y: auto; display: flex; flex-direction: column; gap: 5px; }
.playlist-track-item { display: flex; align-items: center; justify-content: space-between; background: #1c0c29; border: 1px solid #36174d; padding: 6px 10px; border-radius: 6px; cursor: pointer; font-size: 0.74rem; color: #e0d0eb; }
.playlist-track-item.active-track { border-color: #00f0ff; background: rgba(0, 240, 255, 0.16); color: #00f0ff; font-weight: 800; }

.instructions-pill-btn {
  font-size: 0.72rem; background: linear-gradient(90deg, #1b3a4b, #065a60); color: #52b788;
  padding: 4px 10px; border-radius: 20px; font-weight: 800; border: 1px solid #52b788; cursor: pointer;
}
.mode-pill { font-size: 0.72rem; background: #7b2cbf; color: #ffd700; padding: 4px 10px; border-radius: 20px; font-weight: bold; cursor: pointer; border: 1px solid #ffd700; }

/* DESKTOP APP LAYOUT */
.app-layout {
  flex: 1; display: grid; grid-template-columns: 310px 1fr 280px; gap: 16px;
  padding: 10px 20px; height: calc(100vh - 48px); align-items: center; overflow: hidden;
}

/* LEFT PANEL */
.left-panel { height: 100%; display: flex; flex-direction: column; gap: 8px; justify-content: center; overflow-y: auto; }
.hud-card {
  background: rgba(36, 20, 18, 0.88); border: 1px solid #4a2810; border-radius: 10px;
  padding: 10px 14px; box-shadow: 0 6px 16px rgba(0,0,0,0.5); backdrop-filter: blur(6px);
}
.scores-grid { display: flex; flex-direction: column; gap: 6px; }
.score-row {
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(23, 11, 9, 0.85); padding: 6px 10px; border-radius: 6px; border: 2px solid transparent; font-size: 0.8rem;
}
.score-row.active { border-color: #ffd700; background: rgba(32, 15, 12, 0.95); }
.score-user { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.dot { width: 9px; height: 9px; border-radius: 50%; }

/* UNIFIED DIVINE ARSENAL DOCK CARD */
.divine-dock-card {
  background: linear-gradient(135deg, rgba(16, 24, 38, 0.95) 0%, rgba(10, 16, 26, 0.95) 100%);
  border: 1.5px solid #00f0ff; border-radius: 10px; padding: 10px 12px;
  box-shadow: 0 6px 20px rgba(0, 240, 255, 0.2); backdrop-filter: blur(6px);
  display: flex; flex-direction: column; gap: 8px;
}
.dock-header { display: flex; align-items: center; justify-content: space-between; }
.dock-title { font-size: 0.72rem; font-weight: 800; color: #ffd700; letter-spacing: 1px; }
.dock-status-sub { font-size: 0.68rem; color: #8ecae6; font-weight: 600; }

.dock-buttons-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.dock-btn {
  aspect-ratio: 1; border-radius: 8px; border: 1.5px solid #334e68;
  background: rgba(20, 36, 56, 0.8); color: #829ab1; font-size: 1.15rem;
  cursor: not-allowed; display: flex; align-items: center; justify-content: center;
  position: relative; transition: all 0.2s ease;
}
.dock-btn.active-dock {
  background: linear-gradient(135deg, #1b3a4b 0%, #065a60 100%);
  border-color: #00f0ff; color: #fff; cursor: pointer; box-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}
.dock-btn.active-dock:hover { transform: scale(1.08); border-color: #ffd700; }
.dock-badge {
  position: absolute; top: -5px; right: -5px; background: #ffd700; color: #111;
  font-size: 0.55rem; font-weight: 900; border-radius: 50%; width: 14px; height: 14px;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 0 4px #000;
}
.dock-tooltip-desc {
  font-size: 0.68rem; color: #d4b89b; line-height: 1.25; min-height: 28px;
  background: rgba(8, 14, 22, 0.7); padding: 5px 8px; border-radius: 5px; border-left: 2px solid #00f0ff;
}

/* MASTER SHARANAGATI COMPACT INVOKER & M3 TOAST */
.sharanagati-dock-container { display: flex; flex-direction: column; gap: 5px; margin-top: 2px; }
.shara-progress-bar-bg { width: 100%; height: 5px; background: #221226; border-radius: 3px; overflow: hidden; }
.shara-progress-bar-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #ff007f, #00f0ff); transition: width 0.3s ease; }
.btn-sharanagati-invoke {
  width: 100%; padding: 7px; font-size: 0.82rem; font-weight: 900; border: none;
  border-radius: 6px; cursor: pointer; background: #2e1736; color: #8a6296;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: all 0.3s ease;
}
.btn-sharanagati-invoke:not(:disabled) {
  background: linear-gradient(90deg, #ff007f, #7928ca, #00f0ff);
  color: #fff; cursor: pointer; animation: ultimatePulse 1.2s infinite alternate;
  border: 1px solid #ffd700; box-shadow: 0 0 16px rgba(255, 215, 0, 0.8);
}
@keyframes ultimatePulse { from { transform: scale(1); } to { transform: scale(1.02); } }
.shara-track-text { font-size: 0.65rem; color: #e0aaff; text-align: center; font-weight: 700; }

/* M3: Visual Celebration Toast Banner */
.celebration-toast {
  position: absolute; top: -50px; left: 50%; transform: translateX(-50%) scale(0.8);
  background: linear-gradient(90deg, #ff007f, #7928ca, #ffd700); color: #fff;
  padding: 8px 18px; border-radius: 24px; font-size: 0.82rem; font-weight: 900;
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.8); z-index: 600; opacity: 0; pointer-events: none;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  white-space: nowrap; display: flex; align-items: center; gap: 6px;
}
.celebration-toast.show-toast {
  opacity: 1; top: -15px; transform: translateX(-50%) scale(1);
}

/* COMPACT DIALOGUE THEATER */
.dialogue-theater-card {
  background: rgba(23, 11, 9, 0.88); border: 1px solid #4a2810; border-radius: 8px;
  padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; backdrop-filter: blur(6px);
}
.actor-row { display: flex; align-items: center; gap: 8px; font-size: 0.76rem; }
.actor-avatar { font-size: 1.1rem; flex-shrink: 0; }
.actor-speech-bubble {
  background: rgba(36, 18, 20, 0.85); padding: 5px 8px; border-radius: 6px;
  font-style: italic; line-height: 1.25; flex: 1; color: #ffd700;
}
.krishna-actor .actor-speech-bubble { color: #c4f1f9; background: rgba(10, 28, 46, 0.85); border-left: 2px solid #00f0ff; }
.shakuni-actor .actor-speech-bubble { color: #ffd700; background: rgba(38, 14, 24, 0.85); border-left: 2px solid #ff0055; }

/* Active Curse Indicator */
.curse-card {
  background: rgba(42, 11, 18, 0.92); border: 1px solid #ff4d6d; border-radius: 8px; padding: 5px 8px;
  font-size: 0.72rem; color: #ff758f; display: none; align-items: center; gap: 6px; backdrop-filter: blur(6px);
}

/* CENTER ARENA & BOARD */
.center-arena { display: flex; align-items: center; justify-content: center; height: 100%; position: relative; }
.board-frame {
  width: min(80vh, 640px); height: min(80vh, 640px);
  background: rgba(74, 40, 16, 0.95); padding: 8px; border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.85); border: 3.5px solid #8d5325;
  display: grid; grid-template-columns: repeat(7, 1fr); grid-template-rows: repeat(7, 1fr); gap: 4px;
  position: relative; backdrop-filter: blur(2px);
}

.board-frame.divine-aura-active {
  box-shadow: 0 0 60px 20px #ffd700, 0 0 100px 30px #00f0ff !important;
  border-color: #ffd700 !important; animation: divineAuraPulse 1.2s infinite alternate;
}
@keyframes divineAuraPulse { 0% { filter: brightness(1); } 100% { filter: brightness(1.3); } }

.dark-purge-trail {
  position: absolute; width: 60px; height: 60px; border-radius: 50%;
  background: radial-gradient(circle, rgba(123, 44, 191, 0.9) 0%, transparent 100%);
  filter: blur(8px); pointer-events: none; opacity: 0; z-index: 500;
  transition: all 2.6s cubic-bezier(0.25, 1, 0.5, 1);
}
.dark-purge-trail.active-smoke { opacity: 1; transform: scale(2.4); }

.cell {
  background: #fdf5e6; display: flex; align-items: center; justify-content: center;
  position: relative; border-radius: 6px; user-select: none; overflow: hidden;
  transition: transform 0.16s ease;
}
.cell.fog-cell { background: #3b284c !important; box-shadow: inset 0 0 8px #9333ea !important; }
.cell.sanctum-sealed { border: 2px solid #ef4444 !important; box-shadow: inset 0 0 12px #b91c1c !important; }
.cell.bubble-step { animation: gentleCellStep 0.24s ease; z-index: 5; }
@keyframes gentleCellStep { 0% { transform: scale(1); } 40% { transform: scale(0.96); } 100% { transform: scale(1); } }

.cell.safe {
  background: #dfbe8b;
  background-image: linear-gradient(45deg, transparent 47%, #7c4820 47%, #7c4820 53%, transparent 53%),
                    linear-gradient(-45deg, transparent 47%, #7c4820 47%, #7c4820 53%, transparent 53%);
}
.cell.center-cell { background: #c98a4b; font-weight: 900; font-size: 0.62rem; color: #3a1e05; border: 2px dashed #6b3b14; }
.center-label { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); pointer-events: none; font-weight: 900; }

.speech-bubble-home {
  position: absolute; padding: 6px 12px; border-radius: 12px; font-size: 0.78rem; font-weight: 800;
  pointer-events: none; z-index: 100; opacity: 0; transition: all 0.3s ease; max-width: 180px; text-align: center;
}
.shakuni-home-bubble { top: 10px; left: 50%; transform: translateX(-50%); background: rgba(43, 14, 27, 0.95); border: 2px solid #ff0055; color: #ffd700; }
.shakuni-home-bubble.active-bubble { opacity: 1; transform: translateX(-50%) translateY(8px); }
.yudhisthira-home-bubble { bottom: 10px; left: 50%; transform: translateX(-50%); background: rgba(9, 30, 54, 0.95); border: 2px solid #00f0ff; color: #ffd700; }
.yudhisthira-home-bubble.active-bubble { opacity: 1; transform: translateX(-50%) translateY(-8px); }

/* Pawns */
.token-container { display: flex; flex-wrap: wrap; gap: 2px; justify-content: center; align-items: center; width: 100%; height: 100%; padding: 2px; z-index: 2; }
.token {
  width: clamp(18px, 2.4vw, 26px); height: clamp(18px, 2.4vw, 26px); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: clamp(0.6rem, 0.85vw, 0.75rem);
  color: #fff; font-weight: bold; border: 1.5px solid #ffffffdd; position: relative;
}
.token.p0 { background: #e63946; }
.token.p1 { background: #111111; border: 1.5px solid #ffd700; color: #ffd700; }
.token.stepping { transform: scale(1.35); z-index: 10; box-shadow: 0 0 10px #fff; }
.token.shielded { border: 2px solid #00f0ff !important; box-shadow: 0 0 10px 3px #00f0ff !important; }
.token.ajnatha-concealed { opacity: 0.35 !important; border: 2px dashed #60a5fa !important; }
.token-timer {
  position: absolute; top: -6px; right: -6px; background: #00f0ff; color: #000; font-size: 0.55rem;
  border-radius: 50%; width: 13px; height: 13px; display: flex; align-items: center; justify-content: center; font-weight: 900;
}
.token.stunned { filter: grayscale(80%) brightness(0.6); border-color: #ff4d6d !important; }
.token.targeting { box-shadow: 0 0 12px 4px #00f0ff; cursor: pointer; animation: pulseTarget 0.6s infinite alternate; }
.token.active-turn { box-shadow: 0 0 8px 3px #ffd700; cursor: pointer; animation: pulse 0.8s infinite alternate; }
.token.recommended-target { box-shadow: 0 0 14px 4px #00f0ff !important; animation: pulseRec 0.6s infinite alternate !important; }
@keyframes pulseTarget { from { transform: scale(1); } to { transform: scale(1.3); } }
@keyframes pulse { from { transform: scale(1); } to { transform: scale(1.25); } }
@keyframes pulseRec { from { transform: scale(1.05); } to { transform: scale(1.35); } }

/* RIGHT PANEL */
.right-panel { height: 100%; display: flex; flex-direction: column; gap: 10px; justify-content: center; overflow-y: auto; }
.turn-badge { font-size: 1.05rem; font-weight: 800; margin-bottom: 2px; color: #e63946; }
.status-text { font-size: 0.8rem; color: #d4b89b; line-height: 1.3; }

.tray-card {
  background: rgba(36, 20, 18, 0.88); border: 1px solid #4a2810; border-radius: 10px;
  padding: 14px 14px; box-shadow: 0 6px 16px rgba(0,0,0,0.5); text-align: center;
}
.tray-title { font-size: 0.8rem; font-weight: bold; color: #d4a373; margin-bottom: 10px; text-transform: uppercase; }
.shells-stage { display: grid; grid-template-columns: repeat(3, 40px); gap: 10px; justify-content: center; margin-bottom: 14px; }
.cowrie-shell {
  width: 40px; height: 52px; border-radius: 50% 50% 45% 45%; display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; font-weight: 800; border: 2px solid #4a2810;
}
.cowrie-shell.mouth-up { background: #fff8eb; color: #8b5a2b; }
.cowrie-shell.mouth-down { background: #7c4820; color: #fff8eb; }
.cowrie-shell.rolling { animation: shellRattle 0.4s ease infinite; }
@keyframes shellRattle { 0% { transform: rotate(0deg); } 50% { transform: rotate(20deg); } 100% { transform: rotate(-20deg); } }

button#roll-btn {
  width: 100%; padding: 11px; font-size: 0.95rem; font-weight: 800; border: none; border-radius: 8px;
  cursor: pointer; background: #e8d0a9; color: #2b1f1d; letter-spacing: 1px;
}
button#roll-btn:disabled { background: #3d2723; color: #6d544f; cursor: not-allowed; }
button#roll-btn:hover:not(:disabled) { background: #ffd700; transform: translateY(-2px); }
.result-display { margin-top: 10px; font-size: 1.15rem; font-weight: 900; color: #ffd700; min-height: 28px; }

.history-card {
  background: rgba(23, 11, 9, 0.88); border: 1px solid #331a15; border-radius: 8px;
  padding: 8px 10px; height: 135px; overflow-y: auto; font-size: 0.72rem;
}
.history-card h4 { color: #a89078; font-size: 0.7rem; text-transform: uppercase; margin-bottom: 4px; }
.history-item { margin-bottom: 3px; color: #d4b89b; border-bottom: 1px dashed #291410; padding-bottom: 2px; }

/* MODALS */
.modal-overlay {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0, 0, 0, 0.88); display: none; align-items: center; justify-content: center;
  z-index: 1000; backdrop-filter: blur(8px);
}
.modal-box {
  background: linear-gradient(135deg, rgba(38, 13, 22, 0.96) 0%, rgba(18, 4, 10, 0.96) 100%);
  border: 2px solid #ff0055; border-radius: 12px; padding: 22px 26px; max-width: 520px;
  text-align: center; box-shadow: 0 0 24px rgba(255, 0, 85, 0.4); color: #f4ede4;
}
.modal-title { font-size: 1.25rem; font-weight: 900; color: #ff3366; margin-bottom: 10px; }
.modal-krishna-warn {
  background: rgba(0, 240, 255, 0.1); border: 1px solid #00f0ff; border-radius: 8px;
  padding: 10px; font-size: 0.85rem; color: #8ecae6; margin: 12px 0; font-style: italic;
}
.modal-actions { display: flex; gap: 12px; justify-content: center; margin-top: 16px; }
.btn-dharma { background: linear-gradient(90deg, #ffd700, #ffb703); color: #0b2545; font-weight: 800; border: none; border-radius: 6px; padding: 10px 18px; cursor: pointer; }
.btn-adharma { background: #4a0d1d; color: #ff758f; font-weight: 800; border: 1px solid #ff0055; border-radius: 6px; padding: 10px 18px; cursor: pointer; }

/* INSTRUCTIONS MODAL */
.instructions-box {
  background: linear-gradient(135deg, rgba(27, 14, 20, 0.96) 0%, rgba(13, 6, 9, 0.96) 100%);
  border: 2px solid #52b788; box-shadow: 0 0 35px rgba(82, 183, 136, 0.45);
  max-width: 640px; width: 92%; max-height: 85vh; display: flex; flex-direction: column;
}
.instruction-tabs { display: flex; gap: 8px; justify-content: center; margin-bottom: 12px; border-bottom: 1px solid #3d231b; padding-bottom: 8px; }
.inst-tab { background: #241412; color: #d4b89b; border: 1px solid #4a2810; padding: 6px 12px; border-radius: 6px; font-size: 0.75rem; font-weight: 800; cursor: pointer; }
.inst-tab.active-inst-tab { background: #52b788; color: #081c15; border-color: #52b788; }
.instruction-content-scroll { flex: 1; overflow-y: auto; text-align: left; padding: 6px 8px; font-size: 0.82rem; line-height: 1.45; display: flex; flex-direction: column; gap: 10px; }
.inst-section-card { background: rgba(36, 20, 18, 0.85); border: 1px solid #4a2810; border-radius: 8px; padding: 10px 12px; }
.inst-sec-title { font-size: 0.85rem; font-weight: 800; color: #ffd700; margin-bottom: 6px; }
.inst-list { padding-left: 18px; margin: 4px 0; font-size: 0.78rem; }

/* END-GAME & MODE MODAL */
.endgame-box { background: linear-gradient(135deg, rgba(13, 30, 54, 0.96) 0%, rgba(6, 16, 30, 0.96) 100%); border: 2px solid #ffd700; max-width: 580px; }
.endgame-title { font-size: 1.45rem; font-weight: 900; color: #ffd700; margin-bottom: 12px; }
.endgame-krishna-quote { background: rgba(0, 240, 255, 0.12); border: 1.5px solid #00f0ff; border-radius: 10px; padding: 14px 18px; font-size: 0.92rem; color: #c4f1f9; font-style: italic; }
.btn-restart { background: linear-gradient(90deg, #ffd700, #ff9e00); color: #0b2545; font-weight: 900; border: none; border-radius: 8px; padding: 12px 24px; cursor: pointer; }

.mode-select-box { background: linear-gradient(135deg, rgba(27, 14, 20, 0.96) 0%, rgba(12, 5, 8, 0.96) 100%); border: 2px solid #7b2cbf; max-width: 540px; }
.modes-list { display: flex; flex-direction: column; gap: 12px; margin: 18px 0; }
.mode-card-btn {
  display: flex; align-items: center; justify-content: space-between; padding: 12px 16px;
  border-radius: 10px; border: 2px solid #4a2810; background: rgba(30, 16, 23, 0.88); color: #f4ede4; cursor: pointer; text-align: left;
}
.mode-card-btn.active-mode { border-color: #00f0ff; background: rgba(12, 35, 64, 0.95); }
.mode-info h4 { font-size: 0.95rem; color: #ffd700; }
.mode-status-tag { font-size: 0.75rem; font-weight: 800; padding: 4px 10px; border-radius: 14px; background: #2b9348; color: #fff; }

/* NARRATIVE INTRO */
.narrative-overlay { z-index: 2000; background: radial-gradient(circle at center, rgba(30, 14, 10, 0.95) 0%, rgba(10, 5, 4, 0.98) 100%); }
.narrative-card { background: linear-gradient(135deg, #241412 0%, #150a08 100%); border: 2px solid #d4a373; max-width: 560px; width: 90%; padding: 26px 28px; border-radius: 14px; }
.narrative-badge { font-size: 0.72rem; font-weight: 900; color: #ffd700; margin-bottom: 8px; }
.narrative-title { font-size: 1.5rem; font-weight: 900; color: #e8d0a9; margin-bottom: 12px; }
.narrative-title-sm { font-size: 1.2rem; font-weight: 800; color: #ffd700; margin-bottom: 12px; }
.story-highlight-box { background: rgba(255, 215, 0, 0.08); border: 1px dashed #ffd700; border-radius: 8px; padding: 10px 14px; margin-top: 14px; color: #e8d0a9; font-size: 0.84rem; }
.narrative-quote-box { border-radius: 8px; padding: 12px 14px; margin: 12px 0; font-size: 0.86rem; }
.narrative-quote-box.shakuni-border { background: rgba(123, 44, 191, 0.15); border: 1.5px solid #7b2cbf; color: #e0aaff; }
.narrative-quote-box.krishna-border { background: rgba(0, 240, 255, 0.12); border: 1.5px solid #00f0ff; color: #c4f1f9; }
.btn-narrative-next, .btn-narrative-prev { padding: 9px 18px; font-size: 0.85rem; font-weight: 800; border-radius: 6px; cursor: pointer; }
.btn-narrative-next { background: linear-gradient(90deg, #ffd700, #ffb703); color: #0b2545; border: none; }
.btn-narrative-prev { background: #331a15; color: #d4b89b; border: 1px solid #5c321d; }
.intro-skip-bar { margin-top: 14px; border-top: 1px solid #3d231b; padding-top: 10px; text-align: center; }
.btn-skip-intro { background: transparent; border: none; color: #a89078; font-size: 0.76rem; cursor: pointer; text-decoration: underline; }

/* RESPONSIVE MEDIA QUERIES FOR MOBILE & TABLETS */
@media screen and (max-width: 900px) {
  body { height: auto; min-height: 100vh; overflow-y: auto; }
  header { height: auto; padding: 8px 12px; flex-direction: column; gap: 6px; align-items: stretch; }
  .header-right { justify-content: center; flex-wrap: wrap; gap: 5px; }
  .app-layout { display: flex; flex-direction: column; height: auto; padding: 10px; gap: 12px; overflow-y: visible; }
  
  /* Mobile Layout Ordering Fix: Board first, Cowrie Shell Tray right below, Powers/Chat at bottom */
  .center-arena { order: 1; width: 100%; margin: 5px 0; }
  .right-panel { order: 2; width: 100%; gap: 8px; }
  .left-panel { order: 3; width: 100%; gap: 8px; }
  
  .board-frame { width: min(92vw, 420px); height: min(92vw, 420px); }
}