/* ==========================================================================
   STYLE CSS - SUPERMAR: INVASI AMUNISI GULA (CANDY CRUSH FUN ENHANCEMENT)
   TPG 2026 EDITION - OPTIMIZED FOR 16:9 LANDSCAPE VIEWPORTS
   ========================================================================== */

/* --- General Styling & Cosmic Theme --- */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 8px;
  min-height: 100vh;
  background-color: #0b0f19;
  background-image: 
    radial-gradient(circle at 15% 20%, rgba(74, 222, 128, 0.12), transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(59, 130, 246, 0.15), transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(168, 85, 247, 0.1), transparent 60%),
    url('https://raw.githubusercontent.com/arpit456jain/Amazing-Js-Projects/master/Candy%20Crush/utils/bg.png');
  background-blend-mode: overlay;
  background-size: cover;
  background-position: center;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: 'Montserrat', sans-serif;
  color: #e2e8f0;
  overflow-x: hidden;
}

/* --- Layout Container (16:9 Landscape Optimized) --- */
#gameContainer {
  display: none; /* Dimunculkan saat mode dipilih */
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  max-width: 1240px;
  width: 100%;
  padding: 6px 12px;
  animation: fadeIn 0.35s ease-out;
}

/* --- Top Navigation Bar --- */
.top-nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 12px;
  padding: 6px 14px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
  gap: 12px;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.credits-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 800;
  color: #fef08a;
  white-space: nowrap;
}

.credits-pill .coin-icon {
  font-size: 14px;
}

.incoming-radio-ticker {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(30, 41, 59, 0.6);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  color: #94a3b8;
  max-width: 440px;
  overflow: hidden;
  white-space: nowrap;
  border-left: 3px solid #38bdf8;
}

.radio-blip {
  color: #38bdf8;
  font-weight: 800;
  animation: radioBlink 2s infinite;
}

@keyframes radioBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

#radioTickerText {
  color: #f1f5f9;
  font-style: italic;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-btn {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #f8fafc;
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-btn:hover {
  transform: translateY(-2px);
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
}

.hint-btn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-color: #f59e0b;
  color: white;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.35);
  white-space: nowrap;
  min-width: 95px;
  justify-content: center;
}

.hint-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  background: #475569;
  border-color: #64748b;
  box-shadow: none;
}

.shop-btn {
  background: linear-gradient(135deg, #10b981, #059669);
  border-color: #10b981;
  color: white;
}

.info-btn {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border-color: #818cf8;
  color: white;
}

.audio-controls {
  display: flex;
  gap: 4px;
  border-left: 1px solid rgba(148, 163, 184, 0.3);
  padding-left: 6px;
}

.audio-btn {
  background: #1e293b;
  border: 1px solid #475569;
  color: #94a3b8;
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  font-weight: 800;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
}

.audio-btn.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #38bdf8;
}

/* --- Main Layout Grid 3 Panels --- */
.game-main-layout {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 16px;
  width: 100%;
}

/* --- Left Panel: Cockpit Transmisi Jenderal SuperMar --- */
.cockpitPanel {
  width: 275px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  border: 2px solid rgba(74, 222, 128, 0.4);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 800;
  color: #4ade80;
  letter-spacing: 0.8px;
  border-bottom: 1px solid rgba(74, 222, 128, 0.2);
  padding-bottom: 6px;
}

.signal-dot {
  width: 9px;
  height: 9px;
  background-color: #4ade80;
  border-radius: 50%;
  box-shadow: 0 0 6px #4ade80;
  animation: blinkSignal 1.5s infinite;
}

@keyframes blinkSignal {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.supermar-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.avatar-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  transition: transform 0.3s ease;
}

.supermar-svg {
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.4));
  transition: transform 0.2s ease;
}

/* Mood Animations */
.avatar-container.mood-panic .supermar-svg {
  animation: panicWiggle 0.25s infinite alternate;
}

.avatar-container.mood-happy .supermar-svg {
  animation: happyBounce 0.4s ease-in-out infinite alternate;
}

@keyframes panicWiggle {
  0% { transform: rotate(-3deg) scale(1.02); }
  100% { transform: rotate(3deg) scale(1.02); }
}

@keyframes happyBounce {
  0% { transform: translateY(0); }
  100% { transform: translateY(-5px); }
}

.mood-tag {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.6px;
  padding: 2px 8px;
  border-radius: 10px;
  background: #166534;
  color: #bbf7d0;
  margin-top: 3px;
  text-transform: uppercase;
}

.avatar-container.mood-panic .mood-tag {
  background: #991b1b;
  color: #fecaca;
}

.avatar-container.mood-happy .mood-tag {
  background: #1e40af;
  color: #bfdbfe;
}

/* Balon Dialog SuperMar */
.speech-bubble {
  position: relative;
  background: #1e293b;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 10px;
  padding: 10px 12px;
  width: 100%;
  min-height: 75px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.bubble-arrow {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 7px solid #1e293b;
}

#superMarDialog {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.4;
  color: #f1f5f9;
  font-style: italic;
  transition: opacity 0.2s ease;
}

/* --- Panel Misi Dekontaminasi --- */
.mission-box {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mission-title {
  font-size: 10.5px;
  font-weight: 800;
  color: #fbbf24;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.mission-target-display {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mission-candy-preview {
  width: 36px;
  height: 36px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  background-color: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.mission-text-details {
  display: flex;
  flex-direction: column;
}

.mission-name {
  font-size: 11.5px;
  font-weight: 700;
  color: #f8fafc;
}

.mission-ratio {
  font-size: 10.5px;
  color: #94a3b8;
  font-weight: 600;
}

.mission-bar-bg {
  width: 100%;
  height: 7px;
  background-color: #334155;
  border-radius: 6px;
  overflow: hidden;
}

.mission-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #10b981);
  border-radius: 6px;
  transition: width 0.3s ease;
}

.mission-reward-tag {
  font-size: 9.5px;
  color: #4ade80;
  font-weight: 700;
}

/* Cosmic Event Box */
.cosmic-event-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1px dashed rgba(168, 85, 247, 0.4);
  border-radius: 8px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: #c084fc;
  font-weight: 600;
}

/* In-game Cockpit Sub Navigation (Badges, Lore, Top Skor) */
.cockpit-sub-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px dashed rgba(74, 222, 128, 0.25);
}

.cockpit-nav-btn {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #e2e8f0;
  font-family: 'Montserrat', sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.cockpit-nav-btn:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
  color: #ffffff;
  transform: translateY(-1px);
}

/* --- Center Board Wrapper & Grid Fondasi --- */
.board-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* Boss Battle Box (Hanya Muncul Tiap 3 Round di Endless) */
.boss-battle-box {
  display: none;
  width: 580px;
  background: rgba(15, 23, 42, 0.95);
  border: 2px solid #ef4444;
  border-radius: 12px;
  padding: 8px 12px;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
  animation: popIn 0.3s ease-out;
}

.boss-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
}

.boss-badge {
  background: #ef4444;
  color: white;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 9.5px;
  letter-spacing: 0.5px;
}

.boss-hp-wrapper {
  position: relative;
  width: 100%;
  height: 16px;
  background: #334155;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(239, 68, 68, 0.5);
}

.boss-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #dc2626, #ef4444, #f97316);
  border-radius: 8px;
  transition: width 0.25s ease;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.8);
}

.boss-hp-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 9.5px;
  font-weight: 900;
  color: white;
  text-shadow: 0 1px 3px black;
}

.boss-hint-text {
  font-size: 9.5px;
  color: #fca5a5;
  text-align: center;
}

/* Special Announcer Banner */
.combo-announcer {
  position: absolute;
  top: 35%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 50;
  display: none;
}

.announcer-text {
  font-size: 30px;
  font-weight: 900;
  text-transform: uppercase;
  color: #facc15;
  text-shadow: 0 0 20px rgba(234, 179, 8, 0.9), 0 3px 6px #000;
  background: rgba(15, 23, 42, 0.9);
  border: 3px solid #facc15;
  padding: 8px 22px;
  border-radius: 14px;
  box-shadow: 0 0 30px rgba(250, 204, 21, 0.6);
  animation: announcerPop 1.2s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes announcerPop {
  0% { transform: scale(0.3); opacity: 0; }
  25% { transform: scale(1.15); opacity: 1; }
  40% { transform: scale(1); opacity: 1; }
  80% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.8) translateY(-30px); opacity: 0; }
}

/* Grid Fondasi 8x8 */
.grid {
  display: grid;
  grid-template-columns: repeat(8, 70px);
  grid-template-rows: repeat(8, 70px);
  width: 560px;
  height: 560px;
  box-sizing: content-box;
  padding: 10px;
  border-radius: 16px;
  border: 3px solid rgba(59, 130, 246, 0.5);
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(59, 130, 246, 0.25);
  user-select: none;
  overflow: hidden;
  transition: transform 0.1s ease;
}

.grid.screen-shake {
  animation: shake 0.35s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shake {
  10%, 90% { transform: translate3d(-3px, 0, 0); }
  20%, 80% { transform: translate3d(4px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-5px, 0, 0); }
  40%, 60% { transform: translate3d(5px, 0, 0); }
}

.grid div {
  height: 70px;
  width: 70px;
  box-sizing: border-box;
  background-size: 85%;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: 10px;
  cursor: grab;
  transition: transform 0.15s ease, filter 0.15s ease, outline 0.15s ease;
}

.grid div:active {
  cursor: grabbing;
}

.grid div:hover {
  transform: scale(1.08);
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.6));
  z-index: 2;
}

.grid div.selected-candy {
  transform: scale(1.12);
  filter: drop-shadow(0 0 12px #38bdf8);
  outline: 3px solid #38bdf8;
  z-index: 5;
}

/* Status Sendok Laser Selection (Free-Swap Teleport) */
.grid div.laser-selected {
  transform: scale(1.15);
  filter: drop-shadow(0 0 16px #f59e0b);
  outline: 4px dashed #f59e0b;
  z-index: 6;
  animation: laserPulse 0.6s infinite alternate;
}

@keyframes laserPulse {
  0% { transform: scale(1.1); filter: drop-shadow(0 0 8px #f59e0b); }
  100% { transform: scale(1.18); filter: drop-shadow(0 0 20px #fbbf24); }
}

/* Hint Highlight Effect */
.grid div.hint-highlight {
  animation: hintPulse 0.8s infinite alternate;
  outline: 3px dashed #fbbf24;
  z-index: 4;
}

@keyframes hintPulse {
  0% { transform: scale(1); filter: drop-shadow(0 0 6px #fbbf24); }
  100% { transform: scale(1.12); filter: drop-shadow(0 0 15px #f59e0b); }
}

/* Quick Gadget Toolbar */
.gadget-toolbar {
  display: flex;
  gap: 8px;
  width: 580px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 10px;
  padding: 6px 10px;
  justify-content: space-between;
}

.gadget-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: #1e293b;
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #f8fafc;
  font-family: 'Montserrat', sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  padding: 6px 6px;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
}

.gadget-btn:hover {
  transform: translateY(-2px);
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
}

.gadget-btn.active-tool {
  background: #0284c7;
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.6);
}

.g-badge {
  background: #ef4444;
  color: white;
  font-size: 9.5px;
  font-weight: 900;
  padding: 1px 5px;
  border-radius: 10px;
}

/* Cheat Overdrive Button (Terkunci & Aktif) */
.cheat-btn.locked {
  background: #334155;
  border-color: #475569;
  color: #94a3b8;
  cursor: not-allowed;
  opacity: 0.7;
}

.cheat-btn.ready {
  background: linear-gradient(135deg, #a855f7, #6b21a8);
  border-color: #c084fc;
  color: #ffffff;
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.8);
  animation: overdrivePulse 0.8s infinite alternate;
}

@keyframes overdrivePulse {
  0% { transform: scale(1); filter: brightness(1); }
  100% { transform: scale(1.04); filter: brightness(1.25); }
}

/* Floating Feedback Text */
.floating-effect {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 20;
}

.floating-msg {
  font-size: 20px;
  font-weight: 900;
  color: #facc15;
  text-shadow: 0 0 12px rgba(234, 179, 8, 0.8), 0 2px 4px #000;
  text-align: center;
  animation: floatUpFade 1.2s forwards ease-out;
  white-space: nowrap;
}

@keyframes floatUpFade {
  0% { opacity: 0; transform: translateY(15px) scale(0.8); }
  20% { opacity: 1; transform: translateY(0) scale(1.15); }
  80% { opacity: 1; transform: translateY(-20px) scale(1); }
  100% { opacity: 0; transform: translateY(-40px) scale(0.9); }
}

/* --- Right Panel: Scoreboard, Pangkat, Timer, & Change Mode --- */
.scoreBoard {
  width: 275px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  border: 2px solid rgba(59, 130, 246, 0.4);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
  gap: 8px;
}

.scoreboard-header {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 10px;
  padding: 8px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.scoreboard-header h3 {
  font-size: 10.5px;
  letter-spacing: 2.5px;
  color: #94a3b8;
  margin: 0 0 2px 0;
  font-weight: 800;
  text-transform: uppercase;
}

.scoreboard-header h1 {
  font-size: 34px;
  font-weight: 900;
  color: #38bdf8;
  margin: 0;
  line-height: 1;
  text-shadow: 0 0 14px rgba(56, 189, 248, 0.6);
}

/* Target Round Khusus Endless Mode */
.round-target-box {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px dashed rgba(56, 189, 248, 0.25);
  width: 100%;
}

.round-badge {
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 1px;
  background: #0284c7;
  color: #f0f9ff;
  padding: 2px 8px;
  border-radius: 10px;
}

.target-sub {
  font-size: 10.5px;
  color: #fbbf24;
  font-weight: 700;
}

/* Pangkat Galaksi & List Milestone Roadmap */
.rank-container {
  width: 100%;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 10px;
  padding: 8px;
}

.rank-active-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.rank-label {
  font-size: 8.5px;
  font-weight: 800;
  color: #fbbf24;
  letter-spacing: 1.5px;
}

.rank-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.rank-icon {
  font-size: 16px;
}

.rank-title {
  font-size: 11px;
  font-weight: 800;
  color: #f1f5f9;
}

.milestone-divider {
  height: 1px;
  background: rgba(148, 163, 184, 0.2);
  margin: 5px 0;
}

.milestone-heading {
  font-size: 8.5px;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 0.8px;
  text-align: left;
  margin-bottom: 4px;
}

.milestone-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
}

.milestone-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2.5px 4px;
  border-radius: 5px;
  font-size: 10px;
  color: #64748b;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.milestone-item .m-icon {
  font-size: 11px;
  margin-right: 4px;
}

.milestone-item .m-name {
  flex: 1;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.milestone-item .m-target {
  font-weight: 800;
  font-size: 9px;
  background: rgba(255, 255, 255, 0.05);
  padding: 1px 4px;
  border-radius: 4px;
}

.milestone-item.unlocked {
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.7);
}

.milestone-item.unlocked .m-target {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.15);
}

.milestone-item.active {
  color: #f8fafc;
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.3);
}

.milestone-item.active .m-name {
  font-weight: 800;
}

.milestone-item.active .m-target {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.3);
}

/* Timer Fondasi */
#timer {
  font-size: 13.5px;
  font-weight: 800;
  color: #f43f5e;
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.3);
  border-radius: 8px;
  padding: 5px 8px;
  width: 100%;
  letter-spacing: 0.5px;
  text-align: center;
}

#timer.timer-warning {
  animation: timerBlink 0.6s infinite alternate;
}

@keyframes timerBlink {
  0% { background: rgba(244, 63, 94, 0.12); }
  100% { background: rgba(244, 63, 94, 0.45); transform: scale(1.03); }
}

/* Tombol Quit Game (Menggantikan Change Mode) */
#changeMode,
.quit-btn {
  width: 100%;
  padding: 9px 12px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  border: 1px solid #f87171;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

#changeMode:hover,
.quit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.55);
}

.scoreboard-footer {
  width: 100%;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed rgba(148, 163, 184, 0.25);
}

.scoreboard-credit-btn {
  width: 100%;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(129, 140, 248, 0.4);
  color: #c7d2fe;
  font-family: 'Montserrat', sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.scoreboard-credit-btn:hover {
  background: rgba(99, 102, 241, 0.4);
  border-color: #818cf8;
  color: #ffffff;
  transform: translateY(-1px);
}

/* --- Lobi Utama Styling (Screen Selection) --- */
#modeSelection {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at center, rgba(15, 23, 42, 0.95), rgba(2, 6, 23, 0.98));
  z-index: 100;
  padding: 15px;
}

.briefing-card {
  background: rgba(30, 41, 59, 0.92);
  border: 2px solid #4ade80;
  border-radius: 18px;
  padding: 22px;
  max-width: 600px;
  width: 100%;
  text-align: center;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8), 0 0 25px rgba(74, 222, 128, 0.3);
  animation: popIn 0.35s ease-out;
}

@keyframes popIn {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Header Lobi & Kontrol Audio Lobi */
.lobby-top-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 6px;
}

.lobby-audio-bar {
  display: flex;
  gap: 6px;
}

.transmission-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  color: #4ade80;
  letter-spacing: 1.2px;
  background: rgba(74, 222, 128, 0.15);
  padding: 3px 10px;
  border-radius: 15px;
}

.alien-badge-header h2 {
  font-size: 20px;
  font-weight: 900;
  color: #f8fafc;
  margin: 0;
  letter-spacing: 0.8px;
}

.briefing-avatar-box {
  margin: 6px 0;
}

.briefing-story {
  font-size: 12.5px;
  line-height: 1.5;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.6);
  padding: 10px 14px;
  border-radius: 10px;
  border-left: 4px solid #4ade80;
  text-align: left;
  margin: 8px 0 12px 0;
}

/* Lobi Inventori & Credits Box (Rapi, Sejajar, Tidak Tumpang Tindih) */
.lobby-inventory-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lobby-inv-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.lobby-wallet-box {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
  color: #fef08a;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 5px 12px;
  border-radius: 8px;
  white-space: nowrap;
}

.lobby-wallet-box .wallet-icon {
  font-size: 16px;
}

.lobby-wallet-box .wallet-text {
  font-size: 10.5px;
  letter-spacing: 0.5px;
  color: #fde68a;
}

.lobby-wallet-box strong {
  font-size: 15px;
  color: #fef08a;
}

.lobby-wallet-box .wallet-currency {
  font-size: 11px;
  color: #f59e0b;
}

.lobby-shop-btn {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border: 1px solid #34d399;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 11.5px;
  font-weight: 800;
  font-family: 'Montserrat', sans-serif;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.35);
}

.lobby-shop-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 14px rgba(16, 185, 129, 0.55);
}

.lobby-inv-items {
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.inv-item-pill {
  flex: 1;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 10.5px;
  color: #cbd5e1;
  text-align: center;
}

.inv-item-pill strong {
  color: #38bdf8;
}

.player-input-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.6);
  padding: 6px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 11.5px;
  color: #94a3b8;
  font-weight: 700;
}

.player-input-box input {
  flex: 1;
  background: #1e293b;
  border: 1px solid #38bdf8;
  padding: 5px 8px;
  border-radius: 6px;
  color: white;
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 11.5px;
}

.mode-buttons-group {
  display: flex;
  gap: 10px;
  justify-content: center;
}

#modeSelection button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px 10px;
  font-family: 'Montserrat', sans-serif;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#endlessMode {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: white;
  box-shadow: 0 6px 16px rgba(14, 165, 233, 0.35);
}

#timedMode {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.35);
}

#modeSelection button:hover {
  transform: translateY(-2px) scale(1.02);
}

.btn-title {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.5px;
}

.btn-desc {
  font-size: 10px;
  opacity: 0.9;
  font-weight: 500;
}

.menu-sub-actions {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.sub-btn {
  background: rgba(30, 41, 59, 0.8) !important;
  border: 1px solid rgba(148, 163, 184, 0.4) !important;
  color: #cbd5e1 !important;
  padding: 6px 12px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  flex-direction: row !important;
  border-radius: 6px !important;
}

.sub-btn:hover {
  border-color: #38bdf8 !important;
  color: white !important;
}

.credit-btn {
  background: rgba(99, 102, 241, 0.25) !important;
  border-color: #818cf8 !important;
  color: #c7d2fe !important;
}

/* ==========================================================================
   MODAL DIALOG POPUPS
   ========================================================================== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(2, 6, 23, 0.85);
  backdrop-filter: blur(10px);
  z-index: 200;
  justify-content: center;
  align-items: center;
  padding: 12px;
}

.modal-card {
  background: #0f172a;
  border: 2px solid #38bdf8;
  border-radius: 18px;
  padding: 20px;
  max-width: 500px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9), 0 0 30px rgba(56, 189, 248, 0.3);
  animation: popIn 0.3s ease-out;
  max-height: 88vh;
  overflow-y: auto;
}

.modal-card.modal-wide {
  max-width: 660px;
}

.modal-tag {
  font-size: 9.5px;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: 1.2px;
  display: block;
  margin-bottom: 4px;
}

.modal-header h2 {
  font-size: 17px;
  font-weight: 900;
  color: #f8fafc;
  margin: 0;
}

.modal-stars {
  font-size: 28px;
  color: #fbbf24;
  margin: 8px 0;
  letter-spacing: 4px;
}

.modal-body {
  margin: 10px 0 14px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-stat-row {
  display: flex;
  justify-content: space-between;
  background: rgba(30, 41, 59, 0.6);
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  color: #94a3b8;
}

.modal-stat-row strong {
  color: #f8fafc;
  font-size: 12.5px;
}

.modal-quote-box {
  background: rgba(15, 23, 42, 0.8);
  border-left: 4px solid #38bdf8;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 11.5px;
  font-style: italic;
  color: #e2e8f0;
  line-height: 1.4;
  text-align: left;
}

.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.modal-btn {
  flex: 1;
  padding: 9px;
  font-family: 'Montserrat', sans-serif;
  font-size: 11.5px;
  font-weight: 800;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.modal-btn.primary-btn {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.modal-btn.secondary-btn {
  background: #334155;
  color: #f8fafc;
}

.modal-btn.danger-btn {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: white;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.modal-btn:hover {
  transform: translateY(-2px);
}

/* Shop Modal Styles */
.shop-balance-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 6px 12px;
  border-radius: 6px;
  margin: 10px 0;
  font-size: 11.5px;
  color: #fef08a;
}

.shop-items-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 8px 0;
}

.shop-card {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 10px;
  padding: 10px;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.shop-card.disabled {
  opacity: 0.55;
  border-color: #64748b;
}

.shop-card .item-icon {
  font-size: 22px;
  margin-bottom: 4px;
}

.shop-card h4 {
  margin: 0 0 3px 0;
  font-size: 12px;
  color: #38bdf8;
}

.shop-card p {
  margin: 0 0 8px 0;
  font-size: 10px;
  color: #94a3b8;
  line-height: 1.35;
  flex: 1;
}

.shop-card .buy-btn {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: white;
  border: 1px solid #38bdf8;
  border-radius: 6px;
  padding: 6px;
  font-weight: 800;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
}

.shop-card .buy-btn.can-afford {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #ffffff;
  border-color: #38bdf8;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4);
}

.shop-card .buy-btn.can-afford:hover {
  background: #0ea5e9;
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.6);
}

.shop-card .buy-btn.cant-afford {
  background: linear-gradient(135deg, #7f1d1d, #991b1b);
  color: #fecaca;
  border-color: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.35);
}

.shop-card .buy-btn.cant-afford:hover {
  background: #b91c1c;
  color: #ffffff;
  transform: scale(1.02);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.6);
}

.shop-card .buy-btn:disabled {
  background: #475569;
  border-color: #64748b;
  cursor: not-allowed;
  opacity: 0.6;
}

@keyframes shopShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.shop-card.insufficient-shake {
  animation: shopShake 0.4s ease;
  border-color: #ef4444 !important;
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.7) !important;
}

/* Ensiklopedi Lore Modal (Dengan Preview Permen) */
.logbook-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 10px 0;
  text-align: left;
}

.log-card {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.candy-log-thumb {
  width: 44px;
  height: 44px;
  background-size: 85%;
  background-repeat: no-repeat;
  background-position: center;
  background-color: rgba(15, 23, 42, 0.8);
  border: 2px solid rgba(56, 189, 248, 0.5);
  border-radius: 8px;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.candy-log-info {
  flex: 1;
}

.candy-log-info h4 {
  margin: 0 0 2px 0;
  font-size: 11.5px;
  color: #fbbf24;
}

.candy-log-info p {
  margin: 0;
  font-size: 10px;
  color: #cbd5e1;
  line-height: 1.35;
}

/* Badges / Achievements Modal (10 Badge Induk dengan 5 Tier Anak) */
.badges-modal-hint {
  font-size: 11px;
  color: #38bdf8;
  margin: 0 0 10px 0;
  font-weight: 600;
  text-align: center;
}

.badges-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 10px 0;
  text-align: left;
}

.badge-card {
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  user-select: none;
}

.badge-card:hover {
  transform: translateY(-2px);
  border-color: #38bdf8;
  background: rgba(30, 41, 59, 0.9);
  box-shadow: 0 6px 18px rgba(56, 189, 248, 0.3);
}

.badge-card.unlocked {
  border-color: #facc15;
  background: rgba(250, 204, 21, 0.1);
}

.badge-card.fully-unlocked {
  border-color: #4ade80;
  background: rgba(74, 222, 128, 0.12);
  box-shadow: 0 0 15px rgba(74, 222, 128, 0.3);
}

.badge-card .badge-icon {
  font-size: 26px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
  transition: filter 0.2s ease;
}

/* Gambar tiap badge bukan gembok: jika belum tercapai warnanya abu-abu, jika tercapai berwarna unik */
.badge-card .badge-icon.locked-icon {
  filter: grayscale(1) opacity(0.4);
}

.badge-card .badge-icon.unlocked-icon {
  filter: drop-shadow(0 0 8px rgba(250, 204, 21, 0.7));
}

.badge-info {
  flex: 1;
}

.badge-info h4 {
  margin: 0;
  font-size: 11.5px;
  color: #f8fafc;
  font-weight: 800;
}

.badge-info p {
  margin: 2px 0 0 0;
  font-size: 9.5px;
  color: #94a3b8;
  line-height: 1.3;
}

.badge-tier-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 6px;
  background: #1e293b;
  color: #94a3b8;
  border: 1px solid #475569;
  margin-top: 4px;
}

.badge-card.unlocked .badge-tier-badge {
  background: rgba(245, 158, 11, 0.2);
  color: #fef08a;
  border-color: #f59e0b;
}

.badge-card.fully-unlocked .badge-tier-badge {
  background: rgba(74, 222, 128, 0.2);
  color: #86efac;
  border-color: #4ade80;
}

.badge-hint-click {
  font-size: 8.5px;
  color: #38bdf8;
  display: block;
  margin-top: 2px;
  font-weight: 600;
}

/* Sub-Badges Modal (5 Tier Anak Tiap Badge) */
.sub-badge-parent-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(15, 23, 42, 0.85);
  border: 2px solid #38bdf8;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 12px;
  text-align: left;
}

.sub-parent-icon {
  font-size: 34px;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: #1e293b;
  border: 2px solid rgba(56, 189, 248, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.4);
}

.sub-parent-info {
  flex: 1;
}

.sub-parent-info p {
  margin: 0 0 6px 0;
  font-size: 11.5px;
  color: #cbd5e1;
}

.sub-parent-progress-bar-bg {
  width: 100%;
  height: 9px;
  background: #334155;
  border-radius: 6px;
  overflow: hidden;
}

.sub-parent-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #10b981);
  border-radius: 6px;
  transition: width 0.3s ease;
}

.sub-parent-ratio {
  font-size: 10px;
  font-weight: 800;
  color: #4ade80;
  margin-top: 4px;
  display: inline-block;
}

.sub-badges-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 280px;
  overflow-y: auto;
  margin-bottom: 10px;
  padding-right: 4px;
}

.child-badge-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 8px;
  padding: 8px 12px;
  text-align: left;
  transition: all 0.2s ease;
}

.child-badge-card.unlocked {
  border-color: #facc15;
  background: rgba(250, 204, 21, 0.1);
}

.child-badge-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.child-tier-tag {
  font-size: 9.5px;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 5px;
  background: #1e293b;
  color: #94a3b8;
  border: 1px solid #475569;
  white-space: nowrap;
}

.child-badge-card.unlocked .child-tier-tag {
  background: #f59e0b;
  color: #0f172a;
  border-color: #facc15;
}

.child-badge-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.child-badge-icon.locked {
  filter: grayscale(1) opacity(0.35);
}

.child-badge-icon.unlocked {
  filter: drop-shadow(0 0 6px #facc15);
}

.child-badge-details h5 {
  margin: 0;
  font-size: 11.5px;
  color: #f8fafc;
}

.child-badge-details p {
  margin: 2px 0 0 0;
  font-size: 10px;
  color: #94a3b8;
}

.child-badge-status {
  flex-shrink: 0;
  text-align: right;
}

.child-status-pill {
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 10px;
}

.child-status-pill.unlocked {
  background: rgba(74, 222, 128, 0.2);
  color: #4ade80;
  border: 1px solid #4ade80;
}

.child-status-pill.locked {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid #475569;
}

/* Leaderboard Modal Styles Terpisah (Endless vs. Timed) */
.leaderboard-tabs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  justify-content: center;
}

.lead-tab {
  flex: 1;
  background: #1e293b;
  border: 1px solid #475569;
  color: #94a3b8;
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 800;
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lead-tab.active {
  background: #0284c7;
  border-color: #38bdf8;
  color: white;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.leaderboard-table-wrapper {
  margin: 10px 0;
  max-height: 220px;
  overflow-y: auto;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.leaderboard-table th {
  background: #1e293b;
  color: #38bdf8;
  padding: 6px 4px;
  border-bottom: 2px solid #334155;
  font-weight: 800;
}

.leaderboard-table tbody tr {
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.leaderboard-table tbody tr:hover {
  background: rgba(56, 189, 248, 0.2);
}

.leaderboard-table tbody tr td:nth-child(2) {
  color: #38bdf8;
  font-weight: 700;
  text-decoration: underline dotted;
}

.leaderboard-table td {
  padding: 7px 4px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  color: #f1f5f9;
}

/* Modal Profil Detail Operator Galaksi (Hall of Fame) */
.profile-header-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.profile-avatar-frame {
  width: 65px;
  height: 65px;
  border-radius: 50%;
  background: #1e293b;
  border: 2px solid #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  flex-shrink: 0;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.5);
}

.profile-info-details {
  text-align: left;
  flex: 1;
}

.profile-rank-badge {
  display: inline-block;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid #f59e0b;
  color: #fef08a;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10.5px;
  font-weight: 800;
  margin-bottom: 4px;
}

.profile-bio-text {
  font-size: 11px;
  color: #cbd5e1;
  font-style: italic;
  margin: 0;
  line-height: 1.35;
}

.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
  text-align: left;
}

.p-stat-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 8px;
  padding: 8px 10px;
}

.p-stat-icon {
  font-size: 22px;
}

.p-stat-text {
  display: flex;
  flex-direction: column;
}

.p-stat-label {
  font-size: 9px;
  color: #94a3b8;
  font-weight: 600;
}

.p-stat-text strong {
  font-size: 12px;
  color: #38bdf8;
}

.p-weapons-detail {
  font-size: 8.5px;
  color: #fbbf24;
  margin-top: 2px;
}

/* Surat Keputusan Megah Berornamen (Debriefing Certificate) */
.grand-certificate-box {
  background: radial-gradient(circle, rgba(56, 189, 248, 0.15), rgba(15, 23, 42, 0.95));
  border: 3px double #facc15;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 8px;
  box-shadow: 0 0 25px rgba(250, 204, 21, 0.3), inset 0 0 15px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.cert-seal {
  font-size: 11px;
  font-weight: 900;
  color: #facc15;
  letter-spacing: 1.5px;
}

.cert-title {
  font-size: 16px;
  font-weight: 900;
  color: #f8fafc;
  margin: 4px 0 2px 0;
  letter-spacing: 0.5px;
}

.cert-subtitle {
  font-size: 10.5px;
  color: #94a3b8;
}

.cert-player-name {
  font-size: 22px;
  font-weight: 900;
  color: #38bdf8;
  margin: 6px 0 4px 0;
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.6);
}

.cert-rank-tag {
  display: inline-block;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid #f59e0b;
  color: #fef08a;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 10px;
}

.cert-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: rgba(15, 23, 42, 0.7);
  padding: 8px;
  border-radius: 8px;
  margin-bottom: 10px;
}

.c-stat span {
  display: block;
  font-size: 9.5px;
  color: #94a3b8;
}

.c-stat strong {
  font-size: 11px;
  color: #f8fafc;
}

.cert-quote-box {
  background: rgba(30, 41, 59, 0.6);
  border-left: 3px solid #facc15;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 11px;
  font-style: italic;
  color: #e2e8f0;
  line-height: 1.4;
  text-align: left;
  margin-bottom: 8px;
}

.cert-sign {
  font-size: 9.5px;
  color: #94a3b8;
}

/* Halaman Kredit Modal Styles */
.credits-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 10px 0;
  text-align: left;
}

.creator-profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 10px;
  padding: 10px 14px;
}

.creator-avatar-frame {
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

.creator-details h3 {
  margin: 0;
  font-size: 14px;
  color: #f8fafc;
}

.creator-role {
  margin: 2px 0 4px 0;
  font-size: 11px;
  color: #38bdf8;
  font-weight: 600;
}

.creator-badge {
  display: inline-block;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid #818cf8;
  color: #c7d2fe;
  font-size: 9.5px;
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 700;
}

.credits-sections-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.credit-sec {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  padding: 8px 10px;
}

.credit-sec h4 {
  margin: 0 0 4px 0;
  font-size: 11.5px;
  color: #fbbf24;
}

.credit-sec p {
  margin: 2px 0;
  font-size: 10px;
  color: #cbd5e1;
  line-height: 1.35;
}

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

/* --- Responsive Adjustments --- */
@media (max-width: 1200px) {
  .game-main-layout {
    flex-direction: column;
    align-items: center;
  }
  
  .cockpitPanel, .scoreBoard, .boss-battle-box, .gadget-toolbar {
    width: 580px;
  }

  .cockpitPanel {
    flex-direction: row;
    align-items: center;
  }

  .supermar-card {
    flex-direction: row;
    flex: 1;
  }
}
