:root {
  --bg-color: #0b0c10;
  --panel-bg: #1f2833;
  --border-color: #45a29e;
  --accent: #66fcf1;
  --text-main: #c5c6c7;
  --danger: #e74c3c;
  --gold: #f1c40f;
  --c-red: #ff4d4d;
  --c-blue: #3498db;
  --c-green: #2ecc71;
  --c-purple: #9b59b6;
  --c-skull: #bdc3c7;
  --footer-bg: rgba(0,0,0,0.5);
}

/* Theme classes */
.theme-catacombs { --accent: #66fcf1; --border-color: #45a29e; --bg-color: #0b0c10; }
.theme-spiders { --accent: #2ecc71; --border-color: #27ae60; --bg-color: #050f05; }
.theme-flooded { --accent: #3498db; --border-color: #2980b9; --bg-color: #050a0f; }
.theme-necropolis { --accent: #9b59b6; --border-color: #8e44ad; --bg-color: #0f050f; }
.theme-crystal { --accent: #f1c40f; --border-color: #f39c12; --bg-color: #100f0b; }

body {
  margin: 0; padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  user-select: none;
}

.screen {
  display: none; width: 100vw; height: 100vh;
  position: absolute; top: 0; left: 0;
  flex-direction: column;
  background-color: var(--bg-color);
  z-index: 10;
  padding-bottom: 45px;
  box-sizing: border-box;
}
.screen.active { 
  display: flex; 
  z-index: 20;
}

button {
  background: var(--panel-bg); color: var(--accent);
  border: 2px solid var(--border-color);
  padding: 10px 20px; font-size: 16px; font-weight: bold;
  border-radius: 5px; cursor: pointer; text-transform: uppercase;
  transition: 0.2s all;
}
button:hover:not(:disabled) {
  background: var(--border-color); color: var(--bg-color);
  box-shadow: 0 0 10px var(--accent);
}
button:disabled { opacity: 0.5; cursor: not-allowed; border-color: #555; color: #555; }

/* Utilities */
.flex-center { display: flex; justify-content: center; align-items: center; text-align: center; }
.grid { display: grid; }
.title { font-size: 4em; color: var(--accent); text-shadow: 0 0 20px var(--border-color); margin-bottom: 40px; }

/* Panels */
.layout { display: flex; width: 100%; height: 100%; box-sizing: border-box; }
.panel {
  background: var(--panel-bg); border: 1px solid var(--border-color);
  padding: 15px; margin: 5px; overflow-y: auto; border-radius: 8px;
}
.left-panel { width: 25%; }
.center-panel { width: 50%; display: flex; flex-direction: column; align-items: center; }
.right-panel { width: 25%; }

/* Top Bar */
.top-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 20px; background: #111; border-bottom: 2px solid var(--border-color);
}

/* Map */
.map-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px;
  width: 300px; height: 300px; padding: 10px; border-radius: 8px; border: 2px solid var(--border-color);
  background: radial-gradient(circle at center, #1b2a1a 0%, #050a05 100%);
  box-shadow: inset 0 0 30px rgba(0,0,0,1);
  position: relative; overflow: hidden;
}
.map-grid::after {
  content: "✨"; position: absolute; font-size: 8px; opacity: 0.5;
  animation: firefly 8s infinite alternate ease-in-out; pointer-events: none;
}
@keyframes firefly {
  0% { transform: translate(20px, 20px) scale(1); opacity: 0.2; }
  33% { transform: translate(150px, 80px) scale(1.5); opacity: 0.8; text-shadow: 0 0 5px #e0ffff; }
  66% { transform: translate(80px, 200px) scale(1); opacity: 0.4; }
  100% { transform: translate(250px, 250px) scale(1.5); opacity: 0.9; text-shadow: 0 0 5px #e0ffff; }
}
.map-cell {
  background: rgba(10, 10, 10, 0.7); display: flex; justify-content: center; align-items: center;
  font-size: 20px; border-radius: 4px; border: 1px solid #111; transition: 0.3s;
  box-shadow: 2px 2px 5px rgba(0,0,0,0.6);
}
.map-cell.visited { 
  background: radial-gradient(circle, #2c3e50, #1a252f); 
  border-color: #555; 
  box-shadow: inset 0 0 5px rgba(0,0,0,0.5);
}
.map-cell.current { 
  border: 2px solid var(--accent); 
  background: radial-gradient(circle, #34495e, #2c3e50); 
  box-shadow: 0 0 15px var(--accent), inset 0 0 10px rgba(255,255,255,0.1); 
}

.map-controls { display: grid; grid-template-columns: 50px 50px 50px; grid-template-rows: 50px 50px 50px; gap: 5px; margin-top: 20px; }
.map-controls button { padding: 0; font-size: 20px; }
.mc-n { grid-column: 2; grid-row: 1; }
.mc-w { grid-column: 1; grid-row: 2; }
.mc-s { grid-column: 2; grid-row: 3; }
.mc-e { grid-column: 3; grid-row: 2; }


/* Match 3 Combat */
.combat-layout { display: flex; flex-direction: column; width: 100%; height: 100%; }
.combat-top { display: flex; justify-content: center; align-items: center; padding: 10px; gap: 20px; background: #111; }
.combat-mid { flex-grow: 1; display: flex; justify-content: center; align-items: center; }
.combat-bot { display: flex; padding: 10px; background: #111; gap: 20px; height: 200px; }

.match-board {
  display: grid; grid-template-columns: repeat(8, 50px); grid-template-rows: repeat(8, 50px);
  gap: 3px; background: #0b0c10; padding: 8px; border: 3px solid var(--border-color); border-radius: 10px;
  box-shadow: 0 0 30px rgba(102, 252, 241, 0.2);
}
.tile {
  width: 50px; height: 50px; border-radius: 8px; cursor: pointer;
  display: flex; justify-content: center; align-items: center; font-size: 24px;
  transition: transform 0.2s, background 0.2s; box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
  position: relative;
}
.tile:hover { transform: scale(1.1); background: rgba(255,255,255,0.1); }
.tile.selected { border: 2px solid #fff; transform: scale(1.1); box-shadow: 0 0 15px #fff; z-index:10;}
.tile-img {
  width: 85%; height: 85%;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
  pointer-events: none;
  user-select: none;
}

.t-0 { background: radial-gradient(circle at 30% 30%, #ff7979, var(--c-red)); }
.t-1 { background: radial-gradient(circle at 30% 30%, #7ed6df, var(--c-blue)); }
.t-2 { background: radial-gradient(circle at 30% 30%, #badc58, var(--c-green)); }
.t-3 { background: radial-gradient(circle at 30% 30%, #e056fd, var(--c-purple)); }
.t-4 { background: radial-gradient(circle at 30% 30%, #ecf0f1, var(--c-skull)); text-shadow: 0 2px 2px #000; }

.bomb-overlay {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, transparent 70%);
  animation: pulse 1s infinite alternate; pointer-events: none; border-radius: 8px;
}
@keyframes pulse { from { opacity: 0.3; } to { opacity: 1; } }

/* Bars */
.bar-container { width: 100%; height: 20px; background: #222; border-radius: 10px; overflow: hidden; border: 1px solid #555; position: relative; margin: 2px 0; }
.bar-fill { height: 100%; transition: width 0.3s ease; }
.bar-text { position: absolute; width: 100%; text-align: center; top: 2px; font-size: 11px; font-weight: bold; color: #fff; text-shadow: 1px 1px 2px #000; z-index: 5; }
.hp-fill { background: linear-gradient(to right, #e74c3c, #ff7979); }
.xp-fill { background: linear-gradient(to right, #2980b9, #3498db, #00d2ff); box-shadow: 0 0 10px rgba(0, 210, 255, 0.4); }

/* Portraits */
.portrait { width: 80px; height: 80px; border-radius: 50%; border: 3px solid var(--border-color); background: #222; overflow: hidden; display: flex; justify-content: center; align-items: center;}
.big-portrait { width: 120px; height: 120px; }

/* Modals */
.modal-bg { display: none; position: absolute; top:0; left:0; width:100vw; height:100vh; background:rgba(0,0,0,0.85); z-index:1000; justify-content:center; align-items:center; }
.modal-content { background: var(--panel-bg); padding: 30px; border: 2px solid var(--border-color); border-radius: 10px; max-width: 800px; max-height: 80vh; overflow-y: auto; text-align: center; }

#combat-log { flex-grow: 1; background: #000; color: #aaa; font-family: monospace; font-size: 13px; padding: 10px; overflow-y: auto; border: 1px solid #444; border-radius: 5px; text-align: left; }

.q-8-glow {
  box-shadow: 0 0 15px #e0ffff !important;
  text-shadow: 0 0 5px #e0ffff !important;
  animation: glow-pulse 1.5s infinite alternate;
  border-color: #e0ffff !important;
}
@keyframes glow-pulse {
  from { box-shadow: 0 0 10px #e0ffff; text-shadow: 0 0 5px #e0ffff; }
  to { box-shadow: 0 0 20px #e0ffff; text-shadow: 0 0 10px #e0ffff; }
}

/* Class Selection AAA Styles */
.class-card {
  width: 280px; height: 450px;
  background: #111; border: 2px solid #333; border-radius: 12px;
  overflow: hidden; position: relative; cursor: pointer;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex; flex-direction: column;
}
.class-card:hover {
  transform: translateY(-10px) scale(1.02);
  border-color: var(--gold);
  box-shadow: 0 15px 30px rgba(0,0,0,0.8), 0 0 20px rgba(255,215,0,0.3);
}
.class-card-img {
  flex-grow: 1; background: radial-gradient(circle at center, #2a2a2a, #0a0a0a);
  display: flex; justify-content: center; align-items: center;
  position: relative; overflow: hidden;
  background-size: cover; background-position: center;
}
.class-card-img svg { width: 150px; height: 150px; opacity: 0.2; transition: all 0.4s ease; }
.class-card:hover .class-card-img svg { opacity: 0.5; transform: scale(1.1); }
.class-card-placeholder-text {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  color: rgba(255,255,255,0.3); font-size: 14px; text-align: center;
  pointer-events: none; font-weight: bold; text-transform: uppercase; letter-spacing: 2px;
}
.class-card-content {
  padding: 20px; background: linear-gradient(to top, rgba(0,0,0,1) 60%, rgba(0,0,0,0));
  position: absolute; bottom: 0; left: 0; right: 0;
  text-align: center; border-top: 1px solid rgba(255,255,255,0.1);
}
.class-card-title {
  color: var(--accent); margin: 0 0 10px 0; font-size: 24px;
  text-transform: uppercase; letter-spacing: 2px; text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}
.class-card-desc {
  color: #ccc; font-size: 13px; margin: 0 0 10px 0; line-height: 1.4; height: 40px;
}
.class-card-stats {
  display: flex; justify-content: center; gap: 15px; font-size: 11px;
  color: var(--gold); border-top: 1px solid rgba(255,255,255,0.1); padding-top: 10px;
}

/* Tooltips */
.tooltip {
  display: none; position: fixed; z-index: 2000;
  background: rgba(10, 10, 10, 0.95); color: #eee;
  padding: 12px; border: 1px solid var(--border-color); border-radius: 6px;
  font-size: 13px; min-width: 200px; max-width: 300px;
  pointer-events: none; box-shadow: 0 10px 30px rgba(0,0,0,0.8);
}
.tooltip.active { opacity: 1; pointer-events: auto; }
.tt-title { color: var(--accent); font-weight: bold; margin-bottom: 5px; font-size: 15px; border-bottom: 1px solid #444; padding-bottom: 5px; }
.tt-row { display: flex; justify-content: space-between; margin-bottom: 3px; }
.tt-pos { color: #2ecc71; }
.tt-neg { color: #e74c3c; }
.tt-source { font-size: 11px; color: #aaa; margin-top: 8px; border-top: 1px solid #333; padding-top: 5px; }
.tt-item { display: flex; justify-content: space-between; font-style: italic; }
.stat-hover { cursor: help; transition: color 0.2s; }
.stat-hover:hover { color: #fff; }

/* Cinematic Start Screen */
.splash-screen {
  background: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.8)), url('../img/splash.jpg') center/cover no-repeat;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.game-title {
  font-size: 5em; font-weight: 900; text-transform: uppercase; letter-spacing: 10px;
  background: linear-gradient(to bottom, #f1c40f, #d4af37, #b8860b);
  background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  text-shadow: 0 0 30px rgba(212, 175, 55, 0.4);
  margin-bottom: 10px; animation: title-glow 3s infinite alternate;
  font-family: 'Cinzel', serif; /* fallback to serif if not loaded */
}
@keyframes title-glow {
  from { filter: drop-shadow(0 0 5px rgba(212, 175, 55, 0.2)); transform: scale(1); }
  to { filter: drop-shadow(0 0 20px rgba(212, 175, 55, 0.6)); transform: scale(1.02); }
}
.game-subtitle {
  color: #aaa; font-size: 1.2em; text-transform: uppercase; letter-spacing: 5px;
  margin-bottom: 50px; border-top: 1px solid #444; border-bottom: 1px solid #444; padding: 5px 20px;
}

/* AAA Buttons */
.btn-aaa {
  background: linear-gradient(135deg, #1a1a1a 0%, #333 100%);
  color: #eee; border: 1px solid #555; border-radius: 4px;
  padding: 15px 40px; font-size: 16px; font-weight: bold; text-transform: uppercase;
  letter-spacing: 2px; cursor: pointer; transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}
.btn-aaa:hover {
  background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
  color: #000; border-color: #fff; transform: translateY(-3px) scale(1.05);
  box-shadow: 0 10px 25px rgba(212, 175, 55, 0.4);
}
.btn-aaa:active { transform: translateY(0); }
.btn-aaa::after {
  content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
  background: linear-gradient(rgba(255,255,255,0), rgba(255,255,255,0.1), rgba(255,255,255,0));
  transform: rotate(45deg); transition: 0.5s; top: -150%; left: -150%;
}
.btn-aaa:hover::after { top: 150%; left: 150%; }

.btn-primary { border-color: var(--gold); background: linear-gradient(135deg, #222 0%, #111 100%); color: var(--gold); }

/* Logo Styles */
.logo-container {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  margin-bottom: 20px;
}
.game-logo {
  max-width: 600px; max-height: 250px; object-fit: contain;
  filter: drop-shadow(0 0 15px rgba(0,0,0,0.8));
  margin-bottom: -20px; /* pull title closer if logo exists */
}

/* Map Token Styles */
.map-token {
  width: 100%; height: 100%;
  background-size: contain; background-position: center; background-repeat: no-repeat;
  display: flex; align-items: center; justify-content: center;
  animation: token-bounce 2s infinite ease-in-out;
}
.map-token svg {
  width: 70%; height: 70%;
  opacity: 0.8; /* fallback icon if image is missing */
}
@keyframes token-bounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-3px) scale(1.05); }
}

/* Damage Types */
.type-physical { color: #ecf0f1; font-weight: bold; }
.type-fire { color: #e67e22; font-weight: bold; }
.type-poison { color: #2ecc71; font-weight: bold; }
.type-lightning { color: #f1c40f; font-weight: bold; }
.type-arcane { color: #9b59b6; font-weight: bold; }
.type-holy { color: #e0ffff; font-weight: bold; text-shadow: 0 0 5px #f1c40f; }

/* Enemy Combat Portrait */
.enemy-portrait-frame {
  width: 120px; height: 120px;
  border-radius: 50%; border: 3px solid #444;
  overflow: hidden; background: #111;
  box-shadow: 0 0 20px rgba(0,0,0,0.8), inset 0 0 15px rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 10px;
}
.enemy-portrait-img {
  width: 100%; height: 100%; object-fit: cover;
}

/* Victory Screen AAA Styles */
.victory-container {
  padding: 20px; text-align: center;
  animation: victory-scale 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes victory-scale {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.victory-title {
  font-family: 'Cinzel', serif; font-size: 4em; font-weight: 900;
  background: linear-gradient(to bottom, #fff, #f1c40f, #d4af37);
  background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 30px; letter-spacing: 5px;
  filter: drop-shadow(0 0 15px rgba(212, 175, 55, 0.6));
}
.reward-list {
  display: flex; flex-direction: column; gap: 10px; margin-bottom: 30px;
}
.reward-card {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  padding: 15px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center;
  font-size: 1.2em;
}
.reward-val { color: var(--gold); font-weight: bold; }
.reward-xp { color: var(--accent); }
.reward-item {
  border-left: 4px solid var(--gold); background: rgba(0,0,0,0.3);
}
/* Defeat Screen Styles */
.defeat-container {
  padding: 20px; text-align: center;
  animation: defeat-shake 0.4s ease-in-out;
}
@keyframes defeat-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}
.defeat-title {
  font-family: 'Cinzel', serif; font-size: 4em; font-weight: 900;
  background: linear-gradient(to bottom, #7b241c, #e74c3c, #943126);
  background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 20px; letter-spacing: 5px;
  filter: drop-shadow(0 0 15px rgba(231, 76, 60, 0.4));
}
.defeat-msg { color: #888; font-style: italic; margin-bottom: 30px; }

/* Level Up Screen Styles */
.levelup-container {
  padding: 20px; text-align: center;
  animation: victory-scale 0.5s ease-out;
}
.levelup-title {
  font-family: 'Cinzel', serif; font-size: 3.5em; font-weight: 900;
  background: linear-gradient(to bottom, #fff, #3498db, #2980b9);
  background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 10px; letter-spacing: 2px;
  filter: drop-shadow(0 0 20px rgba(52, 152, 219, 0.6));
}
.lvl-badge {
  font-size: 5em; font-weight: 900; color: #fff; margin: 10px 0;
  text-shadow: 0 0 20px #3498db;
}
.stat-up-list {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px;
}
.stat-up-item {
  background: rgba(46, 204, 113, 0.1); border: 1px solid rgba(46, 204, 113, 0.2);
  padding: 8px; border-radius: 4px; color: #2ecc71; font-weight: bold;
  animation: stat-pop 0.3s ease-out backwards;
}
@keyframes stat-pop {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.new-skill-card {
  background: linear-gradient(45deg, rgba(52, 152, 219, 0.2), rgba(142, 68, 173, 0.2));
  border: 1px solid var(--accent); padding: 15px; border-radius: 8px;
  margin-top: 20px; border-left: 5px solid var(--accent);
}

/* Support Section Styles */
.support-card {
  background: rgba(0,0,0,0.4); border: 1px solid rgba(255,215,0,0.2);
  border-radius: 12px; padding: 20px; margin-top: 30px;
  text-align: center; box-shadow: 0 0 20px rgba(0,0,0,0.5);
}
.support-title {
  color: var(--gold); font-family: 'Cinzel', serif; font-size: 1.5em;
  margin-bottom: 15px; letter-spacing: 2px;
}
.qr-container {
  background: #fff; padding: 10px; display: inline-block;
  border-radius: 8px; margin: 15px 0; min-width: 150px; min-height: 150px;
}
.qr-placeholder {
  width: 150px; height: 150px; display: flex; align-items: center; justify-content: center;
  color: #333; font-weight: bold; font-size: 0.8em; border: 2px dashed #ccc;
}
.address-block {
  background: rgba(255,255,255,0.05); padding: 10px; border-radius: 6px;
  font-family: monospace; font-size: 0.9em; margin-bottom: 15px; word-break: break-all;
}
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
  background: var(--gold); color: #000; padding: 10px 20px; border-radius: 20px;
  font-weight: bold; box-shadow: 0 5px 15px rgba(0,0,0,0.5);
  animation: toast-fade 2s forwards; z-index: 10000;
}
@keyframes toast-fade {
  0% { opacity: 0; transform: translate(-50%, 20px); }
  20% { opacity: 1; transform: translate(-50%, 0); }
  80% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -20px); }
}

/* Match-3 Juicy Effects */
.tile.matched {
  z-index: 100;
  pointer-events: none;
}
.match-3 { animation: shimmer-green 1s ease-in-out infinite; }
.match-4 { animation: shimmer-purple 1s ease-in-out infinite; }
.match-5 { animation: shimmer-red 1s ease-in-out infinite; }

@keyframes shimmer-green {
  0%, 100% { box-shadow: inset 0 0 10px #2ecc71; transform: scale(1); }
  50% { box-shadow: inset 0 0 30px #2ecc71, 0 0 15px #2ecc71; transform: scale(1.05); }
}
@keyframes shimmer-purple {
  0%, 100% { box-shadow: inset 0 0 15px #9b59b6; transform: scale(1); }
  50% { box-shadow: inset 0 0 40px #9b59b6, 0 0 20px #9b59b6; transform: scale(1.1); }
}
@keyframes shimmer-red {
  0%, 100% { box-shadow: inset 0 0 20px #e74c3c; transform: scale(1); }
  50% { box-shadow: inset 0 0 60px #e74c3c, 0 0 30px #e74c3c; transform: scale(1.2); }
}

.sparkle {
  position: absolute; width: 100%; height: 100%;
  top: 0; left: 0; pointer-events: none;
  background: radial-gradient(circle, #fff 10%, transparent 70%);
  border-radius: 50%; opacity: 0;
  animation: spark-burst 0.3s ease-out;
}
@keyframes spark-burst {
  0% { transform: scale(0); opacity: 1; }
  100% { transform: scale(2); opacity: 0; }
}

.tile.removing {
  transform: scale(0);
  opacity: 0;
  transition: all 0.3s ease-in;
}

/* Special Tiles */
.tile.rune { border: 2px solid #3498db; box-shadow: 0 0 10px #3498db; }
.tile.orb { border: 2px solid #f1c40f; box-shadow: 0 0 15px #f1c40f; border-radius: 50%; }
.tile.nova { border: 2px solid #e67e22; box-shadow: 0 0 10px #e67e22; transform: rotate(45deg); }
.tile.nova .tile-img { transform: rotate(-45deg); }

.tile-badge {
  position: absolute; top: -5px; right: -5px; background: var(--gold);
  color: #000; border-radius: 50%; width: 18px; height: 18px;
  font-size: 10px; font-weight: bold; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 5px #000;
}

/* Relics */
.relics-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.relic-icon {
  width: 35px; height: 35px; background: rgba(0,0,0,0.5); border: 1px solid var(--gold);
  border-radius: 4px; display: flex; align-items: center; justify-content: center;
  cursor: help; font-size: 18px; position: relative;
}
.relic-icon:hover { box-shadow: 0 0 10px var(--gold); }

/* Event Panel */
.event-panel {
  text-align: center; padding: 20px;
}
.event-title { color: var(--gold); font-family: 'Cinzel', serif; font-size: 1.8em; margin-bottom: 15px; }
.event-desc { color: #ccc; margin-bottom: 25px; line-height: 1.6; }
.event-choices { display: flex; flex-direction: column; gap: 10px; }
.choice-btn {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  color: #fff; padding: 12px; border-radius: 6px; cursor: pointer;
  transition: all 0.2s; font-family: 'Outfit', sans-serif;
}
.choice-btn:hover { background: rgba(255,215,0,0.1); border-color: var(--gold); }
.choice-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.relic-choice-container {
  display: flex; justify-content: center; gap: 15px; margin-top: 20px;
}
.relic-option {
  flex: 1; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,215,0,0.2);
  padding: 15px; border-radius: 8px; cursor: pointer; transition: 0.3s;
}
.relic-option:hover { border-color: var(--gold); background: rgba(255,215,0,0.05); }

/* Chest and Death Systems */
.chest-panel { text-align: center; }
.chest-icon-large { font-size: 5em; margin-bottom: 15px; filter: drop-shadow(0 0 15px currentColor); animation: pulse 2s infinite ease-in-out; }
.rewards-list { display: flex; flex-direction: column; gap: 8px; margin-top: 15px; max-height: 300px; overflow-y: auto; padding-right: 5px; }
.reward-item { background: rgba(0,0,0,0.5); padding: 10px; border-radius: 6px; display: flex; align-items: center; border: 1px solid #444; animation: slideIn 0.3s ease-out; }

@keyframes pulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 10px currentColor); }
  50% { transform: scale(1.1); filter: drop-shadow(0 0 25px currentColor); }
}

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

/* Dice Animations */
.dice-anim {
  display: inline-block;
  transition: transform 0.1s;
}
.dice-anim.rolling {
  animation: dice-shake 0.1s infinite;
}
@keyframes dice-shake {
  0% { transform: translate(1px, 1px) rotate(0deg); }
  10% { transform: translate(-1px, -2px) rotate(-1deg); }
  20% { transform: translate(-3px, 0px) rotate(1deg); }
  30% { transform: translate(3px, 2px) rotate(0deg); }
  40% { transform: translate(1px, -1px) rotate(1deg); }
  50% { transform: translate(-1px, 2px) rotate(-1deg); }
  60% { transform: translate(-3px, 1px) rotate(0deg); }
  70% { transform: translate(3px, 1px) rotate(-1deg); }
  80% { transform: translate(-1px, -1px) rotate(1deg); }
  90% { transform: translate(1px, 2px) rotate(0deg); }
  100% { transform: translate(1px, -2px) rotate(-1deg); }
}
/* Multi-enemy Combat Styles */
.enemy-card {
  transition: all 0.3s ease;
  min-width: 100px;
}
.enemy-card.target {
  box-shadow: 0 0 15px var(--gold);
  transform: translateY(-5px) scale(1.05);
  border-color: var(--gold) !important;
  background: rgba(212, 175, 55, 0.1) !important;
}
.enemy-card.dead {
  filter: grayscale(1) brightness(0.5);
  opacity: 0.5;
  pointer-events: none;
  transform: scale(0.9);
}
.enemy-card:hover:not(.dead):not(.target) {
  background: rgba(255,255,255,0.1) !important;
  border-color: #555 !important;
}

/* Changelog Styles */
.changelog-container {
  padding: 10px;
}
.changelog-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 20px;
  position: relative;
  transition: transform 0.3s ease, border-color 0.3s ease;
}
.changelog-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}
.changelog-card.today {
  background: rgba(241, 196, 15, 0.05);
  border: 1px solid var(--gold);
  box-shadow: 0 0 15px rgba(241, 196, 15, 0.1);
}
.changelog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.changelog-date {
  font-family: 'Courier New', Courier, monospace;
  color: #888;
  font-size: 0.9em;
  font-weight: bold;
}
.changelog-badge {
  background: var(--gold);
  color: #000;
  font-size: 10px;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 1px;
}
.changelog-title {
  margin: 0 0 12px 0;
  color: var(--accent);
  font-size: 1.2em;
}
.changelog-entries {
  margin: 0;
  padding-left: 20px;
  color: #bbb;
  font-size: 0.95em;
  line-height: 1.6;
}
.changelog-entries li {
  margin-bottom: 6px;
}
.changelog-list::-webkit-scrollbar {
  width: 6px;
}
.changelog-list::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.2);
  border-radius: 10px;
}
.changelog-list::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 10px;
}

/* Footer */
footer {
  position: fixed; bottom: 0; left: 0;
  width: 100%; padding: 10px; background: var(--footer-bg); text-align: center;
  font-size: 14px; border-top: 1px solid rgba(255,255,255,0.1);
  z-index: 1000;
}
footer a { color: var(--accent); text-decoration: none; transition: 0.3s; }
footer a:hover { text-shadow: 0 0 10px var(--accent); opacity: 0.8; }

/* Elite Enemy UI */
.elite-badge { background: var(--gold); color: #000; padding: 2px 8px; border-radius: 4px; font-weight: bold; font-size: 12px; margin-bottom: 5px; animation: glow 1.5s infinite alternate; display: inline-block; }
@keyframes glow { from { box-shadow: 0 0 5px var(--gold); } to { box-shadow: 0 0 15px var(--gold); } }

.enemy-poison-text { color: var(--c-green); font-weight: bold; font-size: 12px; margin-top: 5px; }

