/* ===================================================
   Yabusame Archery v2 — Modern Cyber-Heritage Theme
   High-Fidelity, Sleek Japanese Action Game Aesthetic
   =================================================== */

:root {
  --bg-base: #080b12;
  --bg-surface: rgba(15, 21, 37, 0.82);
  --bg-surface-elevated: rgba(22, 31, 54, 0.88);
  --border-glass: rgba(255, 255, 255, 0.09);
  --border-gold: rgba(245, 158, 11, 0.45);
  --gold-primary: #fbbf24;
  --gold-dark: #d97706;
  --crimson-primary: #f43f5e;
  --crimson-dark: #be123c;
  --accent-cyan: #38bdf8;
  --text-main: #f8fafc;
  --text-sub: #cbd5e1;
  --text-muted: #94a3b8;
  --font-main: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-kanji: "Noto Serif JP", serif;
  --font-display: "Cinzel", "Noto Serif JP", serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  font-family: var(--font-main);
  background-color: var(--bg-base);
  background-image: 
    radial-gradient(ellipse 80% 50% at 15% -10%, rgba(225, 29, 72, 0.16) 0%, transparent 60%),
    radial-gradient(ellipse 70% 45% at 85% 15%, rgba(245, 158, 11, 0.14) 0%, transparent 55%),
    radial-gradient(circle 600px at 50% 100%, rgba(14, 165, 233, 0.08) 0%, transparent 60%),
    linear-gradient(180deg, #090c15 0%, #06080e 100%);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #080b12;
}
::-webkit-scrollbar-thumb {
  background: #27354f;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #3b82f6;
}

.app {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 18px 50px;
  position: relative;
}

.hidden {
  display: none !important;
}

/* --- Hero Header --- */
.hero {
  text-align: center;
  margin-bottom: 22px;
  position: relative;
}

.hero-crest {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: rgba(225, 29, 72, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.4);
  padding: 6px 20px;
  border-radius: 30px;
  margin-bottom: 12px;
  box-shadow: 0 0 20px rgba(225, 29, 72, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
}

.crest-kanji {
  font-family: var(--font-kanji);
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  color: #fda4af;
  text-shadow: 0 0 10px rgba(244, 63, 94, 0.6);
}

.crest-sub {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: var(--gold-primary);
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

.main-title {
  font-family: var(--font-display);
  font-size: 2.75rem;
  font-weight: 900;
  margin: 4px 0 8px;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, #ffffff 20%, #fef08a 60%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 18px rgba(245, 158, 11, 0.35));
  line-height: 1.15;
}

.tagline {
  color: var(--text-sub);
  font-size: 1.05rem;
  font-weight: 500;
  margin: 0;
  letter-spacing: 0.02em;
}

/* --- Showcase Banner --- */
.arena-showcase {
  margin: 20px 0;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6), 0 0 0 1.5px rgba(245, 158, 11, 0.35);
  position: relative;
  background: #0d121f;
}

.showcase-banner {
  position: relative;
  max-height: 220px;
  overflow: hidden;
  background: #0d121f;
}

.hero-banner-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  opacity: 0.95;
  filter: saturate(1.15) contrast(1.05);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.arena-showcase:hover .hero-banner-img {
  transform: scale(1.03);
}

.showcase-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 11, 18, 0.1) 0%, rgba(8, 11, 18, 0.85) 100%);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: center;
  padding: 16px 14px;
  gap: 10px;
}

.badge-pill {
  background: rgba(15, 23, 42, 0.85);
  color: var(--gold-primary);
  font-size: 0.84rem;
  font-weight: 700;
  padding: 7px 15px;
  border-radius: 30px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.45);
  backdrop-filter: blur(8px);
  letter-spacing: 0.02em;
}

/* --- Modern Glass Cards --- */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-top: 3px solid var(--gold-primary);
  border-radius: 18px;
  padding: 26px;
  margin: 20px 0;
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.start-card {
  position: relative;
}

/* Player Profile Row & Input Box */
.player-profile-row {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-bottom: 24px;
}

.portrait-start {
  width: 105px;
  height: 155px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 14px;
  background: rgba(10, 14, 26, 0.7);
  border: 1.5px solid rgba(245, 158, 11, 0.4);
  padding: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 16px rgba(245, 158, 11, 0.2);
  transition: transform 0.3s ease;
}

.portrait-start:hover {
  transform: translateY(-2px) scale(1.02);
}

.player-profile-row .player-input-box {
  flex: 1;
  margin-bottom: 0;
}

@media (max-width: 580px) {
  .player-profile-row {
    flex-direction: column;
    text-align: center;
  }
  .portrait-start {
    height: 120px;
  }
}

.player-input-box {
  background: rgba(10, 15, 28, 0.75);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
}

.input-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.hanko-seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, #be123c 0%, #e11d48 100%);
  color: #fff;
  font-family: var(--font-kanji);
  font-weight: 900;
  font-size: 1.35rem;
  box-shadow: 0 4px 16px rgba(225, 29, 72, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.input-label {
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
  display: block;
  letter-spacing: 0.02em;
}

.input-sub {
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}

input[type="text"] {
  width: 100%;
  padding: 14px 18px;
  border: 1.8px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  font-size: 1.05rem;
  outline: none;
  background: rgba(15, 23, 42, 0.9);
  color: #ffffff;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

input[type="text"]::placeholder {
  color: #64748b;
}

input[type="text"]:focus {
  border-color: var(--gold-primary);
  background: rgba(22, 32, 58, 0.95);
  box-shadow: 0 0 0 3.5px rgba(245, 158, 11, 0.25), 0 0 20px rgba(245, 158, 11, 0.2);
}

/* --- Guide Grid --- */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 26px;
}

@media (max-width: 660px) {
  .guide-grid {
    grid-template-columns: 1fr;
  }
}

.guide-item {
  display: flex;
  gap: 14px;
  background: rgba(13, 19, 34, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 16px 18px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.guide-item:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 158, 11, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 0 16px rgba(245, 158, 11, 0.12);
}

.guide-icon {
  font-size: 1.65rem;
  flex-shrink: 0;
  line-height: 1.2;
}

.guide-content h3 {
  margin: 0 0 6px;
  font-size: 1.02rem;
  color: var(--gold-primary);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.guide-content p {
  margin: 3px 0;
  font-size: 0.88rem;
  color: var(--text-sub);
  line-height: 1.5;
}

kbd {
  display: inline-block;
  padding: 3px 8px;
  font-size: 0.78rem;
  font-weight: 800;
  color: #fff;
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-bottom: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  font-family: inherit;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.start-action {
  text-align: center;
  margin-top: 14px;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  background: rgba(30, 41, 59, 0.85);
  color: #ffffff;
  font-size: 0.98rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  font-family: inherit;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.btn:hover {
  background: rgba(45, 60, 88, 0.95);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.btn:active {
  transform: translateY(1px);
}

.btn.primary {
  background: linear-gradient(135deg, #be123c 0%, #e11d48 50%, #f59e0b 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 6px 24px rgba(225, 29, 72, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.btn.primary:hover {
  background: linear-gradient(135deg, #e11d48 0%, #f43f5e 50%, #fbbf24 100%);
  box-shadow: 0 8px 32px rgba(225, 29, 72, 0.55), 0 0 20px rgba(251, 191, 36, 0.35);
  transform: translateY(-3px);
}

.btn.btn-large {
  padding: 17px 38px;
  font-size: 1.18rem;
  letter-spacing: 0.04em;
  width: 100%;
  max-width: 480px;
  border-radius: 14px;
}

.btn.small {
  padding: 8px 14px;
  font-size: 0.85rem;
}

/* --- Gameplay Screen HUD --- */
.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 21, 37, 0.85);
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  margin-bottom: 14px;
  backdrop-filter: blur(16px);
}

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

.hud-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold-primary);
  background: #111827;
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.4);
}

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

.hud-badge {
  font-weight: 900;
  font-size: 1rem;
  color: var(--gold-primary);
  letter-spacing: 0.03em;
}

.hud-sub {
  font-size: 0.82rem;
  color: var(--accent-cyan);
  font-weight: 600;
}

.hud-center {
  text-align: center;
}

.hud-stat {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.25rem;
  color: #ffffff;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.hud-combo {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  transition: all 0.2s ease;
}

.hud-combo.combo-hot {
  color: #fb923c;
  text-shadow: 0 0 12px rgba(251, 146, 60, 0.8);
  font-size: 0.92rem;
  animation: pulseCombo 1s infinite alternate;
}

@keyframes pulseCombo {
  0% { transform: scale(1); filter: brightness(1); }
  100% { transform: scale(1.08); filter: brightness(1.3); }
}

.btn-sound {
  background: rgba(30, 41, 59, 0.7);
  color: var(--text-sub);
  border-color: rgba(255, 255, 255, 0.1);
}

.btn-sound:hover {
  background: rgba(51, 65, 85, 0.9);
  color: #fff;
}

/* --- Soal Box (Tactical Floating Visor) --- */
.soal-box {
  background: linear-gradient(135deg, rgba(13, 19, 34, 0.92) 0%, rgba(30, 20, 35, 0.95) 50%, rgba(13, 19, 34, 0.92) 100%);
  color: #ffffff;
  border-radius: 16px;
  padding: 16px 22px;
  margin-bottom: 14px;
  text-align: center;
  border: 1.5px solid rgba(245, 158, 11, 0.45);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.4), 0 0 20px rgba(245, 158, 11, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(16px);
}

.soal-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
}

.soal-label {
  font-size: 0.86rem;
  color: var(--gold-primary);
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.soal {
  font-family: var(--font-kanji);
  font-size: clamp(2rem, 5.5vw, 3.2rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #ffffff;
  text-shadow: 0 4px 14px rgba(0, 0, 0, 0.6), 0 0 30px rgba(251, 191, 36, 0.35);
  line-height: 1.25;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* --- Canvas Container --- */
.canvas-container {
  width: 100%;
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.65), 0 0 0 2px rgba(245, 158, 11, 0.4);
  background: #090c14;
}

#game-canvas {
  width: 100%;
  height: auto;
  display: block;
}

/* --- Glass System Dialog Overlay (Panduan Bawah Layar) --- */
.dialog-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px;
  background: linear-gradient(180deg, rgba(8, 11, 18, 0) 0%, rgba(8, 11, 18, 0.75) 30%, rgba(8, 11, 18, 0.95) 100%);
  display: flex;
  justify-content: center;
  align-items: flex-end;
  z-index: 40;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

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

.glass-dialog-box {
  width: 100%;
  max-width: 820px;
  background: rgba(13, 19, 35, 0.90);
  border: 1.5px solid rgba(245, 158, 11, 0.45);
  border-top: 3px solid var(--gold-primary);
  border-radius: 16px;
  padding: 16px 20px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7), 0 0 30px rgba(245, 158, 11, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: slideUpDialog 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpDialog {
  0% { transform: translateY(30px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
}

.dialog-speaker {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dialog-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold-primary);
  background: #111827;
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.45);
}

.speaker-meta {
  display: flex;
  flex-direction: column;
}

.speaker-tag {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--gold-primary);
  text-transform: uppercase;
}

.speaker-name {
  font-family: var(--font-kanji);
  font-size: 0.96rem;
  font-weight: 700;
  color: #f8fafc;
}

.dialog-step-badge {
  font-size: 0.8rem;
  font-weight: 800;
  background: rgba(30, 41, 59, 0.8);
  color: var(--gold-primary);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.dialog-content {
  min-height: 58px;
  margin-bottom: 12px;
}

.dialog-text {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.55;
  color: #f1f5f9;
  letter-spacing: 0.01em;
}

.typing-cursor {
  display: inline-block;
  color: var(--gold-primary);
  font-weight: 900;
  margin-left: 2px;
  font-size: 1.05rem;
  line-height: 1;
  animation: blinkCursor 0.5s infinite alternate;
  vertical-align: baseline;
  text-shadow: 0 0 10px var(--gold-primary);
}

@keyframes blinkCursor {
  0% { opacity: 1; filter: brightness(1.3); }
  100% { opacity: 0; }
}

.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dialog-dots {
  display: flex;
  gap: 6px;
}

.dialog-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition: all 0.2s ease;
}

.dialog-dots .dot.active {
  background: var(--gold-primary);
  box-shadow: 0 0 8px var(--gold-primary);
  width: 18px;
  border-radius: 4px;
}

.dialog-btn-start {
  animation: pulseStartBtn 1.2s infinite alternate;
}

@keyframes pulseStartBtn {
  0% { transform: scale(1); filter: brightness(1); }
  100% { transform: scale(1.03); filter: brightness(1.2); box-shadow: 0 0 24px rgba(245, 158, 11, 0.6); }
}

@media (max-width: 600px) {
  .dialog-overlay {
    padding: 8px;
  }
  .glass-dialog-box {
    padding: 12px 14px;
  }
  .dialog-text {
    font-size: 0.88rem;
  }
  .dialog-avatar {
    width: 36px;
    height: 36px;
  }
}

/* --- Control Panel (Tactile Gamepad UI) --- */
.control-panel {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-top: 16px;
  user-select: none;
  transition: opacity 0.3s ease, filter 0.3s ease;
}

.control-panel.locked {
  opacity: 0.52;
  pointer-events: none;
  filter: grayscale(0.4);
}

.move-group {
  display: flex;
  flex: 1;
  gap: 12px;
}

.ctrl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 22px;
  border-radius: 14px;
  border: 1.8px solid rgba(255, 255, 255, 0.14);
  background: rgba(22, 31, 54, 0.85);
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.12s ease;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
}

.ctrl-btn kbd {
  background: rgba(0, 0, 0, 0.35);
  border-color: rgba(255, 255, 255, 0.2);
  font-size: 0.76rem;
  padding: 3px 6px;
}

.move-btn {
  flex: 1;
  font-size: 1.02rem;
}

.move-btn:hover {
  background: rgba(35, 48, 80, 0.95);
  border-color: rgba(245, 158, 11, 0.45);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 16px rgba(245, 158, 11, 0.15);
}

.move-btn:active,
.move-btn.active {
  background: rgba(45, 62, 102, 1);
  transform: translateY(2px);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
}

.shoot-btn {
  flex: 1.35;
  background: linear-gradient(135deg, #be123c 0%, #e11d48 50%, #f59e0b 100%);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.28);
  font-size: 1.1rem;
  box-shadow: 0 8px 28px rgba(225, 29, 72, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.shoot-btn kbd {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}

.shoot-btn:hover {
  background: linear-gradient(135deg, #e11d48 0%, #f43f5e 50%, #fbbf24 100%);
  box-shadow: 0 10px 36px rgba(225, 29, 72, 0.6), 0 0 24px rgba(251, 191, 36, 0.35);
  transform: translateY(-2px);
}

.shoot-btn:active,
.shoot-btn.active {
  background: #9f1239;
  transform: translateY(2px);
  box-shadow: 0 2px 6px rgba(225, 29, 72, 0.4);
}

.ctrl-icon {
  font-size: 1.35rem;
}

.ctrl-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

@media (max-width: 580px) {
  .control-panel {
    flex-direction: column;
    gap: 10px;
  }
  .move-group {
    width: 100%;
  }
  .shoot-btn {
    width: 100%;
    padding: 17px;
  }
}

/* --- Status Message --- */
.msg {
  background: rgba(15, 21, 37, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 4px solid var(--gold-primary);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.94rem;
  color: var(--text-sub);
  margin: 14px 0 0;
  backdrop-filter: blur(12px);
}

/* --- Result Screen (Mastery Dashboard) --- */
.result-card {
  border-top: 4px solid var(--gold-primary);
  background: linear-gradient(180deg, rgba(18, 25, 45, 0.9) 0%, rgba(11, 15, 27, 0.95) 100%);
  position: relative;
  overflow: hidden;
}

.center {
  text-align: center;
}

.kanji-emblem {
  font-family: var(--font-kanji);
  font-size: 1rem;
  letter-spacing: 0.28em;
  font-weight: 900;
  color: #fda4af;
  background: rgba(225, 29, 72, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.4);
  padding: 6px 18px;
  border-radius: 24px;
  display: inline-block;
  margin-bottom: 10px;
  box-shadow: 0 0 16px rgba(225, 29, 72, 0.3);
}

.result-title {
  font-family: var(--font-display);
  font-size: 2.6rem;
  color: #ffffff;
  margin: 6px 0;
  font-weight: 900;
  background: linear-gradient(135deg, #ffffff 20%, #fef08a 60%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 14px rgba(245, 158, 11, 0.4));
}

.result-sub {
  color: var(--text-sub);
  font-size: 1rem;
  margin: 0 0 18px;
}

.portrait-result {
  width: 155px;
  max-height: 230px;
  object-fit: contain;
  margin: 12px auto;
  display: block;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 20px rgba(251, 191, 36, 0.25));
}

.result-stats {
  background: rgba(10, 15, 28, 0.85);
  border: 1.5px solid rgba(245, 158, 11, 0.35);
  border-radius: 16px;
  padding: 22px;
  max-width: 480px;
  margin: 20px auto;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.player-name-display {
  font-size: 1.18rem;
  margin: 0 0 10px;
  color: #ffffff;
}

.score-box {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin: 10px 0;
}

.score-label {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--text-sub);
  font-weight: 700;
}

.score-number {
  font-family: var(--font-display);
  font-size: 4.2rem;
  font-weight: 900;
  color: var(--gold-primary);
  line-height: 1;
  text-shadow: 0 0 30px rgba(251, 191, 36, 0.6);
}

.score-max {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--text-muted);
}

.grade-badge {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 900;
  color: #38bdf8;
  margin: 10px 0;
  text-shadow: 0 0 14px rgba(56, 189, 248, 0.5);
}

.rinci-text {
  font-size: 0.96rem;
  color: var(--text-sub);
  margin: 6px 0 0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.center-actions {
  justify-content: center;
}

.msg-result {
  color: #4ade80;
  font-weight: 700;
  font-size: 0.98rem;
  min-height: 1.4em;
  margin: 12px 0 0;
  text-shadow: 0 0 10px rgba(74, 222, 128, 0.4);
}

/* --- History Card & Table --- */
.history-card h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--gold-primary);
  margin: 0 0 6px;
  letter-spacing: 0.02em;
}

.muted {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 16px;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
  background: rgba(12, 17, 30, 0.9);
}

th {
  background: rgba(22, 31, 54, 0.95);
  color: #ffffff;
  font-weight: 800;
  text-align: left;
  padding: 12px 14px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  letter-spacing: 0.03em;
}

td {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-sub);
}

tr:nth-child(even) td {
  background: rgba(18, 25, 45, 0.5);
}

tr.result-benar td {
  background: rgba(34, 197, 94, 0.07);
}

tr.result-benar td strong {
  color: #4ade80;
  background: rgba(34, 197, 94, 0.18);
  border: 1px solid rgba(34, 197, 94, 0.35);
  padding: 4px 12px;
  border-radius: 20px;
  display: inline-block;
  font-weight: 800;
}

tr.result-salah td {
  background: rgba(239, 68, 68, 0.07);
}

tr.result-salah td strong {
  color: #f87171;
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.35);
  padding: 4px 12px;
  border-radius: 20px;
  display: inline-block;
  font-weight: 800;
}

/* Responsive Mobile Adaptations */
@media (max-width: 640px) {
  .hud {
    padding: 10px 14px;
    gap: 8px;
  }
  .hud-avatar {
    width: 38px;
    height: 38px;
  }
  .hud-badge {
    font-size: 0.88rem;
  }
  .hud-sub {
    font-size: 0.74rem;
  }
  .hud-stat {
    font-size: 1.05rem;
  }
  .hud-combo {
    font-size: 0.78rem;
  }
  .btn-sound {
    padding: 6px 10px;
    font-size: 0.78rem;
  }
  .soal-box {
    padding: 12px 14px;
  }
  .main-title {
    font-size: 2.1rem;
  }
  .tagline {
    font-size: 0.92rem;
  }
}

@media (max-width: 420px) {
  .hud-avatar {
    display: none;
  }
  .hud-badge {
    font-size: 0.82rem;
  }
  .hud-stat {
    font-size: 0.96rem;
  }
  .main-title {
    font-size: 1.8rem;
  }
}

/* Print Stylesheet */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .hud, .actions, .control-panel, #screen-start, #screen-play, .btn {
    display: none !important;
  }
  .card {
    border: 1px solid #999;
    box-shadow: none;
    margin: 0;
    padding: 12px;
    background: #ffffff !important;
    color: #000000 !important;
  }
  .portrait-result {
    max-height: 120px;
  }
}
