/* VIKING ZOMBIES — Craneworm Studios */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-dark: #0a0a1a;
  --bg-purple: #1a0a2e;
  --accent-yellow: #ffd700;
  --accent-orange: #ff6b35;
  --accent-green: #39ff14;
  --accent-pink: #ff69b4;
  --accent-cyan: #00e5ff;
  --blood: #ff2d55;
  --neon-glow: 0 0 20px rgba(255, 215, 0, 0.35), 0 0 40px rgba(138, 43, 226, 0.25);
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Rubik', system-ui, sans-serif;
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(88, 28, 135, 0.45), transparent 55%),
    radial-gradient(ellipse 80% 60% at 100% 50%, rgba(255, 107, 53, 0.12), transparent 50%),
    radial-gradient(ellipse 80% 60% at 0% 80%, rgba(0, 229, 255, 0.08), transparent 50%),
    linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-purple) 50%, #0d1b2a 100%);
  color: #fff;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

#stars {
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 30% 60%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 50% 10%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 70% 40%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 90% 80%, rgba(255,255,255,0.4), transparent),
    radial-gradient(2px 2px at 15% 85%, rgba(255,215,0,0.3), transparent),
    radial-gradient(2px 2px at 85% 15%, rgba(255,107,53,0.3), transparent);
  pointer-events: none;
  z-index: 0;
  animation: star-twinkle 8s ease-in-out infinite alternate;
}

@keyframes star-twinkle {
  0% { opacity: 0.85; }
  100% { opacity: 1; }
}

#neon-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 215, 0, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 215, 0, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 40%, black 20%, transparent 75%);
  pointer-events: none;
  z-index: 0;
}

.scanlines {
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  pointer-events: none;
  z-index: 9998;
  opacity: 0.35;
}

/* Craneworm logo badges — title = viewport corners; in-game = docked to canvas */
.brand-float {
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: none;
  padding: 6px;
  border-radius: 12px;
  border: 2px solid rgba(255, 215, 0, 0.55);
  background: rgba(8, 4, 16, 0.9);
  box-shadow:
    0 0 20px rgba(138, 43, 226, 0.4),
    0 0 32px rgba(255, 215, 0, 0.12),
    0 6px 18px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
}

.brand-float img {
  display: block;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  border: 2px solid rgba(255, 215, 0, 0.65);
  box-shadow:
    0 0 16px rgba(138, 43, 226, 0.45),
    0 4px 12px rgba(0, 0, 0, 0.45);
  background: #0a0a1a;
  animation: brand-pulse 3s ease-in-out infinite;
}

.brand-float-tag {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent-yellow);
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.55);
  white-space: nowrap;
}

/* Title / menu: fixed to screen corners (with safe area) */
.brand-float-global {
  position: fixed;
}
.brand-float-global.brand-float-tr {
  top: max(10px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
}
.brand-float-global.brand-float-tr img {
  width: clamp(88px, 14vw, 150px);
}
.brand-float-global.brand-float-bl {
  bottom: max(10px, env(safe-area-inset-bottom));
  left: max(10px, env(safe-area-inset-left));
}
.brand-float-global.brand-float-bl img {
  width: clamp(80px, 12vw, 130px);
  animation: brand-pulse 3s ease-in-out infinite, brand-float-drift 4s ease-in-out infinite;
}

/* Title: show corner floats · Playing: hide them (canvas logos take over) */
body.playing .brand-float-global,
body.on-over .brand-float-global {
  display: none !important;
}
body.on-title .brand-float-global {
  display: flex !important;
}

/* In-game: docked to the playfield (canvas-wrap) so they never get cut off */
.brand-float-on-game {
  position: absolute;
  display: none;
  z-index: 30;
  padding: 5px;
  gap: 3px;
}
body.playing #game-screen.active .brand-float-on-game {
  display: flex;
}
.canvas-wrap .brand-float-tr {
  top: 6px;
  right: 6px;
}
.canvas-wrap .brand-float-bl {
  bottom: 6px;
  left: 6px;
}
.canvas-wrap .brand-float-on-game img {
  width: clamp(58px, 8.5vw, 88px);
}
.canvas-wrap .brand-float-on-game .brand-float-tag {
  font-size: 0.4rem;
  letter-spacing: 0.08em;
}

@keyframes brand-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.08); }
}

@keyframes brand-float-drift {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.screen.active { display: flex; }

.title-hero {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 560px;
  width: 100%;
  padding: 1.5rem 1.25rem 1.75rem;
  background: rgba(10, 8, 24, 0.72);
  border: 1px solid rgba(255, 215, 0, 0.28);
  border-radius: 22px;
  box-shadow: var(--neon-glow), 0 24px 60px rgba(0,0,0,0.45);
  backdrop-filter: blur(10px);
}

.studio-logo {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 18px;
  border: 2px solid var(--accent-yellow);
  box-shadow: 0 0 24px rgba(255, 215, 0, 0.35);
  margin: 0 auto 0.85rem;
}
.studio-logo-sm { width: 64px; height: 64px; border-radius: 14px; }

.title-badge {
  display: inline-block;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--accent-yellow);
  border: 1px solid rgba(255, 215, 0, 0.4);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
  background: rgba(255, 215, 0, 0.08);
}

.game-title {
  font-family: 'Bangers', cursive;
  font-size: clamp(3rem, 12vw, 4.6rem);
  line-height: 0.95;
  letter-spacing: 0.04em;
  color: #fff;
  text-shadow:
    0 0 20px rgba(255, 107, 53, 0.6),
    0 4px 0 #5a1a80,
    0 0 40px rgba(255, 215, 0, 0.35);
  margin-bottom: 0.35rem;
}
.game-title span {
  color: var(--accent-green);
  text-shadow:
    0 0 20px rgba(57, 255, 20, 0.55),
    0 4px 0 #1a5a20;
}

.tagline {
  font-size: 1.05rem;
  color: var(--accent-cyan);
  margin-bottom: 0.25rem;
  font-weight: 600;
}
.subtitle {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.55);
  margin-bottom: 1rem;
  text-transform: lowercase;
}

.title-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
  margin-bottom: 1.15rem;
}
.title-features span {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
}

.big-btn {
  font-family: 'Bangers', cursive;
  font-size: 1.65rem;
  letter-spacing: 0.06em;
  padding: 0.7rem 2.2rem;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  color: #1a0a2e;
  background: linear-gradient(145deg, var(--accent-yellow), var(--accent-orange));
  box-shadow: 0 6px 0 #a64b1a, 0 0 28px rgba(255, 215, 0, 0.4);
  transition: transform 0.12s, box-shadow 0.12s;
}
.big-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 #a64b1a, 0 0 36px rgba(255, 215, 0, 0.55);
}
.big-btn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #a64b1a;
}

.ghost-btn {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(0,0,0,0.35);
  color: #fff;
  cursor: pointer;
  margin-top: 0.65rem;
}
.ghost-btn:hover {
  border-color: var(--accent-yellow);
  color: var(--accent-yellow);
}

.sound-hint {
  margin-top: 0.85rem;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.45);
}

.how-to {
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
  line-height: 1.45;
}
.how-to strong {
  display: block;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--accent-yellow);
  margin-bottom: 0.35rem;
}
kbd {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  margin: 0 0.1rem;
  border-radius: 5px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.08);
  font-family: 'Orbitron', sans-serif;
  font-size: 0.72rem;
}

/* GAME SCREEN */
#game-screen {
  justify-content: flex-start;
  padding: 0.35rem 0.5rem 0.45rem;
  gap: 0.35rem;
}

.game-header {
  position: relative;
  z-index: 2;
  width: min(1200px, 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0.65rem;
  background: rgba(10, 8, 24, 0.65);
  border: 1px solid rgba(255, 215, 0, 0.22);
  border-radius: 14px;
  backdrop-filter: blur(8px);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.header-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid rgba(255, 215, 0, 0.4);
}
.header-presents {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.45);
  text-transform: lowercase;
}
.header-title-block { text-align: center; flex: 1; }
.header-title {
  font-family: 'Bangers', cursive;
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  line-height: 1;
  text-shadow: 0 0 12px rgba(255, 107, 53, 0.5);
}
.header-tagline {
  font-size: 0.7rem;
  color: var(--accent-cyan);
}
#game-screen .ghost-btn { margin-top: 0; }

.hud {
  position: relative;
  z-index: 2;
  width: min(1200px, 100%);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
}
.hud-chip {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.75rem;
  background: rgba(10, 8, 24, 0.7);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  min-width: 90px;
}
.hud-label {
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.45);
}
.hp-chip { min-width: 140px; }
.hp-bar {
  flex: 1;
  height: 10px;
  background: rgba(255,255,255,0.1);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255,45,85,0.3);
}
#hp-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--blood), var(--accent-orange));
  box-shadow: 0 0 10px rgba(255, 45, 85, 0.5);
  transition: width 0.15s;
}

.canvas-wrap {
  position: relative; /* anchor for in-game brand floats */
  z-index: 2;
  width: min(1400px, 100%);
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible; /* logos stay visible on canvas corners */
}

#game {
  width: 100%;
  height: auto;
  max-height: calc(100vh - 120px);
  aspect-ratio: 16 / 9;
  background: #0d1520;
  border-radius: 12px;
  border: 3px solid rgba(255, 215, 0, 0.45);
  box-shadow: var(--neon-glow), 0 16px 40px rgba(0,0,0,0.4);
  cursor: crosshair;
  display: block;
  touch-action: none;
  /* HD smooth scale — internal 1280×720 */
  image-rendering: auto;
  image-rendering: high-quality;
}

.wave-banner {
  position: absolute;
  top: 18%;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Bangers', cursive;
  font-size: clamp(2rem, 6vw, 3.2rem);
  letter-spacing: 0.08em;
  color: var(--accent-yellow);
  text-shadow: 0 0 24px rgba(255, 215, 0, 0.7), 0 4px 0 #5a1a80;
  pointer-events: none;
  animation: wave-pop 1.4s ease-out forwards;
}
@keyframes wave-pop {
  0% { opacity: 0; transform: translateX(-50%) scale(0.6); }
  20% { opacity: 1; transform: translateX(-50%) scale(1.1); }
  70% { opacity: 1; transform: translateX(-50%) scale(1); }
  100% { opacity: 0; transform: translateX(-50%) scale(1.15) translateY(-20px); }
}

.combo-pop {
  position: absolute;
  top: 28%;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Bangers', cursive;
  font-size: 1.6rem;
  color: var(--accent-green);
  text-shadow: 0 0 16px rgba(57, 255, 20, 0.6);
  pointer-events: none;
  animation: combo-up 0.7s ease-out forwards;
}
@keyframes combo-up {
  0% { opacity: 1; transform: translateX(-50%) translateY(0) scale(0.8); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-40px) scale(1.2); }
}

.touch-hint {
  position: relative;
  z-index: 2;
  font-size: 0.68rem;
  color: rgba(255,255,255,0.4);
  text-align: center;
  margin-top: 0.15rem;
  padding-bottom: 0.1rem;
}

.back-landing {
  margin-top: 0.85rem;
  font-size: 0.78rem;
}
.back-landing a {
  color: rgba(255, 215, 0, 0.75);
  text-decoration: none;
}
.back-landing a:hover { color: #ffd700; text-decoration: underline; }

/* —— Mobile virtual controls —— */
.mobile-controls {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  display: none;
}
body.show-mobile-controls .mobile-controls,
body.mode-mobile .mobile-controls:not([hidden]) {
  display: block;
}
body.mode-mobile .touch-hint { display: none; }
body.mode-mobile #game-screen.active {
  padding-bottom: 0.2rem;
}
body.mode-mobile .canvas-wrap {
  max-height: calc(100vh - 168px);
}
body.mode-mobile #game {
  max-height: calc(100vh - 180px);
}

.stick-zone {
  pointer-events: auto;
  position: absolute;
  left: max(12px, env(safe-area-inset-left));
  bottom: max(16px, env(safe-area-inset-bottom));
  width: 128px;
  height: 128px;
  touch-action: none;
}
.stick-base {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid rgba(255, 215, 0, 0.45);
  background: rgba(10, 10, 26, 0.45);
  box-shadow: 0 0 20px rgba(138, 43, 226, 0.25);
  position: relative;
}
.stick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 52px;
  height: 52px;
  margin: -26px 0 0 -26px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe566, #c9a227 60%, #6a5010);
  border: 2px solid rgba(255,255,255,0.35);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  transform: translate(0, 0);
  will-change: transform;
}

.mobile-actions {
  pointer-events: auto;
  position: absolute;
  right: max(10px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(2, 68px);
  gap: 8px;
  touch-action: none;
}
.m-btn {
  width: 68px;
  height: 52px;
  border-radius: 14px;
  border: 2px solid rgba(255, 215, 0, 0.4);
  background: rgba(20, 12, 40, 0.72);
  color: #ffd700;
  font-family: Orbitron, sans-serif;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
}
.m-btn:active { filter: brightness(1.2); transform: scale(0.96); }
.m-btn-fire {
  grid-column: 1 / -1;
  height: 58px;
  font-size: 0.78rem;
  color: #0a0a1a;
  background: linear-gradient(180deg, #ff6b35, #c42a2a);
  border-color: rgba(255, 120, 80, 0.7);
}
.m-btn-gold {
  color: #0a0a1a;
  background: linear-gradient(180deg, #ffe566, #c9a227);
  border-color: rgba(255, 215, 0, 0.7);
}
.m-btn-hold { border-color: rgba(0, 229, 255, 0.45); color: #8ef; }

@media (max-width: 700px) {
  .game-header { gap: 0.35rem; }
  .header-title { font-size: 1rem; }
  .hud { gap: 0.3rem; }
  .hud-chip { padding: 0.25rem 0.4rem; font-size: 0.72rem; }
}

/* OVER */
.over-title {
  color: var(--blood);
  text-shadow: 0 0 24px rgba(255, 45, 85, 0.6), 0 4px 0 #4a1020;
}
.stats-grid {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin: 1rem 0 1.25rem;
}
.stat {
  min-width: 88px;
  padding: 0.75rem 0.6rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
}
.stat-n {
  display: block;
  font-family: 'Orbitron', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent-yellow);
}
.stat-l {
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.45);
}

@media (max-width: 700px) {
  .brand-float {
    padding: 4px;
    gap: 2px;
    border-radius: 10px;
  }
  .brand-float-global.brand-float-tr {
    top: max(6px, env(safe-area-inset-top));
    right: max(6px, env(safe-area-inset-right));
  }
  .brand-float-global.brand-float-bl {
    bottom: max(6px, env(safe-area-inset-bottom));
    left: max(6px, env(safe-area-inset-left));
  }
  .brand-float-global.brand-float-tr img { width: 72px; }
  .brand-float-global.brand-float-bl img { width: 64px; }
  .canvas-wrap .brand-float-on-game img { width: 48px; }
  .canvas-wrap .brand-float-on-game .brand-float-tag { display: none; }
  .brand-float-tag {
    font-size: 0.42rem;
    letter-spacing: 0.08em;
  }
  .header-presents { display: none; }
  .header-title { font-size: 1.1rem; }
  #game { max-height: calc(100vh - 140px); }
}

/* —— SOTN-inspired panels —— */
.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(ellipse 70% 65% at 50% 45%, transparent 40%, rgba(0,0,0,0.55) 100%);
}

.sotn-panel {
  border: 2px solid rgba(196, 160, 80, 0.55) !important;
  box-shadow:
    0 0 0 1px rgba(40, 20, 60, 0.8) inset,
    0 0 30px rgba(120, 40, 180, 0.25),
    0 0 50px rgba(255, 215, 0, 0.12),
    0 24px 60px rgba(0,0,0,0.5) !important;
  background:
    linear-gradient(180deg, rgba(40, 16, 56, 0.92) 0%, rgba(12, 8, 28, 0.94) 100%) !important;
}

.sotn-bar {
  border-color: rgba(196, 160, 80, 0.4) !important;
  background: linear-gradient(180deg, rgba(36, 14, 52, 0.9), rgba(10, 8, 24, 0.88)) !important;
}

.gold-chip span:last-child,
#hud-coin,
#shop-coin {
  color: #ffd700 !important;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.45);
}

.weapon-chip {
  min-width: 140px;
  max-width: 200px;
}
#hud-weapon {
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Overlays */
.overlay-panel {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 2, 12, 0.72);
  backdrop-filter: blur(6px);
  border-radius: 16px;
  padding: 0.75rem;
}
.overlay-panel[hidden] { display: none !important; }

.overlay-card {
  text-align: center;
  padding: 1.75rem 2rem;
  border-radius: 18px;
  max-width: 360px;
}
.overlay-card h2 {
  font-family: 'Cinzel', 'Bangers', serif;
  font-size: 2rem;
  letter-spacing: 0.12em;
  color: #ffd700;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}
.overlay-card p {
  color: rgba(255,255,255,0.65);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.shop-card {
  width: min(860px, 100%);
  max-height: min(480px, 92%);
  overflow: auto;
  border-radius: 18px;
  padding: 1.1rem 1.15rem 1rem;
  text-align: left;
}

.shop-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.9rem;
  flex-wrap: wrap;
}
.shop-head h2 {
  font-family: 'Cinzel', serif;
  font-size: 1.45rem;
  color: #fff8e0;
  letter-spacing: 0.06em;
  margin: 0.2rem 0;
}
.shop-sub {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.55);
}
.shop-coin {
  text-align: right;
  padding: 0.55rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 215, 0, 0.35);
  background: rgba(255, 215, 0, 0.08);
}
.shop-coin span:last-child {
  display: block;
  font-family: 'Orbitron', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.9rem;
}

.shop-item {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 0.7rem 0.75rem;
  background: rgba(0,0,0,0.28);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.12s, box-shadow 0.15s;
  text-align: left;
}
.shop-item:hover {
  border-color: rgba(255, 215, 0, 0.45);
  transform: translateY(-1px);
}
.shop-item.owned {
  border-color: rgba(57, 255, 20, 0.4);
  background: rgba(57, 255, 20, 0.06);
}
.shop-item.equipped {
  border-color: #ffd700;
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.25);
  background: rgba(255, 215, 0, 0.08);
}
.shop-item.locked {
  opacity: 0.55;
}
.shop-item .si-name {
  font-family: 'Cinzel', serif;
  font-size: 0.88rem;
  color: #fff;
  margin-bottom: 0.2rem;
}
.shop-item .si-desc {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.5);
  line-height: 1.3;
  margin-bottom: 0.45rem;
  min-height: 2.4em;
}
.shop-item .si-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.68rem;
  gap: 0.4rem;
}
.shop-item .si-price { color: #ffd700; font-weight: 700; }
.shop-item .si-status { color: var(--accent-cyan); }
.shop-item.owned .si-status { color: #39ff14; }
.shop-item.equipped .si-status { color: #ffd700; }

.shop-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}
#shop-owned {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.65);
}
.shop-foot .big-btn {
  font-size: 1.25rem;
  padding: 0.55rem 1.4rem;
  margin: 0;
}

@media (max-width: 700px) {
  .shop-card { max-height: 85%; }
  .shop-grid { grid-template-columns: 1fr 1fr; }
}

.hint-toast {
  position: absolute;
  bottom: 14%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  background: rgba(10, 6, 20, 0.88);
  border: 1px solid rgba(255, 215, 0, 0.4);
  color: #ffd700;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
}
.hint-toast[hidden] { display: none !important; }

.shop-coin-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.shop-chest-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0 0.75rem;
}
.chest-btn {
  flex: 1;
  min-width: 200px;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 215, 0, 0.4);
  background: rgba(255, 215, 0, 0.08);
  color: #ffd700;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.chest-btn:hover:not(:disabled) { background: rgba(255, 215, 0, 0.16); }
.chest-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(0.4);
}
.chest-gold {
  border-color: rgba(255, 180, 50, 0.6);
  color: #ffc14a;
  background: rgba(255, 140, 0, 0.1);
}
.chest-spin {
  text-align: center;
  padding: 0.75rem;
  margin-bottom: 0.65rem;
  border-radius: 12px;
  border: 1px solid rgba(120, 200, 255, 0.35);
  background: rgba(20, 40, 80, 0.35);
}
.chest-spin-label {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: #8cf;
  font-family: 'Orbitron', sans-serif;
}
.chest-spin-name {
  font-family: 'Cinzel', serif;
  font-size: 1.35rem;
  color: #fff;
  margin-top: 0.35rem;
  min-height: 1.6em;
}

.objective-bar {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  background: rgba(10, 6, 20, 0.9);
  border: 1px solid rgba(255, 215, 0, 0.45);
  color: #ffd700;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
}
.objective-bar[hidden] { display: none !important; }

.cutscene { z-index: 40; }
.cutscene-card {
  width: min(640px, 96%);
  max-height: 92%;
  overflow: auto;
  border-radius: 18px;
  padding: 1.35rem 1.4rem 1.2rem;
  text-align: center;
}
.cutscene-card h2 {
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  color: #fff8e0;
  margin: 0.4rem 0 0.75rem;
}
.cut-art {
  height: 140px;
  border-radius: 12px;
  margin: 0 auto 1rem;
  background:
    radial-gradient(ellipse 60% 80% at 50% 80%, rgba(255, 100, 40, 0.25), transparent),
    linear-gradient(180deg, #0a1830 0%, #1a0a20 50%, #0a1008 100%);
  border: 1px solid rgba(255, 215, 0, 0.25);
  position: relative;
  overflow: hidden;
}
.cut-art::before {
  content: "⛵";
  position: absolute;
  font-size: 3.5rem;
  left: 18%;
  bottom: 18%;
  filter: drop-shadow(0 0 12px rgba(255, 100, 40, 0.5));
  animation: boat-rock 2.5s ease-in-out infinite;
}
.cut-art::after {
  content: "🧟 🧟 🧟";
  position: absolute;
  right: 14%;
  bottom: 22%;
  font-size: 1.4rem;
  opacity: 0.85;
  letter-spacing: 0.2em;
}
@keyframes boat-rock {
  0%, 100% { transform: rotate(-4deg) translateY(0); }
  50% { transform: rotate(5deg) translateY(-6px); }
}
.cut-body {
  font-size: 0.95rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.78);
  text-align: left;
  margin: 0 0 1.15rem;
  white-space: pre-line;
}

#game {
  image-rendering: auto;
  image-rendering: high-quality;
}

.ghost-btn.music-off {
  opacity: 0.55;
  border-color: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.55);
}

/* Fullscreen: give the playfield more room */
body.is-fullscreen #game-screen.active {
  padding: 0.25rem 0.4rem 0.35rem;
}
body.is-fullscreen .brand-float-global {
  display: none !important;
}
body.is-fullscreen .brand-float-on-game {
  display: flex !important;
  opacity: 0.92;
}
body.is-fullscreen .canvas-wrap .brand-float-on-game img {
  width: clamp(52px, 7vw, 80px);
}
body.is-fullscreen .game-header {
  width: min(1400px, 100%);
}
body.is-fullscreen .hud {
  width: min(1400px, 100%);
}
body.is-fullscreen .canvas-wrap {
  width: min(1400px, 100%);
  flex: 1;
}
body.is-fullscreen #game {
  max-height: calc(100vh - 100px);
  width: min(1400px, 100%);
}
body.is-fullscreen .touch-hint {
  display: none;
}
