/* style.css - AAA Dark Fantasy RPG Presentation */
:root {
  --bg-dark: #09060f;
  --bg-panel: rgba(16, 12, 24, 0.88);
  --border-gold: #c59b48;
  --border-dim: rgba(197, 155, 72, 0.3);
  --accent-gold: #f2be5c;
  --accent-crimson: #d92b2b;
  --accent-blue: #3ba4ff;
  --accent-purple: #9b51e0;
  --accent-green: #2ecc71;
  --text-primary: #f5f2eb;
  --text-muted: #a39cae;
  --font-serif: 'Cinzel', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-dark);
  font-family: var(--font-sans);
  color: var(--text-primary);
  touch-action: none;
}

#canvas-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* SCREEN OVERLAYS */
.screen-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

#last-stand-overlay {
  background: radial-gradient(circle, transparent 40%, rgba(180, 20, 20, 0.65) 100%);
  animation: pulseLastStand 1.2s infinite alternate ease-in-out;
}

@keyframes pulseLastStand {
  0% { box-shadow: inset 0 0 50px rgba(255, 0, 0, 0.4); }
  100% { box-shadow: inset 0 0 120px rgba(255, 30, 30, 0.85); }
}

.last-stand-badge {
  position: absolute;
  top: 75px;
  background: linear-gradient(180deg, #aa1111, #550000);
  border: 2px solid #ff4444;
  color: #fff;
  font-family: var(--font-serif);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 2px;
  padding: 8px 24px;
  border-radius: 4px;
  box-shadow: 0 0 30px rgba(255, 0, 0, 0.7);
  animation: bounceBadge 0.6s infinite alternate ease-in-out;
}

#war-horn-overlay {
  background: radial-gradient(circle, transparent 50%, rgba(200, 150, 20, 0.45) 100%);
  box-shadow: inset 0 0 80px rgba(255, 215, 0, 0.5);
}

.war-horn-badge {
  position: absolute;
  top: 75px;
  background: linear-gradient(180deg, #d4af37, #855e10);
  border: 2px solid #ffe066;
  color: #000;
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 1.1rem;
  letter-spacing: 2px;
  padding: 8px 24px;
  border-radius: 4px;
  box-shadow: 0 0 35px rgba(255, 215, 0, 0.8);
}

.war-horn-timer {
  position: absolute;
  top: 120px;
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 800;
  color: #ffd700;
  text-shadow: 0 0 12px #ffbb00;
}

@keyframes bounceBadge {
  0% { transform: translateY(0); }
  100% { transform: translateY(-4px); }
}

/* NARRATOR BANNER */
#narrator-banner {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(180deg, rgba(25, 18, 38, 0.95), rgba(12, 8, 20, 0.95));
  border: 1px solid var(--border-gold);
  border-radius: 6px;
  padding: 10px 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7), 0 0 20px rgba(197, 155, 72, 0.25);
  backdrop-filter: blur(12px);
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
  max-width: 90%;
  text-align: center;
}

#narrator-banner.hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(-25px);
}

.narrator-title {
  display: block;
  font-family: var(--font-serif);
  font-size: 0.7rem;
  letter-spacing: 2px;
  color: var(--accent-gold);
  margin-bottom: 2px;
}

#narrator-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

/* LOBBY SCREENS */
.ui-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 24px 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: radial-gradient(circle at 50% 20%, #1e1333 0%, var(--bg-dark) 85%);
  transition: opacity 0.3s ease;
}

.ui-screen.hidden {
  display: none !important;
}

.lobby-container {
  width: 100%;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: auto 0;
}

.game-header {
  text-align: center;
  margin-top: 10px;
}

.game-title {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--accent-gold);
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.9), 0 0 25px rgba(242, 190, 92, 0.4);
}

.game-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-top: 4px;
}

.connection-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 4px 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f39c12;
  box-shadow: 0 0 8px #f39c12;
}

.connection-badge.connected .status-dot {
  background: #2ecc71;
  box-shadow: 0 0 8px #2ecc71;
}

.connection-badge.connected #status-text {
  color: #2ecc71;
}

/* Character Select */
.character-select-section {
  background: var(--bg-panel);
  border: 1px solid var(--border-dim);
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(16px);
}

.input-group {
  margin-bottom: 16px;
}

.input-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--accent-gold);
  margin-bottom: 6px;
  text-transform: uppercase;
}

input[type="text"] {
  width: 100%;
  background: rgba(8, 6, 12, 0.8);
  border: 1px solid var(--border-dim);
  border-radius: 6px;
  padding: 12px 14px;
  font-size: 1rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.2s;
}

input[type="text"]:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 10px rgba(242, 190, 92, 0.3);
}

.section-title {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-align: center;
}

.class-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

@media (max-width: 480px) {
  .class-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.class-btn {
  background: rgba(25, 18, 38, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.class-btn:hover, .class-btn.selected {
  background: rgba(60, 40, 85, 0.85);
  border-color: var(--accent-gold);
  box-shadow: 0 0 16px rgba(242, 190, 92, 0.35);
  transform: translateY(-2px);
}

.class-icon {
  font-size: 1.8rem;
}

.class-name {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.class-role {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.class-preview-card {
  background: rgba(10, 8, 16, 0.6);
  border-left: 3px solid var(--accent-gold);
  padding: 14px;
  border-radius: 6px;
}

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

.preview-header h2 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--accent-gold);
}

.role-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(242, 190, 92, 0.2);
  color: var(--accent-gold);
  border: 1px solid rgba(242, 190, 92, 0.4);
}

#preview-class-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.abilities-preview {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ability-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 0.8rem;
}

.ability-tag {
  font-weight: 700;
  color: var(--accent-gold);
  min-width: 60px;
}

.ability-desc {
  color: var(--text-primary);
}

/* Room Action Section */
.room-action-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn {
  width: 100%;
  padding: 14px 20px;
  border-radius: 8px;
  font-family: var(--font-serif);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 1.5px;
  cursor: pointer;
  border: none;
  outline: none;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(180deg, #d4af37, #997316);
  color: #0c0812;
  box-shadow: 0 4px 20px rgba(212, 175, 55, 0.4);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  background: rgba(45, 30, 65, 0.85);
  color: var(--text-primary);
  border: 1px solid var(--border-gold);
}

.btn-large {
  padding: 18px 24px;
  font-size: 1.1rem;
}

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 1px;
  margin: 6px 0;
}

.divider::before, .divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.divider span {
  padding: 0 10px;
}

.join-room-box {
  display: flex;
  gap: 10px;
}

.join-room-box input {
  text-align: center;
  font-family: var(--font-serif);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 3px;
  text-transform: uppercase;
}

/* Room Lobby Screen */
.room-header {
  text-align: center;
  background: var(--bg-panel);
  border: 1px solid var(--border-dim);
  border-radius: 12px;
  padding: 20px;
}

.room-code-label {
  font-size: 0.75rem;
  letter-spacing: 2px;
  color: var(--text-muted);
}

.display-code {
  font-family: var(--font-serif);
  font-size: 3.5rem;
  font-weight: 900;
  letter-spacing: 6px;
  color: var(--accent-gold);
  text-shadow: 0 0 25px rgba(242, 190, 92, 0.5);
  margin: 4px 0;
}

.invite-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.party-members-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0;
}

.party-member-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-panel);
  border: 1px solid var(--border-dim);
  border-radius: 8px;
  padding: 12px 16px;
}

.member-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.member-name {
  font-weight: 700;
}

.member-role-badge {
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

.bot-notice {
  background: rgba(30, 20, 50, 0.6);
  border: 1px dashed var(--border-dim);
  border-radius: 8px;
  padding: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

/* IN-GAME HUD */
#game-hud {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 15;
  pointer-events: none;
}

#game-hud.hidden {
  display: none !important;
}

/* Top Bar */
.hud-top-bar {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none; /* Never blocks menu or status buttons */
}

.party-status-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 54px; /* Offset below the top-left menu button */
  pointer-events: auto;
}

.party-portrait-hud {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(12, 9, 20, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 4px 8px;
  backdrop-filter: blur(8px);
  min-width: 140px;
}

.party-portrait-hud.downed {
  border-color: #ff3333;
  animation: pulseDowned 0.8s infinite alternate;
}

@keyframes pulseDowned {
  0% { background: rgba(80, 10, 10, 0.8); }
  100% { background: rgba(140, 20, 20, 0.9); }
}

.portrait-icon {
  font-size: 1.1rem;
}

.portrait-bars {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.portrait-name {
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}

.portrait-hp-track {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 3px;
  overflow: hidden;
}

.portrait-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #2ecc71, #27ae60);
  transition: width 0.2s ease;
}

/* Boss Bar */
.boss-hud {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(92%, 460px);
  background: rgba(16, 10, 24, 0.9);
  border: 1px solid var(--border-gold);
  border-radius: 8px;
  padding: 8px 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  pointer-events: none;
}

.boss-hud.hidden {
  display: none;
}

.boss-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.boss-name {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  font-weight: 800;
  color: #ff5533;
  letter-spacing: 1px;
}

.phase-tag {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  background: rgba(255, 85, 51, 0.2);
  border: 1px solid #ff5533;
  border-radius: 4px;
  color: #ff7755;
}

.boss-hp-track {
  position: relative;
  width: 100%;
  height: 12px;
  background: rgba(0, 0, 0, 0.85);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.boss-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff3300, #ff7700);
  transition: width 0.2s ease;
}

.boss-hp-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.65rem;
  font-weight: 800;
  text-shadow: 0 1px 3px #000;
}

/* War Horn Button */
.war-horn-btn {
  background: linear-gradient(180deg, #d4af37, #855e10);
  border: 2px solid #ffe066;
  border-radius: 50%;
  width: 52px;
  height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(255, 215, 0, 0.5);
  transition: all 0.2s;
  pointer-events: auto;
}

.war-horn-btn:active {
  transform: scale(0.92);
}

.horn-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.horn-label {
  font-size: 0.5rem;
  font-weight: 900;
  color: #000;
  letter-spacing: 0.5px;
}

/* Secret Objective Button & Slide-Out */
.secret-tab-btn {
  background: rgba(25, 18, 38, 0.85);
  border: 1px solid var(--border-gold);
  border-radius: 6px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  pointer-events: auto;
}

.secret-label {
  font-family: var(--font-serif);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-gold);
}

.secret-card {
  position: absolute;
  top: 70px;
  right: 12px;
  width: 280px;
  background: rgba(16, 12, 24, 0.95);
  border: 1px solid var(--border-gold);
  border-radius: 8px;
  padding: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(14px);
  pointer-events: auto;
  z-index: 30;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.secret-card.hidden {
  opacity: 0;
  transform: translateY(-20px);
  pointer-events: none;
}

.secret-stamp {
  display: block;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--accent-crimson);
  margin-bottom: 4px;
}

.secret-card h3 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--accent-gold);
  margin-bottom: 6px;
}

.secret-card p {
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.secret-reward {
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 8px;
  margin-bottom: 10px;
}

.btn-sm {
  width: 100%;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
}

/* CONTROLS: Mobile Floating Virtual Joystick */
.joystick-zone {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 48%;
  height: 52%;
  pointer-events: auto;
  touch-action: none;
}

.joystick-base {
  position: absolute;
  width: 130px;
  height: 130px;
  margin-left: -65px;
  margin-top: -65px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(242, 190, 92, 0.1) 0%, rgba(16, 12, 24, 0.5) 70%);
  border: 2px solid rgba(242, 190, 92, 0.4);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

.joystick-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 54px;
  height: 54px;
  margin-left: -27px;
  margin-top: -27px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-gold) 0%, #a67c1e 100%);
  border: 2px solid #fff;
  box-shadow: 0 0 16px rgba(242, 190, 92, 0.8);
  transition: transform 0.05s ease-out;
}

/* CONTROLS: Mobile Ability Thumb Arc (Right) */
.abilities-zone {
  position: absolute;
  bottom: 24px;
  right: 18px;
  width: 210px;
  height: 230px;
  pointer-events: auto;
}

.action-btn {
  position: absolute;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  touch-action: none;
  transition: transform 0.1s ease;
}

.action-btn:active {
  transform: scale(0.92);
}

/* Large Center Attack Button */
.attack-btn {
  right: 0;
  bottom: 0;
  width: 82px;
  height: 82px;
  background: radial-gradient(circle, #b83320 0%, #661008 100%);
  border: 3px solid #ff6644;
  box-shadow: 0 0 24px rgba(255, 70, 30, 0.6);
}

.attack-icon {
  font-size: 2.2rem;
}

/* Ability Buttons arranged in ergonomic right-side arc */
.skill-btn {
  width: 58px;
  height: 58px;
  background: radial-gradient(circle, rgba(40, 28, 60, 0.95) 0%, rgba(18, 12, 28, 0.95) 100%);
  border: 2px solid var(--border-gold);
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.6);
}

.skill-btn.ultimate {
  border-color: #ff33aa;
  box-shadow: 0 0 20px rgba(255, 51, 170, 0.5);
}

/* Ergonomic Arc Positioning:
   - Skill 1 (Shadowstep): Bottom-Left of Attack
   - Dash: Between Skill 1 (Shadowstep) and Skill 2 (Tar Bomb)
   - Skill 2 (Tar Bomb): Diagonal North-West of Attack
   - Skill 3 (Eviscerate): North of Attack
   - Jump: North of Eviscerate & Tar Bomb, right in between them
*/
#btn-skill-1 {
  bottom: 0;
  right: 104px;
}

#btn-dash {
  bottom: 56px !important;
  right: 132px !important;
  width: 54px !important;
  height: 54px !important;
}

#btn-skill-2 {
  bottom: 96px;
  right: 76px;
}

#btn-skill-3 {
  bottom: 112px;
  right: 0;
}

#btn-jump {
  bottom: 164px !important;
  right: 42px !important;
  width: 56px !important;
  height: 56px !important;
}

.ping-trigger-btn {
  bottom: 168px;
  right: 116px;
  top: auto;
  left: auto;
  width: 40px;
  height: 40px;
  background: rgba(20, 16, 32, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 1.1rem;
}

.skill-icon {
  font-size: 1.4rem;
}

.skill-label {
  position: absolute;
  bottom: -16px;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent-gold);
  text-shadow: 0 1px 3px #000;
}

.skill-cooldown-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  pointer-events: none;
  clip-path: polygon(50% 50%, 50% 0%, 100% 0%, 100% 100%, 0% 100%, 0% 0%, 50% 0%);
  display: none;
}

/* PING RADIAL & TACTICAL BAR */
.ping-wheel-overlay {
  position: absolute;
  bottom: 235px;
  right: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(14, 10, 22, 0.94);
  border: 1px solid var(--border-gold);
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  z-index: 35;
  pointer-events: auto;
  transition: all 0.2s ease;
}

.ping-wheel-overlay.hidden {
  display: none !important;
}

.ping-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 8px;
  font-family: var(--font-serif);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 0.15s ease;
}

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

.ping-attack {
  background: rgba(180, 40, 30, 0.8);
  color: #ffcccc;
  border-color: #ff4433;
}
.ping-attack:hover {
  box-shadow: 0 0 14px rgba(255, 50, 40, 0.6);
}

.ping-regroup {
  background: rgba(30, 100, 180, 0.8);
  color: #cce4ff;
  border-color: #3ba4ff;
}
.ping-regroup:hover {
  box-shadow: 0 0 14px rgba(59, 164, 255, 0.6);
}

.ping-loot {
  background: rgba(180, 140, 20, 0.8);
  color: #fff4cc;
  border-color: #ffd700;
}
.ping-loot:hover {
  box-shadow: 0 0 14px rgba(255, 215, 0, 0.6);
}

.ping-help {
  background: rgba(35, 140, 70, 0.8);
  color: #ccffd8;
  border-color: #2ecc71;
}
.ping-help:hover {
  box-shadow: 0 0 14px rgba(46, 204, 113, 0.6);
}

/* NEED / GREED MODAL */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 40;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}

.modal-overlay.hidden {
  display: none !important;
}

.need-greed-card {
  width: min(90%, 420px);
  background: linear-gradient(180deg, #1f1430, #0d0816);
  border: 2px solid var(--border-gold);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 0 50px rgba(242, 190, 92, 0.4);
}

.loot-rarity-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  padding: 4px 12px;
  border-radius: 4px;
  background: linear-gradient(90deg, #d4af37, #ff6600);
  color: #000;
  margin-bottom: 10px;
}

.loot-item-name {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: #fff;
  margin-bottom: 6px;
}

.loot-timer {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.need-greed-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.roll-btn {
  padding: 12px 6px;
  border-radius: 8px;
  font-family: var(--font-serif);
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  border: none;
}

.roll-btn.need {
  background: linear-gradient(180deg, #d92b2b, #801010);
  color: #fff;
  border: 1px solid #ff4444;
}

.roll-btn.greed {
  background: linear-gradient(180deg, #d4af37, #855e10);
  color: #000;
  border: 1px solid #ffe066;
}

.roll-btn.pass {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.roll-results-stream {
  min-height: 48px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* END OF RUN PODIUM SCREEN */
.victory-container {
  width: 100%;
  max-width: 680px;
  background: var(--bg-panel);
  border: 1px solid var(--border-gold);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: auto 0;
}

.podium-header {
  text-align: center;
}

.victory-title {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  color: var(--accent-gold);
  text-shadow: 0 0 25px rgba(242, 190, 92, 0.5);
}

.victory-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.total-score-badge {
  display: inline-block;
  background: rgba(242, 190, 92, 0.15);
  border: 1px solid var(--border-gold);
  border-radius: 8px;
  padding: 10px 24px;
  margin-top: 12px;
}

.total-score-badge span {
  font-size: 0.7rem;
  letter-spacing: 2px;
  color: var(--accent-gold);
}

.total-score-badge h2 {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  color: #fff;
}

/* Play of the Game */
.potg-section {
  background: linear-gradient(135deg, rgba(80, 20, 40, 0.7), rgba(20, 10, 30, 0.7));
  border: 1px solid #ff4477;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}

.potg-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 2px;
  color: #ff4477;
  background: rgba(255, 68, 119, 0.2);
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 6px;
}

.potg-hero {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: #fff;
}

.potg-title {
  font-size: 1rem;
  color: var(--accent-gold);
  margin-bottom: 4px;
}

.potg-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Stats Table */
.stats-table-container {
  overflow-x: auto;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.stats-table th {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-dim);
  color: var(--accent-gold);
  font-family: var(--font-serif);
}

.stats-table td {
  padding: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.audio-prompt {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.75rem;
  color: var(--text-muted);
  pointer-events: none;
  z-index: 50;
  transition: opacity 0.5s;
}

.hidden {
  display: none !important;
}
