/* =========================================================
   Pociman: Kabur dari Warga - Style & Arcade UI
   ========================================================= */

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

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  margin: 0;
  padding: 0;
  background: #09090b;
  color: #f3f4f6;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  touch-action: manipulation;
}

#game-container {
  position: relative;
  width: min(100vw, calc(100dvh * (16 / 9)));
  height: min(100dvh, calc(100vw * (9 / 16)));
  max-width: 960px;
  max-height: 540px;
  aspect-ratio: 16 / 9;
  background: #0f172a;
  border-radius: 10px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 0 2px rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin: auto;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: transparent;
}

/* --- HUD Overlays --- */
.overlay-ui {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  pointer-events: none;
  z-index: 10;
}

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

.hud-left, .hud-right {
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.stat-badge {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.stage-badge {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.45);
}

.stage-max {
  font-size: 10px;
  color: #94a3b8;
  margin-left: 1px;
}

.bump-badge {
  color: #f43f5e;
  border-color: rgba(244, 63, 94, 0.4);
}

.time-badge {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.4);
}

.distance-badge {
  color: #38bdf8;
}

.stat-badge .label {
  font-size: 10px;
  color: #94a3b8;
  letter-spacing: 0.5px;
}


/* Synchronized Dual Meters (TPU Finish & Warga Danger) */
.hud-center {
  pointer-events: auto;
  flex: 1;
  max-width: 440px;
  margin: 0 14px;
}

.sync-meters-card {
  background: rgba(15, 23, 42, 0.93);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  padding: 6px 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.meter-row {
  display: flex;
  flex-direction: column;
}

.meter-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.4px;
  margin-bottom: 2px;
}

.meter-start {
  color: #94a3b8;
}

.meter-title {
  color: #38bdf8;
}

.meter-title strong {
  color: #facc15;
}

.meter-finish {
  color: #34d399;
}

.meter-danger {
  color: #ef4444;
  transition: color 0.15s;
}

.meter-sub {
  color: #cbd5e1;
}

.meter-safe {
  color: #10b981;
}

.progress-track {
  position: relative;
  width: 100%;
  height: 8px;
  background: #1e293b;
  border-radius: 4px;
  overflow: visible;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.15s ease-out;
}

.tpu-fill {
  background: linear-gradient(90deg, #0284c7, #38bdf8, #10b981);
}

.danger-fill {
  background: linear-gradient(90deg, #ef4444 0%, #f59e0b 50%, #10b981 100%);
}

.track-pin {
  position: absolute;
  top: -8px;
  transform: translateX(-50%);
  font-size: 14px;
  transition: left 0.15s ease-out;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

.danger-pin {
  top: -7px;
  font-size: 13px;
}

/* UI Action Buttons */
.ui-btn-icon {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #f3f4f6;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s, background 0.2s;
}

.ui-btn-icon:hover {
  background: rgba(30, 41, 59, 0.95);
  transform: translateY(-1px);
}

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

/* --- In-Game Warning Toast --- */
.throw-warning {
  position: absolute;
  top: 70px;
  left: 20px;
  background: #dc2626;
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.6);
  animation: flashAlert 0.2s infinite alternate;
  z-index: 20;
}

@keyframes flashAlert {
  0% { transform: scale(1); background: #dc2626; }
  100% { transform: scale(1.06); background: #f97316; }
}

.throw-warning.hidden {
  display: none;
}

/* --- Stage Level Up Banner --- */
.stage-banner {
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0f172a;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.6);
  z-index: 25;
  pointer-events: none;
  animation: stagePop 2.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes stagePop {
  0% { transform: translate(-50%, -20px) scale(0.6); opacity: 0; }
  15% { transform: translate(-50%, 0) scale(1.05); opacity: 1; }
  25% { transform: translate(-50%, 0) scale(1); opacity: 1; }
  85% { transform: translate(-50%, 0) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -15px) scale(0.9); opacity: 0; }
}

.stage-banner.hidden {
  display: none;
}


/* --- Modals / Screens --- */
.modal-screen {
  position: absolute;
  inset: 0;
  background: rgba(10, 15, 30, 0.92);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
  z-index: 50;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-screen.hidden {
  display: none !important;
  opacity: 0;
  pointer-events: none;
}

.hidden:not(.mobile-toast):not(.touch-helper) {
  display: none !important;
}

.modal-card {
  background: #1e293b;
  border: 2px solid #334155;
  border-radius: 14px;
  padding: 16px 20px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  margin: auto;
  max-height: 96%;
}

.start-card {
  max-width: 420px;
  padding: 14px 18px;
}

.mini-card {
  max-width: 360px;
  padding: 18px;
}

/* Quick Controls Box in Start Screen */
.quick-controls-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 10px;
  text-align: left;
}

.quick-ctrl-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: #cbd5e1;
}

.quick-ctrl-item .ctrl-tag {
  font-weight: 700;
  color: #38bdf8;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.quick-ctrl-item .ctrl-desc {
  font-size: 11px;
  color: #94a3b8;
  text-align: right;
}

.quick-ctrl-item kbd {
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  color: #f1f5f9;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

/* Primary Hero Start CTA */
.start-hero-cta {
  width: 100%;
  margin-bottom: 8px;
}

.btn-hero-start {
  width: 100%;
  padding: 13px 18px;
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  border-radius: 10px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  border: none;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-hero-start:hover {
  background: linear-gradient(135deg, #34d399 0%, #059669 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-hero-start:active {
  transform: translateY(1px);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

/* Secondary Button Group */
.start-secondary-btn-group {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-bottom: 8px;
}

.btn-sub-action {
  flex: 1;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #e2e8f0;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.btn-sub-action.btn-honor-toggle {
  border-color: rgba(250, 204, 21, 0.45);
  color: #facc15;
  background: rgba(250, 204, 21, 0.08);
}

.btn-sub-action.btn-honor-toggle:hover {
  background: #facc15;
  color: #0f172a;
  box-shadow: 0 4px 12px rgba(250, 204, 21, 0.25);
}

.btn-sub-action.btn-reset-stage {
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.06);
}

.btn-sub-action.btn-reset-stage:hover {
  background: #ef4444;
  border-color: #ef4444;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Utility Row in Start Screen Footer */
.start-utility-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 2px;
}

.btn-util-pill {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.btn-util-pill:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
  border-color: rgba(255, 255, 255, 0.25);
}

/* Floating Non-Blocking Portrait Notice (Fixed above viewport) */
.portrait-notice {
  display: none;
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(245, 158, 11, 0.96);
  color: #0f172a;
  font-size: 11.5px;
  font-weight: 800;
  padding: 6px 16px;
  border-radius: 20px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
  z-index: 9999;
  pointer-events: none;
  white-space: nowrap;
  animation: pulseNotice 2s infinite ease-in-out;
}

@media screen and (orientation: portrait) and (max-width: 900px) {
  .portrait-notice {
    display: block;
  }
}

/* Floating Mobile Toast Pill */
.mobile-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.5);
  color: #f8fafc;
  padding: 8px 18px;
  border-radius: 24px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.75);
  z-index: 10000;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  white-space: nowrap;
  max-width: 90vw;
  text-align: center;
}

.mobile-toast.hidden {
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
}

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

.tagline {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #f59e0b;
  margin-bottom: 4px;
}

.game-title {
  font-size: 32px;
  font-weight: 900;
  color: #38bdf8;
  text-shadow: 0 3px 0 #0284c7;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.story-desc {
  font-size: 13px;
  line-height: 1.5;
  color: #cbd5e1;
  margin-bottom: 16px;
}

.tips-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 18px;
  text-align: left;
}

.tip-card {
  background: rgba(51, 65, 85, 0.6);
  border: 1px solid rgba(71, 85, 105, 0.7);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tip-icon {
  font-size: 22px;
}

.tip-text strong {
  display: block;
  font-size: 12px;
  color: #f3f4f6;
}

.tip-text small {
  font-size: 11px;
  color: #94a3b8;
}

.btn-play {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  border: none;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.5px;
  padding: 12px 24px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
  transition: transform 0.15s, box-shadow 0.15s;
  width: 100%;
}

.btn-play:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.6);
}

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

.btn-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.btn-secondary {
  background: rgba(30, 41, 59, 0.85);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-weight: 700;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
  width: 100%;
}

.btn-secondary:hover {
  background: rgba(51, 65, 85, 0.95);
  color: #ffffff;
  transform: translateY(-1px);
}

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

/* --- Win / Game Over Modals --- */
.win-banner {
  font-size: 12px;
  font-weight: 800;
  color: #34d399;
  letter-spacing: 1.5px;
  margin-bottom: 4px;
}

.win-title {
  color: #34d399;
  text-shadow: 0 3px 0 #059669;
}

.gameover-title {
  font-size: 26px;
  font-weight: 900;
  color: #ef4444;
  margin-bottom: 4px;
}

.death-reason {
  font-size: 13px;
  color: #94a3b8;
  margin-bottom: 16px;
}

.stats-summary {
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: #0f172a;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.summary-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.summary-label {
  font-size: 10px;
  color: #94a3b8;
  white-space: nowrap;
}

.summary-value {
  font-size: 16px;
  font-weight: 800;
  color: #f3f4f6;
  white-space: nowrap;
}

.summary-value.highlight {
  color: #facc15;
}

.touch-helper {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.5);
  pointer-events: none;
  transition: opacity 0.4s ease;
  z-index: 15;
}

.touch-helper.hidden {
  opacity: 0;
}


/* --- Credits & Tribute Styles --- */
.creator-credits-footer {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.credits-by {
  font-size: 11px;
  color: #94a3b8;
}

.credits-by strong {
  color: #facc15;
}

.btn-credits-link {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-credits-link:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}

.credits-card {
  max-width: 520px;
  padding: 14px 18px;
}

.modal-header-compact {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-bottom: 10px;
}

.guide-eyebrow {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #38bdf8;
  text-transform: uppercase;
}

.guide-main-title {
  font-size: 18px;
  font-weight: 900;
  color: #f8fafc;
  margin: 0;
  letter-spacing: 0.3px;
}

/* Guide Tabs in Modal */
.guide-tab-group {
  display: flex;
  gap: 6px;
  width: 100%;
  margin-bottom: 10px;
  background: rgba(15, 23, 42, 0.6);
  padding: 3px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.guide-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 7px 12px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.guide-tab-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #f1f5f9;
}

.guide-tab-btn.active {
  background: #0284c7;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
}

.guide-tab-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 48vh;
  overflow-y: auto;
  padding-right: 6px;
  margin-bottom: 10px;
  text-align: left;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.3) transparent;
}

.guide-tab-panel::-webkit-scrollbar {
  width: 5px;
}

.guide-tab-panel::-webkit-scrollbar-track {
  background: transparent;
}

.guide-tab-panel::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.25);
  border-radius: 4px;
}

.guide-tab-panel::-webkit-scrollbar-thumb:hover {
  background: rgba(56, 189, 248, 0.45);
}

.guide-section {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.guide-sec-title {
  font-size: 10.5px;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.guide-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 6px;
}

.guide-card {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 8px;
  padding: 7px 9px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.guide-icon-badge {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}

.guide-card-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.guide-card-body strong {
  font-size: 11px;
  color: #f1f5f9;
  line-height: 1.25;
}

.guide-card-body span {
  font-size: 10px;
  color: #94a3b8;
  line-height: 1.35;
}

.guide-card-body kbd {
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-bottom: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  padding: 1px 4px;
  font-family: inherit;
  font-size: 9px;
  font-weight: 700;
  color: #facc15;
  white-space: nowrap;
}

.btn-close-guide {
  width: 100%;
  padding: 9px 16px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.credits-list {
  background: #0f172a;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.credit-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 6px;
}

.credit-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.credit-role {
  color: #94a3b8;
  font-weight: 500;
}

.credit-name {
  color: #f1f5f9;
  font-weight: 700;
  text-align: right;
}

.credit-name.highlight {
  color: #facc15;
}

.credits-copyright {
  font-size: 11px;
  color: #64748b;
  margin-bottom: 14px;
}

.victory-tribute-card {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
}

.tribute-quote {
  font-size: 12px;
  font-style: italic;
  color: #a7f3d0;
  margin-bottom: 4px;
}

.tribute-author {
  font-size: 11px;
  color: #cbd5e1;
}

.tribute-author strong {
  color: #facc15;
}

/* --- Skip Cutscene Button --- */
.skip-cutscene-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 60;
  background: rgba(15, 23, 42, 0.88);
  border: 1.5px solid #facc15;
  color: #facc15;
  font-size: 11px;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.4);
  transition: all 0.15s ease;
}

.skip-cutscene-btn.hidden {
  display: none !important;
}

.skip-cutscene-btn:hover {
  background: #facc15;
  color: #0f172a;
  transform: scale(1.04);
}

/* --- Ending Video Overlay Container --- */
.ending-video-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 55;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ending-video-container.hidden {
  display: none !important;
}

.ending-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000000;
}

/* --- Victory Certificate Card & Actions --- */
.cert-card {
  border: 2px solid #eab308;
  box-shadow: 0 0 25px rgba(234, 179, 8, 0.35);
  background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
  max-width: 500px;
}

.cert-authority {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #fbbf24;
  margin-bottom: 2px;
}

.cert-title {
  font-size: 20px;
  color: #fef08a;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
}

.cert-desc {
  font-size: 11px;
  color: #cbd5e1;
  line-height: 1.35;
  margin-bottom: 8px;
}

.win-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  width: 100%;
}

.btn-share-wa {
  background: #16a34a !important;
  color: #ffffff !important;
  border: 1.5px solid #4ade80 !important;
  font-weight: 800;
  font-size: 11px;
  padding: 7px 8px;
}

.btn-share-wa:hover {
  background: #15803d !important;
  box-shadow: 0 0 12px rgba(74, 222, 128, 0.4);
}

.btn-cert {
  background: #ca8a04 !important;
  color: #ffffff !important;
  border: 1.5px solid #fde047 !important;
  font-weight: 800;
  font-size: 11px;
  padding: 7px 8px;
}

.btn-cert:hover {
  background: #a16207 !important;
}

/* --- Wall of Honor Submission Box on Victory Screen --- */
.honor-submission-box {
  background: rgba(15, 23, 42, 0.88);
  border: 1.5px solid #eab308;
  border-radius: 10px;
  padding: 10px 14px;
  margin: 10px 0;
  text-align: left;
  box-shadow: 0 4px 15px rgba(234, 179, 8, 0.2);
}

.honor-box-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.honor-trophy-icon {
  font-size: 24px;
}

.honor-box-title {
  font-size: 12px;
  font-weight: 900;
  color: #facc15;
  letter-spacing: 0.5px;
}

.honor-box-sub {
  font-size: 10px;
  color: #cbd5e1;
}

.honor-input-group {
  display: flex;
  gap: 8px;
}

.honor-input {
  flex: 1;
  background: #0f172a;
  border: 1.5px solid #334155;
  border-radius: 6px;
  padding: 8px 12px;
  color: #f8fafc;
  font-size: 12px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.15s ease;
}

.honor-input:focus {
  border-color: #facc15;
}

.btn-submit-honor {
  background: #f59e0b;
  color: #0f172a;
  border: none;
  font-size: 11px;
  font-weight: 800;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.btn-submit-honor:hover {
  background: #facc15;
}

.btn-honor-view {
  background: #facc15 !important;
  color: #0f172a !important;
  font-weight: 900;
  grid-column: span 2;
}

.btn-honor-view:hover {
  background: #fef08a !important;
}

.honor-feedback {
  font-size: 11px;
  font-weight: 700;
  margin-top: 6px;
  padding: 5px 8px;
  border-radius: 4px;
}

.honor-feedback.success {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid #22c55e;
}

.honor-feedback.error {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid #ef4444;
}

/* --- Wall of Honor Modal --- */
.honor-modal-card {
  max-width: 520px;
  border: 2px solid #facc15;
  background: radial-gradient(circle at center, #1e293b 0%, #090d16 100%);
  box-shadow: 0 0 30px rgba(250, 204, 21, 0.35);
}

.honor-title {
  color: #fde047;
  font-size: 20px;
  margin-bottom: 4px;
}

.honor-list-container {
  max-height: 250px;
  overflow-y: auto;
  margin: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 4px;
}

.honor-list-container::-webkit-scrollbar {
  width: 5px;
}

.honor-list-container::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 4px;
}

.honor-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px 12px;
  transition: transform 0.15s ease;
}

.honor-item:hover {
  border-color: rgba(250, 204, 21, 0.5);
  background: rgba(30, 41, 59, 0.85);
}

.honor-item.highlight-user {
  border-color: #facc15;
  background: rgba(234, 179, 8, 0.18);
}

.honor-rank-badge {
  font-size: 15px;
  font-weight: 900;
  color: #facc15;
  min-width: 32px;
}

.honor-item-main {
  flex: 1;
  text-align: left;
  margin: 0 10px;
}

.honor-item-name {
  font-size: 13px;
  font-weight: 800;
  color: #f8fafc;
}

.honor-item-title {
  font-size: 10px;
  color: #fbbf24;
}

.honor-item-stats {
  text-align: right;
  font-size: 10px;
  color: #cbd5e1;
}

.honor-item-date {
  font-size: 9px;
  color: #64748b;
}

.honor-loading, .honor-empty {
  padding: 24px;
  text-align: center;
  color: #94a3b8;
  font-size: 12px;
}

/* --- Tip Control Cards & Mobile Web Optimization --- */
.tip-control-card {
  border-left: 3px solid #38bdf8;
  background: rgba(15, 23, 42, 0.7);
}

.pause-control-tips {
  margin: 10px 0 16px;
  color: #94a3b8;
  font-size: 12px;
}


/* Fullscreen Root & Body: Fill 100% of display and center content symmetrically */
:fullscreen,
:-webkit-full-screen {
  width: 100% !important;
  width: 100vw !important;
  height: 100% !important;
  height: 100vh !important;
  height: 100dvh !important;
  margin: 0 !important;
  padding: 0 !important;
  background: radial-gradient(circle at center, #0d1527 0%, #060913 100%) !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  overflow: hidden !important;
}

:fullscreen body,
:-webkit-full-screen body {
  width: 100% !important;
  width: 100vw !important;
  height: 100% !important;
  height: 100vh !important;
  height: 100dvh !important;
  margin: 0 !important;
  padding: 0 !important;
  padding-left: env(safe-area-inset-left, 0) !important;
  padding-right: env(safe-area-inset-right, 0) !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  background: transparent !important;
  overflow: hidden !important;
}

/* Fullscreen Game Container: Centered 16:9 with balanced side margins */
:fullscreen #game-container,
:-webkit-full-screen #game-container,
#game-container:fullscreen,
#game-container:-webkit-full-screen {
  width: min(100vw, calc(100dvh * (16 / 9))) !important;
  height: min(100dvh, calc(100vw * (9 / 16))) !important;
  max-width: 100vw;
  max-height: 100dvh;
  margin: auto !important;
  border-radius: 0;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* Responsive on Mobile, Tablet & Short viewports (accounts for browser bars) */
@media (max-height: 560px), (max-width: 768px) {
  #game-container {
    width: min(100vw, calc(100dvh * (16 / 9)));
    height: min(100dvh, calc(100vw * (9 / 16)));
    border-radius: 6px;
    margin: auto;
  }
  .overlay-ui {
    padding: 3px 8px;
  }
  .stat-badge {
    padding: 3px 6px;
    font-size: 10.5px;
    gap: 3px;
  }
  .stat-badge .label {
    display: none;
  }
  .hud-center {
    max-width: 280px;
    margin: 0 4px;
    flex: 1;
  }
  .sync-meters-card {
    padding: 3px 6px;
    gap: 2px;
  }
  .progress-track {
    height: 6px;
  }
  .meter-labels {
    font-size: 7.5px;
  }
  .ui-btn-icon {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
  .modal-screen {
    padding: 4px;
  }
  .modal-card {
    max-width: 480px;
    padding: 8px 14px;
    max-height: 98%;
    overflow-y: auto;
  }
  .start-card {
    max-width: 440px;
    padding: 8px 14px;
  }
  .tagline {
    font-size: 9px;
    letter-spacing: 1px;
    margin-bottom: 1px;
  }
  .game-title {
    font-size: 18px;
    margin-bottom: 2px;
    letter-spacing: 0.5px;
  }
  .story-desc {
    font-size: 10px;
    line-height: 1.25;
    margin-bottom: 4px;
  }
  .quick-controls-box {
    padding: 4px 8px;
    margin-bottom: 5px;
    gap: 2px;
  }
  .quick-ctrl-item {
    font-size: 9.5px;
    gap: 4px;
  }
  .quick-ctrl-item .ctrl-icon {
    font-size: 12px;
  }

  .start-hero-cta {
    margin-bottom: 4px;
  }
  .btn-hero-start {
    padding: 8px 12px;
    font-size: 12px;
  }
  .start-secondary-btn-group {
    margin-bottom: 4px;
    gap: 6px;
  }
  .btn-sub-action {
    padding: 6px 8px;
    font-size: 10px;
  }
  .start-utility-row {
    gap: 6px;
    margin-bottom: 2px;
  }
  .btn-util-pill {
    padding: 3px 8px;
    font-size: 9.5px;
  }
  .btn-group {
    flex-direction: row;
    gap: 8px;
    width: 100%;
  }
  .btn-group .btn-play,
  .btn-group .btn-secondary {
    flex: 1;
    padding: 8px 10px;
    font-size: 11.5px;
  }
  .tips-grid {
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin-bottom: 6px;
  }
  .tip-card {
    padding: 4px 6px;
    gap: 4px;
  }
  .tip-icon {
    font-size: 14px;
  }
  .tip-text strong {
    font-size: 9.5px;
  }
  .tip-text small {
    font-size: 8.5px;
  }
  .btn-play {
    padding: 7px 12px;
    font-size: 11.5px;
  }
  .creator-credits-footer {
    margin-top: 3px;
    padding-top: 3px;
    gap: 2px;
    font-size: 8.5px;
  }
  .stats-summary {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 5px 8px;
    margin-bottom: 6px;
    gap: 6px;
  }
  .summary-label {
    font-size: 9px;
  }
  .summary-value {
    font-size: 13px;
  }
  .credits-card {
    max-width: 480px;
    padding: 6px 12px;
  }
  .modal-header-compact {
    margin-bottom: 4px;
  }
  .guide-main-title {
    font-size: 14px;
  }
  .guide-eyebrow {
    font-size: 9px;
  }
  .guide-tab-panel {
    max-height: 44vh;
    gap: 6px;
    margin-bottom: 6px;
  }
  .guide-card {
    padding: 5px 7px;
    gap: 6px;
  }
  .guide-icon-badge {
    width: 24px;
    height: 24px;
    font-size: 13px;
  }
  .guide-card-body strong {
    font-size: 10px;
  }
  .guide-card-body span {
    font-size: 9px;
  }
  .credits-list {
    padding: 6px 10px;
    gap: 4px;
    margin-bottom: 6px;
  }
  .credit-row {
    font-size: 9.5px;
    padding-bottom: 3px;
  }
  .credits-copyright {
    font-size: 9px;
    margin-bottom: 6px;
  }
  .victory-tribute-card {
    padding: 5px 8px;
    margin-bottom: 6px;
  }
  .tribute-quote {
    font-size: 10px;
    margin-bottom: 2px;
  }
  .tribute-author {
    font-size: 9px;
  }
  .cert-card {
    max-width: 440px;
    padding: 6px 12px;
  }
  .cert-title {
    font-size: 15px;
    margin-bottom: 2px;
  }
  .cert-desc {
    font-size: 9px;
    margin-bottom: 4px;
    line-height: 1.25;
  }
  .cert-authority {
    font-size: 8px;
  }
  .win-actions-grid {
    gap: 4px;
  }
  .win-actions-grid button {
    padding: 5px 6px;
    font-size: 9.5px;
  }
  .skip-cutscene-btn {
    top: 8px;
    right: 8px;
    font-size: 9.5px;
    padding: 4px 8px;
  }
}
