/**
 * POLITICAL PAC-MAN: THE SANSAD SHOWDOWN
 * Neon Sansad Retro Arcade Stylesheet
 */

:root {
  --saffron: #FF9933;
  --white: #FFFFFF;
  --green: #138808;
  --gold: #FFD700;
  --bg-dark: #060c18;
  --panel-bg: rgba(13, 27, 42, 0.95);
  --border-neon: rgba(255, 153, 51, 0.6);
  --font-arcade: 'Courier New', Courier, monospace;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--white);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 50% 20%, rgba(255, 153, 51, 0.08) 0%, transparent 60%),
    radial-gradient(circle at 50% 80%, rgba(19, 136, 8, 0.08) 0%, transparent 60%);
}

/* Main Container */
.game-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 680px;
  padding: 10px;
}

/* Header & HUD */
.sansad-header {
  width: 100%;
  text-align: center;
  margin-bottom: 8px;
}

.game-title {
  font-family: var(--font-arcade);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--gold);
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.6), 2px 2px 0 #FF9933;
}

.game-subtitle {
  font-size: 11px;
  color: #90CAF9;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 2px;
}

/* In-Game HUD Bar */
.hud-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 560px;
  max-width: 100%;
  background: var(--panel-bg);
  border: 1px solid var(--border-neon);
  border-radius: 8px;
  padding: 6px 14px;
  margin-bottom: 6px;
  box-shadow: 0 0 12px rgba(255, 153, 51, 0.2);
}

.hud-item {
  display: flex;
  flex-direction: column;
}

.hud-label {
  font-size: 10px;
  color: #B0BEC5;
  text-transform: uppercase;
  font-weight: bold;
}

.hud-val {
  font-family: var(--font-arcade);
  font-size: 16px;
  color: var(--gold);
  font-weight: bold;
}

.life-kursi {
  font-size: 18px;
  filter: drop-shadow(0 0 4px var(--gold));
}

/* Ghost Roster Status Bar */
.ghost-roster-status {
  display: flex;
  gap: 8px;
  width: 560px;
  max-width: 100%;
  justify-content: center;
  margin-bottom: 6px;
}

.ghost-pill-item {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(10, 20, 35, 0.8);
  border: 1px solid;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: bold;
}

.pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* Ability Meter HUD */
.ability-meter-container {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 560px;
  max-width: 100%;
  margin-bottom: 8px;
}

.ability-progress-track {
  flex: 1;
  height: 14px;
  background: #1c2738;
  border: 1px solid #455a64;
  border-radius: 7px;
  overflow: hidden;
  position: relative;
}

.ability-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #FF9933, #FFD700);
  transition: width 0.15s ease-out;
}

.ability-progress-fill.ready {
  background: linear-gradient(90deg, #00E676, #FFD700);
  box-shadow: 0 0 10px #00E676;
  animation: pulseGlow 1s infinite alternate;
}

@keyframes pulseGlow {
  0% { filter: brightness(1); }
  100% { filter: brightness(1.4); }
}

.ability-action-btn {
  background: #37474f;
  color: #cfd8dc;
  border: 1px solid #546e7a;
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
}

.ability-action-btn.ready {
  background: linear-gradient(135deg, #FF9933, #E65100);
  color: #FFFFFF;
  border-color: #FFD700;
  box-shadow: 0 0 10px rgba(255, 153, 51, 0.8);
  cursor: pointer;
  animation: pulseGlow 0.8s infinite alternate;
}

/* Canvas Viewport */
.canvas-container {
  position: relative;
  width: 560px;
  height: 620px;
  max-width: 100%;
  background: #000;
  border: 2px solid var(--saffron);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 25px rgba(255, 153, 51, 0.35);
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* CRT Scanlines Overlay */
.crt-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(
    rgba(18, 16, 16, 0) 50%, 
    rgba(0, 0, 0, 0.25) 50%
  );
  background-size: 100% 4px;
}

/* Modal Screens Overlay */
.screen-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(6, 12, 24, 0.96);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 14px 12px;
  text-align: center;
  z-index: 50;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--saffron) rgba(0, 0, 0, 0.5);
}

#screenTitle, #screenGameOver, #screenVictory {
  justify-content: center;
}

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

/* Title Screen Styling */
.title-banner {
  margin-bottom: 20px;
}

.parliament-crest {
  font-size: 42px;
  margin-bottom: 8px;
}

.title-main {
  font-family: var(--font-arcade);
  font-size: 26px;
  color: var(--gold);
  letter-spacing: 2px;
  text-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
}

.title-sub {
  color: #81D4FA;
  font-size: 13px;
  letter-spacing: 1px;
  margin-top: 4px;
}

.instructions-box {
  background: rgba(13, 27, 42, 0.85);
  border: 1px solid var(--border-neon);
  border-radius: 8px;
  padding: 12px 18px;
  max-width: 440px;
  margin-bottom: 24px;
  text-align: left;
  font-size: 12px;
  line-height: 1.6;
}

.instructions-box h4 {
  color: var(--gold);
  margin-bottom: 6px;
  text-align: center;
}

.btn-arcade-start {
  background: linear-gradient(135deg, #FF9933, #FF6F00);
  color: #FFFFFF;
  font-family: var(--font-arcade);
  font-size: 16px;
  font-weight: bold;
  padding: 12px 32px;
  border: 2px solid var(--gold);
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(255, 153, 51, 0.8);
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-arcade-start:hover {
  transform: scale(1.05);
  box-shadow: 0 0 25px rgba(255, 215, 0, 1);
}

/* Character Selection Screen */
.select-header {
  margin-bottom: 12px;
}

.select-title {
  color: var(--gold);
  font-size: 20px;
  font-weight: bold;
}

.select-desc {
  font-size: 12px;
  color: #B0BEC5;
}

/* Difficulty Mode Selector Box */
.difficulty-picker-box {
  width: 100%;
  max-width: 520px;
  background: rgba(13, 27, 42, 0.85);
  border: 1px solid var(--border-neon);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.diff-picker-title {
  font-family: var(--font-arcade);
  font-size: 11px;
  color: var(--gold);
  letter-spacing: 1px;
  font-weight: bold;
}

.diff-btn-group {
  display: flex;
  gap: 8px;
  width: 100%;
  justify-content: center;
  flex-wrap: wrap;
}

.diff-pill-btn {
  background: #1c2738;
  color: #B0BEC5;
  border: 1px solid #455a64;
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
}

.diff-pill-btn:hover {
  filter: brightness(1.2);
}

.diff-pill-btn[data-diff="EASY"].active {
  background: linear-gradient(135deg, #00C853, #00E676);
  color: #000000;
  border-color: #69F0AE;
  box-shadow: 0 0 12px rgba(0, 230, 118, 0.7);
}

.diff-pill-btn[data-diff="MEDIUM"].active {
  background: linear-gradient(135deg, #F57F17, #FFD600);
  color: #000000;
  border-color: #FFFF00;
  box-shadow: 0 0 12px rgba(255, 214, 0, 0.7);
}

.diff-pill-btn[data-diff="HARD"].active {
  background: linear-gradient(135deg, #D50000, #FF1744);
  color: #FFFFFF;
  border-color: #FF8A80;
  box-shadow: 0 0 14px rgba(255, 23, 68, 0.8);
}

.diff-caption {
  font-size: 10.5px;
  color: #ECEFF1;
  text-align: center;
  min-height: 16px;
}

.diff-hud-val {
  font-weight: 900;
  letter-spacing: 1px;
  font-size: 13px;
}

.draft-diff-badge {
  display: inline-block;
  margin-top: 6px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid #FF1744;
  border-radius: 12px;
  padding: 3px 12px;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 1px;
}

.roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  width: 100%;
  padding: 6px 2px;
  margin-bottom: 16px;
}

.character-card {
  background: rgba(13, 27, 42, 0.95);
  border: 2px solid;
  border-radius: 8px;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  position: relative;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.character-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(255, 153, 51, 0.35);
  filter: brightness(1.08);
}

.card-avatar-portrait-wrap {
  width: 76px;
  height: 76px;
  border-radius: 12px;
  border: 2px solid;
  overflow: hidden;
  background: #060e1a;
  box-shadow: 0 0 12px rgba(255, 153, 51, 0.4);
  margin-bottom: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.2s ease;
}

.character-card:hover .card-avatar-portrait-wrap {
  transform: scale(1.06);
}

.card-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.draft-hero-portrait-wrap {
  width: 68px;
  height: 68px;
  border-radius: 12px;
  border: 3px solid;
  overflow: hidden;
  background: #060e1a;
  box-shadow: 0 0 14px rgba(255, 215, 0, 0.6);
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.draft-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.draft-ghost-portrait-wrap {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  border: 2px solid;
  overflow: hidden;
  background: #091426;
  margin: 0 auto 6px auto;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
}

.draft-ghost-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.char-name {
  font-size: 16px;
  font-weight: bold;
}

.char-real {
  font-size: 11px;
  color: #90A4AE;
  margin-bottom: 4px;
}

.char-title {
  font-size: 11px;
  font-weight: 600;
  color: #FFE082;
  margin-bottom: 4px;
}

.char-quote {
  font-size: 10px;
  font-style: italic;
  color: #E0E0E0;
  margin-bottom: 8px;
}

.ability-info {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
  text-align: left;
}

.ability-pill {
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 10px;
}

.ghost-pill {
  background: rgba(239, 83, 80, 0.15);
  border-left: 3px solid #EF5350;
}

.player-pill {
  background: rgba(76, 175, 80, 0.15);
  border-left: 3px solid #4CAF50;
}

.ability-desc {
  font-size: 9px;
  color: #CFD8DC;
  margin-top: 2px;
}

.btn-select-char {
  width: 100%;
  border: none;
  color: #FFFFFF;
  font-weight: bold;
  font-size: 11px;
  padding: 6px 0;
  border-radius: 4px;
  cursor: pointer;
  text-shadow: 1px 1px 2px #000;
  transition: opacity 0.15s;
}

.btn-select-char:hover {
  opacity: 0.9;
}

/* Opponent Draft Screen */
.draft-hero-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(13, 27, 42, 0.9);
  border: 2px solid;
  border-radius: 8px;
  padding: 10px 18px;
  margin-bottom: 16px;
  text-align: left;
}

.draft-hero-card .badge {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 24px;
  font-weight: bold;
  color: #FFFFFF;
  border: 2px solid #FFF;
}

.draft-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  width: 100%;
  max-width: 480px;
  margin-bottom: 20px;
}

.draft-ghost-card {
  background: rgba(20, 30, 48, 0.85);
  border: 2px solid;
  border-radius: 8px;
  padding: 8px;
  text-align: center;
}

.draft-ghost-card h4 {
  color: #FFFFFF;
  font-size: 14px;
}

.draft-real {
  font-size: 10px;
  color: #90A4AE;
  margin-bottom: 4px;
}

.draft-ability {
  font-size: 10px;
  color: #FFCC80;
  margin-bottom: 2px;
}

.draft-quote {
  font-size: 9px;
  font-style: italic;
  color: #B0BEC5;
}

.draft-action-bar {
  display: flex;
  gap: 12px;
  width: 100%;
  max-width: 480px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 10px;
  margin-bottom: 14px;
}

.btn-arcade-secondary {
  background: #263238;
  color: #ECEFF1;
  font-family: var(--font-arcade);
  font-size: 13px;
  font-weight: bold;
  padding: 11px 20px;
  border: 1px solid #78909C;
  border-radius: 24px;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}

.btn-arcade-secondary:hover {
  background: #37474F;
  border-color: #B0BEC5;
  transform: scale(1.03);
}

/* Game Over / Victory Modal */
.result-box {
  background: var(--panel-bg);
  border: 2px solid var(--gold);
  border-radius: 12px;
  padding: 24px 30px;
  max-width: 420px;
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.4);
}

.result-title {
  font-family: var(--font-arcade);
  font-size: 26px;
  margin-bottom: 8px;
}

.result-title.lose {
  color: #FF5252;
}

.result-title.win {
  color: #00E676;
}

.result-headline {
  font-size: 13px;
  color: #CFD8DC;
  margin-bottom: 12px;
}

.result-score {
  font-family: var(--font-arcade);
  font-size: 18px;
  color: var(--gold);
  margin-bottom: 18px;
}

/* Mobile Controls */
.mobile-controls-panel {
  display: none;
  margin-top: 10px;
  width: 100%;
  max-width: 320px;
  flex-direction: column;
  align-items: center;
}

.dpad-row {
  display: flex;
  gap: 8px;
}

.dpad-btn {
  width: 48px;
  height: 48px;
  background: #1c2738;
  border: 2px solid #455a64;
  border-radius: 8px;
  color: #FFFFFF;
  font-size: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.dpad-btn:active {
  background: var(--saffron);
}

/* Toggle Toolbar */
.toolbar {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.tool-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .canvas-container {
    width: 95vw;
    height: calc(95vw * 1.107);
  }
  .hud-bar, .ability-meter-container, .ghost-roster-status {
    width: 95vw;
  }
  .mobile-controls-panel {
    display: flex;
  }
}
