:root {
  --safe-full-height: calc(100svh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  --page-bg: #000000;
  --line: rgba(255, 255, 255, 0.12);
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.72);
  --accent: #fd6a2f;
  --accent-strong: #ff986b;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html,
@supports (height: 100dvh) {
  :root {
    --safe-full-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }
}

body {
  width: 100%;
  min-height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--page-bg);
  color: var(--text);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

button,
input,
textarea,
select {
  font: inherit;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.gamepad-focus {
  outline: 2px solid rgba(255, 220, 96, 0.95) !important;
  outline-offset: 3px;
  box-shadow: 0 0 0 3px rgba(255, 184, 61, 0.28), 0 10px 24px rgba(0, 0, 0, 0.26);
}

@keyframes coverPan {

    0% {
        background-position: 0% 0%;
    }

    25% {
        background-position: 55% 50%;
    }


    50% {
        background-position: 100% 100%;
    }

    75% {
        background-position: 45% 60%;
    }


    100% {
        background-position: 0% 0%;
    }
}


.app-shell,
.game-layout,
.game-stage {
  width: 100%;
  min-height: 100svh;
}

.app-shell {
  background: #000000;
}

.game-layout {
  position: relative;
}

.game-stage {
  position: relative;
  height: 100svh;
  background: #000000;
  overflow: hidden;
  touch-action: none;
}

.stage-background,
#game-canvas,
.stage-overlay {
  position: absolute;
  inset: 0;
}

.stage-background {
  z-index: 0;
  background-color: #000000;
  background-position: top center;
  background-size: cover;
  background-repeat: no-repeat;
  transform: scale(1.02);
  animation: coverPan 32s ease-in-out infinite;
  will-change: background-position, opacity;
  opacity: 0.1;
  transition: opacity 0.9s ease;
}

body.page-ready.intro-visible:not(.loading-visible):not(.game-started) .stage-background {
  opacity: 1;
}

body.loading-visible .stage-background,
body.series-starting .stage-background,
body.game-started .stage-background {
  opacity: 0.1;
}

#game-canvas {
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.stage-overlay {
  z-index: 3;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.intro-studio-link {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  z-index: 8;
  display: block;
  width: 150px;

    left: 50%;
    transform: translateX(-50%);
  }




.intro-studio-logo {
  display: block;
  width: 100%;
  height: auto;
}

body.series-select-visible .intro-studio-link,
body.series-preview-open .intro-studio-link,
body.series-starting .intro-studio-link,
body.game-started .intro-studio-link {
  opacity: 0;
  pointer-events: none;
}

.loading-overlay {
  z-index: 6;
  background: #000000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.32s ease;
}

body.loading-visible .loading-overlay {
  opacity: 1;
}

.game-over-overlay,
.series-complete-overlay,
.gallery-overlay {
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(22px, calc(env(safe-area-inset-bottom) + 12px)) max(18px, env(safe-area-inset-left));
  background: rgba(0, 0, 0, 0);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease, background-color 0.45s ease;
}

.game-over-card,
.series-complete-card,
.gallery-card,
.level-title-card {
  color: #ffffff;
  font-size: clamp(1.9rem, 6.4vw, 4.8rem);
  font-weight: 900;
  letter-spacing: -0.06em;
  text-transform: uppercase;
  text-shadow: 0 10px 34px rgba(0, 0, 0, 0.55);
  transform: translateY(14px) scale(0.96);
  opacity: 0;
  transition: transform 0.45s ease, opacity 0.45s ease;
}

.game-over-gallery,
.series-complete-gallery,
.gallery-screen-wrap {
  width: min(92vw, 980px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.gallery-screen {
  height: 60vh;
  max-height: 60vh;
  overflow-y: auto;
  overflow-x: hidden;
}

@keyframes titleTrackingIn {
  from {
    letter-spacing: -0.2em;
  }
  to {
    letter-spacing: -0.06em;
  }
}

.game-over-gallery.is-empty,
.series-complete-gallery.is-empty,
.gallery-screen-wrap.is-empty {
  width: auto;
  justify-items: center;
}

.game-over-gallery.is-empty .game-over-thumbs,
.series-complete-gallery.is-empty .series-complete-thumbs {
  display: none;
}

.gallery-screen-wrap.is-empty .game-over-thumbs {
  display: none;
}

.gallery-empty {
  text-align: center;
  padding: 28px 12px;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
}

.gallery-screen > .game-over-thumbs {
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: visible;
}

.gallery-screen .game-over-series-row {
  width: 100%;
}

.gallery-screen .game-over-thumbs-inline {
  overflow-x: auto;
  overflow-y: hidden;
}

.gallery-note {
  text-align: center;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.74);
}

.gallery-photobook-row[hidden] {
  display: none;
}

.gallery-photobook-row {
  margin-bottom: 8px;
}

.gallery-photobook-row .game-over-thumbs-inline {
  overflow-x: auto;
  overflow-y: hidden;
}

.level-title-overlay {
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.level-title-card {
  opacity: 0;
  transform: translateY(10px) scale(0.96);
}

body.level-title-visible .level-title-overlay {
  opacity: 1;
}

body.level-title-visible .level-title-card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

body.game-over-visible .game-over-card,
body.series-complete-visible .series-complete-card,
body.gallery-visible .gallery-card,
body.series-select-visible .intro-series-title,
body.level-title-visible .level-title-card {
  animation: titleTrackingIn 3s ease-out both;
}


.game-over-viewer {
  position: fixed;
  inset:
    max(0px, env(safe-area-inset-top))
    max(0px, env(safe-area-inset-right))
    max(0px, env(safe-area-inset-bottom))
    max(0px, env(safe-area-inset-left));
  display: none;
  border-radius: 0;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.98);
  border: 0;
  box-shadow: none;
  touch-action: none;
  z-index: 30;
}

.game-over-close {
  position: absolute;
  top: max(14px, calc(env(safe-area-inset-top) + 8px));
  right: max(14px, calc(env(safe-area-inset-right) + 8px));
  z-index: 40;
  min-width: 48px;
  min-height: 48px;
  padding: 0;
  font-size: 1.1rem;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  touch-action: manipulation;
}

.game-over-next {
  position: absolute;
  left: 50%;
  bottom: max(18px, calc(env(safe-area-inset-bottom) + 12px));
  z-index: 40;
  transform: translateX(-50%);
  min-width: min(68vw, 240px);
  opacity: 0;
  pointer-events: none;
  touch-action: manipulation;
  transition: opacity 0.18s ease;
}

.game-over-next,
.game-over-next:hover,
.game-over-next:focus,
.game-over-next:focus-visible,
.game-over-next:active {
  transform: translateX(-50%) !important;
  translate: none !important;
}

.game-over-next[hidden] {
  display: none;
}

.game-over-image,
.game-over-empty {
  position: absolute;
  inset: 0;
}

.game-over-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: center center;
  will-change: transform, opacity;
  opacity: 0;
  transition: opacity 0.22s ease;
  pointer-events: none;
}

.game-over-empty {
  display: grid;
  place-items: center;
  padding: 20px;
  text-align: center;
  color: rgba(255, 255, 255, 0.76);
  font-size: clamp(0.96rem, 2vw, 1.12rem);
}


.game-over-series-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.game-over-series-title {
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.game-over-thumbs-inline {
  overflow-x: auto;
}

.game-over-thumbs,
.series-complete-thumbs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scrollbar-width: thin;
}

.game-over-thumb {
  width: clamp(76px, 12vw, 110px);
  aspect-ratio: 1;
  position: relative;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  padding: 0;
  flex: 0 0 auto;
}

.game-over-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.game-over-thumb.is-locked {
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
  cursor: default;
  opacity: 0.92;
}

.game-over-thumb.is-locked::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(0, 0, 0, 0.18));
}

.game-over-lock {
  position: relative;
  z-index: 1;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 900;
  color: rgba(255, 255, 255, 0.86);
  text-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.game-over-thumb.is-active {
  border-color: rgba(255, 173, 89, 0.92);
  box-shadow: 0 0 0 2px rgba(255, 173, 89, 0.3);
}

.game-over-button,
.series-complete-button,
.gallery-back-button {
  justify-self: center;
  min-width: min(72vw, 320px);
  padding: 0 28px;
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.36);
}

body.game-over-image-open .game-over-card,
body.game-over-image-open .game-over-thumbs,
body.game-over-image-open .game-over-button,
body.game-over-image-open .series-complete-card,
body.game-over-image-open .series-complete-thumbs,
body.game-over-image-open .series-complete-button,
body.game-over-image-open .gallery-card,
body.game-over-image-open .gallery-screen .game-over-thumbs,
body.game-over-image-open .gallery-back-button {
  opacity: 0;
  pointer-events: none;
}

body.game-over-image-open .game-over-viewer {
  display: block;
}

body.game-over-image-open .game-over-gallery {
  transform: none !important;
  transition: none !important;
}

body.game-over-image-open .game-over-overlay,
body.game-over-image-open .gallery-overlay {
  background: rgba(0, 0, 0, 0.92);
}

body.game-over-image-open .game-over-close {
  opacity: 1;
  pointer-events: auto;
}

body.game-over-image-open .game-over-next:not([hidden]) {
  opacity: 1;
  pointer-events: auto;
}

.next-level-overlay {
  z-index: 6;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0;
  background: rgba(0, 0, 0, 0.96);
  opacity: 0;
  pointer-events: none;
  touch-action: none;
  transition: opacity 0.3s ease;
}

.next-level-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: auto;
  touch-action: none;
  will-change: transform;
}

.next-level-actions {
  position: absolute;
  left: max(16px, env(safe-area-inset-left));
  right: max(16px, env(safe-area-inset-right));
  bottom: max(18px, calc(env(safe-area-inset-bottom) + 10px));
  z-index: 1;
  display: flex;
  justify-content: center;
}

.next-level-button {
  min-width: min(72vw, 320px);
  padding: 0 28px;
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.36);
  pointer-events: auto;
}

body.awaiting-advance .next-level-overlay {
  opacity: 1;
  pointer-events: auto;
}

.intro-overlay {
  display: flex;
  align-items: stretch;
  padding:
    max(16px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
}

.intro-panel {
  width: 400px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: visible;
}

.panel-top,
.panel-bottom {
 // border-radius: 24px;

}

.panel-top {
}
.game-logo {
  transition:all 2s ease-out;
  transform:scale(1);
  opacity:1;
  width:100%;
  max-width:400px;
  margin:auto;
  height: auto;
  display: block;
  margin-top:30vh;
}

.biglogo{
  transform:scale(2);
  opacity:0;
}
.stage-overlay.intro-overlay{
width: 400px;
margin:auto;
}





.panel-bottom {
  margin-top: auto;
  padding: clamp(18px, 2vw, 24px);
  // background: linear-gradient(180deg, rgba(16, 19, 28, 0.34) 0%, rgba(8, 10, 16, 0.82) 28%, rgba(5, 6, 10, 0.97) 100%);
  // box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
p,
ul {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 3.8vw, 3.5rem);
  line-height: 0.96;
  letter-spacing: -0.05em;
  max-width: 7ch;
}

.panel-copy {
  margin-top: 12px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.menu-actions {
  position: relative;
  display: grid;
  gap: 10px;
}

.menu-secondary-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  font-size: 15px;
}

.menu-secondary-actions-two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}


.intro-panel.options-open [data-action="settings"] {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

.intro-options-panel {
  position: absolute;
  right: 0;
  bottom: 60px;
  width: min(320px, calc(100vw - 32px));
  z-index: 3;
  display: grid;
  gap: 8px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  padding: 0 14px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.24);
  transform: translateY(8px);
  transition: max-height 0.28s ease, opacity 0.22s ease, padding 0.22s ease, transform 0.22s ease;
}

.intro-options-panel.is-open {
  max-height: 260px;
  opacity: 1;
  pointer-events: auto;
  padding: 14px;
  transform: translateY(0);
}

.intro-options-panel .graphics-picker,
.intro-options-panel .audio-picker {
  margin: 0;
  gap: 8px;
}

.intro-options-panel .graphics-picker {
  margin-bottom: 0;
}

.intro-options-panel .graphics-label {
  color: rgba(18, 18, 18, 0.72);
}

.intro-options-panel .graphics-option {
  min-height: 38px;
  border-color: rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.05);
  color: rgba(18, 18, 18, 0.88);
}

.intro-options-panel .graphics-option.is-active {
  background: rgba(0, 0, 0, 0.12);
  border-color: rgba(0, 0, 0, 0.2);
  color: #111111;
}

.intro-options-panel .audio-toggle {
  min-height: 32px;
  border-color: rgba(0, 0, 0, 0.14);
  background: rgba(0, 0, 0, 0.08);
  color: #111111;
}

.intro-options-panel .audio-toggle.is-off {
  background: rgba(0, 0, 0, 0.04);
  color: rgba(18, 18, 18, 0.62);
}

.intro-options-panel .audio-slider {
  accent-color: #111111;
}

.primary-action,
.secondary-action,
.touch-button {
  min-height: 38px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, opacity 0.2s ease;
  font-size:18px;
}

.primary-action:hover,
.primary-action:focus-visible,
.secondary-action:hover,
.secondary-action:focus-visible,
.touch-button:hover,
.touch-button:focus-visible {
  transform: translateY(-1px);
}

.primary-action {
  background: linear-gradient(135deg, var(--accent) 0%, #ff8f4d 100%);
  color: #150b06;
  font-weight: 800;
}

.secondary-action {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line);
  color: var(--text);
  font-weight: 700;
}

.settings-preview {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
}

.settings-preview h2 {
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.settings-preview ul {
  padding-left: 16px;
  color: var(--muted);
  display: grid;
  gap: 8px;
}

.status-line {
  margin-top: 14px;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.86);
}

.game-hud,
.control-dock {
  display: none;
}

body.intro-visible .intro-overlay {
  opacity: 1;
  pointer-events: auto;
}

body:not(.intro-visible) .intro-overlay {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

body.game-started #game-canvas {
  opacity: 1;
}

body.game-over-visible .game-over-overlay {
  opacity: 1;
  background: rgba(0, 0, 0, 1);
  pointer-events: auto;
}

body.game-over-visible #game-canvas,
body.game-over-visible .stage-background,
body.game-over-visible .status-line,
body.game-over-visible .game-hud {
  opacity: 0 !important;
  pointer-events: none !important;
}

body.game-over-visible .game-hud {
  display: none !important;
}

body.game-over-visible .game-over-card,
body.game-over-visible .game-over-gallery {
  opacity: 1;
  transform: translateY(0) scale(1);
}

body.series-complete-visible .series-complete-overlay {
  opacity: 1;
  background: rgba(0, 0, 0, 0.74);
  pointer-events: auto;
}

body.series-complete-visible .series-complete-card,
body.series-complete-visible .series-complete-gallery {
  opacity: 1;
  transform: translateY(0) scale(1);
}

body.gallery-visible .gallery-overlay {
  opacity: 1;
  background: rgba(0, 0, 0, 0.74);
  pointer-events: auto;
}

body.gallery-visible .gallery-card,
body.gallery-visible .gallery-screen-wrap {
  opacity: 1;
  transform: translateY(0) scale(1);
}

body.game-started .game-hud {
  position: absolute;
  top: max(8px, env(safe-area-inset-top));
  left: max(10px, env(safe-area-inset-left));
  right: max(10px, env(safe-area-inset-right));
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

.hud-item {
  min-width: 0;
  padding: 5px 8px;
  background: transparent;
  border: 0;
  backdrop-filter: none;
  white-space: nowrap;
}

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

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

.hud-icon {
  display: inline-block;
  margin-right: 6px;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.55);
  vertical-align: middle;
}

#hud-lives {
  letter-spacing: 0.08em;
}

.hud-left strong {
  color: rgba(255, 232, 240, 0.98);
}

.hud-item strong {
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.55);
}

body.game-started .control-dock {
  position: absolute;
  left: max(10px, env(safe-area-inset-left));
  right: max(10px, env(safe-area-inset-right));
  bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 5;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 12px;
  pointer-events: auto;
}

body.intro-visible .control-dock,
body.awaiting-advance .control-dock,
body.game-over-visible .control-dock,
body.series-complete-visible .control-dock {
  display: none !important;
  pointer-events: none !important;
}

.controls-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  user-select: none;
}

.controls-zone-left {
  flex: 1 1 50%;
  min-height: clamp(112px, 24vh, 190px);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0);
  background: rgba(0, 0, 0, 0);
}

.controls-zone-right {
  flex: 1 1 50%;
  min-height: clamp(112px, 24vh, 190px);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0);
  background: rgba(0, 0, 0, 0);
}

.joystick {
  width: min(28vw, 126px);
  height: min(28vw, 126px);
  display: grid;
  place-items: center;
  touch-action: none;
}

.joystick-base {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.06) 55%, rgba(255, 255, 255, 0.1));
  display: grid;
  place-items: center;
  opacity: 0.5;
}

.joystick-stick {
  width: min(13vw, 50px);
  height: min(13vw, 50px);
  border-radius: 50%;
  background: radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.95) 0%, rgba(245, 245, 245, 0.75) 38%, rgba(220, 220, 220, 0.52) 100%);
  box-shadow:
    inset 0 6px 10px rgba(255, 255, 255, 0.34),
    inset 0 -8px 12px rgba(0, 0, 0, 0.14),
    0 10px 16px rgba(255, 255, 255, 0.16);
  opacity: 0.5;
  transform: translate3d(0, 0, 0);
  transition: transform 0.12s ease-out;
}

.touch-button {
  width: min(26vw, 110px);
  min-height: min(26vw, 110px);
  background: radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.95) 0%, rgba(245, 245, 245, 0.78) 26%, rgba(214, 214, 214, 0.56) 100%);
  color: rgba(255, 255, 255, 0.8);
  font-size: clamp(1.15rem, 5vw, 1.9rem);
  font-weight: 900;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.1);
  box-shadow:
    inset 0 10px 14px rgba(255, 255, 255, 0.26),
    inset 0 -12px 18px rgba(0, 0, 0, 0.12),
    0 14px 26px rgba(255, 255, 255, 0.12);
  opacity: 0.5;
  touch-action: none;
  user-select: none;
}

.joystick.is-active .joystick-base {
  box-shadow:
    inset 0 1px 8px rgba(255, 255, 255, 0.12),
    0 0 0 1px rgba(255, 184, 68, 0.18);
}

.touch-button.is-pressed {
  transform: translateY(2px) scale(0.98);
  background: radial-gradient(circle at 30% 28%, rgba(255, 250, 182, 0.98) 0%, rgba(255, 215, 74, 0.88) 34%, rgba(214, 135, 18, 0.92) 100%);
  box-shadow:
    inset 0 6px 10px rgba(255, 252, 214, 0.34),
    inset 0 -8px 14px rgba(121, 58, 0, 0.42),
    0 0 0 2px rgba(255, 220, 88, 0.42),
    0 6px 12px rgba(91, 30, 0, 0.28);
}

@media (min-width: 900px) {
  body.game-started .game-hud {
    left: 18px;
    right: 18px;
    top: 14px;
  }

  .hud-label {
    font-size: 0.62rem;
  }

  .hud-item strong {
    font-size: 1rem;
  }

  body.game-started .control-dock {
    display: none;
  }
}

@media (max-width: 720px) {
  .stage-background {
    opacity: 0.1;
    // transition: none;
  }

  body.loading-visible .stage-background,
  body.series-starting .stage-background,
  body.game-started .stage-background {
    opacity: 1;
  }


  

  .menu-secondary-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .menu-secondary-actions-two-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .intro-options-panel {
    right: 0;
    bottom: 60px;
    width: min(92vw, 320px);
  }

  .intro-panel {
    width:100%;
    overflow: visible;
  }
.stage-overlay.intro-overlay{
width: 100%;
}


  .panel-bottom {
    padding: 5px;
    overflow: visible;
  }

  h1 {
    font-size: clamp(1.4rem, 6vw, 2.1rem);
  }

  .panel-copy,
  .settings-preview ul,
  .status-line {
    font-size: 0.82rem;
  }
}

@media (max-width: 520px) {


  .settings-preview {
    display: none;
  }

  body.game-started .game-hud {
    left: max(8px, env(safe-area-inset-left));
    right: max(8px, env(safe-area-inset-right));
    top: max(6px, env(safe-area-inset-top));
  }

  body.game-started .control-dock {
    left: max(8px, env(safe-area-inset-left));
    right: max(8px, env(safe-area-inset-right));
    bottom: max(8px, env(safe-area-inset-bottom));
    gap: 8px;
  }

  .controls-zone-left,
  .controls-zone-right {
    min-height: clamp(102px, 23vh, 160px);
    border-radius: 18px;
  }
}


.graphics-picker {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.graphics-label {
  font-size: 0.72rem;
  font-weight: 700;
    text-align: left;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.68);
}

.graphics-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.graphics-option {
  min-height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.84);
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.graphics-option.is-active {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}


.intro-series-overlay,
.intro-series-viewer {
  position: absolute;
  inset: 0;
}

.intro-series-overlay {
  display: none;
  align-items: center;
  justify-content: center;
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(20px, calc(env(safe-area-inset-bottom) + 10px)) max(18px, env(safe-area-inset-left));
  background: rgba(0, 0, 0, 0.34);
  z-index: 5;
}

.intro-series-card {
  width: min(92vw, 1080px);
  max-height: min(84svh, 820px);
  display: grid;
  gap: 16px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.intro-series-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.intro-series-title {
  margin: 0;
  text-align: center;
  color: #ffffff;
  font-size: clamp(1.9rem, 6.4vw, 4.8rem);
  font-weight: 900;
  letter-spacing: -0.06em;
  text-transform: uppercase;
  text-shadow: 0 10px 34px rgba(0, 0, 0, 0.55);
}

.intro-series-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(138px, 168px));
  justify-content: center;
  gap: 18px;
  overflow: auto;
  padding-right: 4px;
}

.intro-series-footer {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.intro-series-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 28px 12px;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
}

.intro-series-menu {
  min-width: 180px;
}

.intro-series-thumb {
  position: relative;
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 8px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

.intro-series-thumb img {
  width: 100%;
  aspect-ratio: 1;
  display: block;
  object-fit: cover;
  border-radius: 12px;
}

.intro-series-thumb span {
  display: block;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.92);
}

.intro-series-thumb-placeholder {
  cursor: default;
  opacity: 0.42;
}

.intro-series-thumb-placeholder-image {
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

.intro-series-viewer {
  display: none;
  background: rgba(0, 0, 0, 0.96);
  z-index: 8;
  touch-action: none;
  opacity: 1;
  transition: opacity 0.26s ease;
}

.intro-series-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: center center;
  will-change: transform;
  pointer-events: auto;
  touch-action: none;
  opacity: 1;
  transition: opacity 0.45s ease;
}

.intro-series-close {
  position: absolute;
  pointer-events: auto;
  touch-action: manipulation;
  top: max(14px, calc(env(safe-area-inset-top) + 8px));
  right: max(14px, calc(env(safe-area-inset-right) + 8px));
  z-index: 12;
  min-width: 48px;
  min-height: 48px;
  padding: 0;
}

.intro-series-viewer-actions {
  position: absolute;
  pointer-events: auto;
  left: max(16px, env(safe-area-inset-left));
  right: max(16px, env(safe-area-inset-right));
  bottom: max(18px, calc(env(safe-area-inset-bottom) + 10px));
  z-index: 11;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  display: none;
  overflow-y: auto;
  overflow-x: hidden;
}

body.gallery-visible .intro-panel {
  display: none;
}

body.gallery-visible .gallery-overlay {
  display: flex;
}

body.series-select-visible .intro-panel {
  display: none;
}

body.series-select-visible .intro-series-overlay {
  display: flex;
}

body.series-preview-open .intro-series-overlay {
  display: none;
}

body.series-preview-open .intro-series-viewer {
  display: block;
}

body.series-starting .intro-series-close,
body.series-starting .intro-series-viewer-actions {
  opacity: 0;
  pointer-events: none;
}

body.series-fading-out .intro-series-viewer {
  opacity: 0;
}

@media (max-width: 640px) {
  .intro-series-card {
    width: 100%;
    max-height: calc(100svh - max(24px, env(safe-area-inset-top)) - max(24px, env(safe-area-inset-bottom)));
    overflow: hidden;
  }

  .intro-series-head {
    align-items: stretch;
    flex-direction: column;
  }

  .intro-series-grid {
    grid-template-columns: repeat(2, minmax(108px, 1fr));
    justify-content: stretch;
    align-content: start;
    gap: 12px;
    max-height: min(62svh, calc(100svh - 210px));
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 2px;
  }

  .intro-series-thumb {
    gap: 6px;
    padding: 6px;
    border-radius: 14px;
  }

  .intro-series-thumb img,
  .intro-series-thumb-placeholder-image {
    border-radius: 10px;
  }

  .intro-series-thumb span {
    font-size: 0.72rem;
  }

  .intro-series-menu,
  .intro-series-viewer-actions .primary-action,
  .intro-series-viewer-actions .secondary-action {
    width: 100%;
  }

  .intro-series-viewer-actions {
    gap: 10px;
  }
}

.intro-series-thumb.is-completed {
  cursor: default;
}

.intro-series-thumb.is-completed img {
  opacity: 0.74;
}

.intro-series-crown {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -58%);
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 30%, rgba(255, 247, 196, 0.98) 0%, rgba(255, 214, 74, 0.94) 38%, rgba(170, 105, 6, 0.94) 100%);
  color: #fff8d1;
  font-size: 1.8rem;
  line-height: 1;
  text-shadow: 0 2px 8px rgba(104, 58, 0, 0.44);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.34), 0 0 0 1px rgba(255, 248, 203, 0.28);
  pointer-events: none;
}

.intro-series-viewer-actions button {
  position: relative;
  z-index: 13;
  pointer-events: auto;
  touch-action: manipulation;
}

.series-back-button {
  background: rgba(255, 255, 255, 0.5);
  color: #000000;
  border-color: rgba(255, 255, 255, 0.18);
}

.series-back-button:hover,
.series-back-button:focus-visible {
  background: rgba(255, 255, 255, 0.62);
  color: #000000;
}


.pause-overlay {
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(22px, calc(env(safe-area-inset-bottom) + 12px)) max(18px, env(safe-area-inset-left));
  background: rgba(0, 0, 0, 0);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, background-color 0.35s ease;
}

.pause-card,
.pause-panel {
  opacity: 0;
  transform: translateY(14px) scale(0.96);
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.pause-card {
  color: #ffffff;
  font-size: clamp(2rem, 7vw, 4.8rem);
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: 0 10px 34px rgba(0, 0, 0, 0.55);
}

.pause-panel {
  width: min(90vw, 420px);
  padding: 22px;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 12, 18, 0.78);
  backdrop-filter: blur(20px);
  display: grid;
  gap: 16px;
}

.pause-actions {
  display: grid;
  gap: 10px;
}

body.pause-visible .pause-overlay {
  opacity: 1;
  background: rgba(0, 0, 0, 0.68);
  pointer-events: auto;
}

body.pause-visible .pause-card,
body.pause-visible .pause-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.tutorial-overlay {
  z-index: 7;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: rgba(0, 0, 0, 0);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, background-color 0.35s ease;
}

.tutorial-stage {
  position: relative;
  width: min(100vw, 1600px);
  min-height: var(--safe-full-height);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  align-items: center;
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(22px, calc(env(safe-area-inset-bottom) + 12px)) max(18px, env(safe-area-inset-left));
  box-sizing: border-box;
}

.tutorial-character {
  display: block;
  justify-self: center;
  align-self: end;
  width: auto;
  height: var(--safe-full-height);
  max-width: none;
  max-height: none;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 18px 42px rgba(0, 0, 0, 0.42));
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.tutorial-overlay.has-character {
  align-items: center;
  justify-content: center;
}

.tutorial-overlay.has-character .tutorial-stage {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  justify-items: stretch;
}

.tutorial-panel {
  position: relative;
  width: min(92vw, 540px);
  max-height: min(80vh, 720px);
  margin-inline: auto;
  padding: 22px 22px 20px;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(8, 12, 18, 0.82);
  backdrop-filter: blur(20px);
  display: grid;
  gap: 16px;
  opacity: 0;
  transform: translateY(14px) scale(0.96);
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.tutorial-overlay.has-character .tutorial-panel {
  width: min(44vw, 540px);
  justify-self: center;
  align-self: center;
  margin-inline: auto;
}

.tutorial-title[hidden],
.tutorial-image[hidden],
.tutorial-character[hidden] {
  display: none !important;
}

.tutorial-close {
  position: absolute;
  top: 14px;
  right: 14px;
  min-width: 44px;
  padding-inline: 0;
}

.tutorial-title {
  color: #ffffff;
  font-size: clamp(1.05rem, 3vw, 1.4rem);
  font-weight: 800;
  text-align: left;
  margin: 0 0 10px;
}

.tutorial-image {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 30vh;
  max-height: 30vh;
  margin: 0 auto 6px;
  object-fit: contain;
  border-radius: 0;
  border: 0;
  background: transparent;
}


.tutorial-text {
  color: rgba(255, 255, 255, 0.92);
  font-size: clamp(1rem, 2.8vw, 1.14rem);
  line-height: 1.5;
  text-align: center;
  white-space: pre-wrap;
}

.tutorial-actions {
  display: flex;
  justify-content: center;
}

.tutorial-actions .primary-action {
  min-width: min(72vw, 320px);
  padding: 0 28px;
}
body.tutorial-visible .tutorial-overlay {
  opacity: 1;
  background: rgba(0, 0, 0, 0.7);
  pointer-events: auto;
}

body.tutorial-visible .tutorial-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
}

body.tutorial-visible .tutorial-character {
  opacity: 1;
}

body.tutorial-visible .control-dock {
  display: none !important;
  pointer-events: none !important;
}

body.pause-visible .control-dock {
  display: none !important;
  pointer-events: none !important;
}

.hud-center {
  pointer-events: auto;
  cursor: pointer;
}


.panic-toggle.is-active {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

.audio-picker {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

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

.audio-toggle {
  min-height: 34px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
}

.audio-toggle.is-off {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.7);
}

.audio-slider {
  width: 100%;
  accent-color: #ffffff;
}

.pause-audio-picker {
  margin-top: 14px;
}


.cutscene-overlay {
  z-index: 7;
  display: block;
  opacity: 0;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.28);
  transition: opacity 0.28s ease;
}

body.cutscene-visible .cutscene-overlay {
  opacity: 1;
  pointer-events: auto;
}

.cutscene-background {
  position: absolute;
  inset: 0;
  background-color: #000000;
  background-position: left top;
  background-repeat: no-repeat;
  background-size: 140%;
  animation: cutsceneBgScroll var(--cutscene-scroll-seconds, 20s) ease-in-out infinite alternate;
  filter: brightness(1);
  transition: filter 1s ease;
  will-change: background-position, filter;
}

.cutscene-background.is-static-filter {
  transition: none !important;
}

.cutscene-overlay.is-static-visibility {
  transition: none !important;
}

@keyframes cutsceneBgScroll {
  from {
    background-position: left top;
  }
  to {
    background-position: right top;
  }
}

@media (max-aspect-ratio: 5/3) {
  .cutscene-background {
    background-size: cover;
  }
}
@media (min-aspect-ratio: 6/3) {
@keyframes cutsceneBgScroll {
  from {
    background-position: left 20%;
  }
  to {
    background-position: right 20%;
  }
}
}
.cutscene-cast {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.cutscene-dialog {
  position: absolute;
  left: 50%;
  bottom: max(18px, calc(env(safe-area-inset-bottom) + 8px));
  z-index: 9;
  transform: translateX(-50%);
}

.cutscene-character {
  position: absolute;
  bottom: 0;
  opacity: 1;
  transition: opacity 0.5s ease;
  z-index: 5;
}

.cutscene-character-left {
  left: calc(50% - min(92vw, 980px) / 2 - 30vh);
  width: auto;
  height: var(--safe-full-height);
  transition: opacity 0.5s ease, transform 0.34s ease;
}

.cutscene-character-left.is-entering {
  animation: cutsceneCharacterFade 1s ease;
  animation-fill-mode: both;
}

.cutscene-character-left.is-fading {
  animation: cutsceneCharacterFade 1s ease;
  animation-fill-mode: both;
}

.cutscene-character-right-group {
  position: absolute;
  right: calc(50% - min(92vw, 980px) / 2 - 30vh);
  bottom: 0;
  width: min(52vw, 620px);
  height: var(--safe-full-height);
}

.cutscene-character-right {
  right: var(--cutscene-right-offset, 0px);
  width: auto;
  height: var(--safe-full-height);
  opacity: 1;
  transition: right 0.5s ease, opacity 0.5s ease;
}

.cutscene-character-right.is-leaving {
  animation: cutsceneCharacterFadeOut 0.5s ease forwards;
  animation-fill-mode: both;
}

.cutscene-character-image {
  display: block;
  width: auto;
  height: var(--safe-full-height);
  object-fit: contain;
  object-position: bottom left;
  opacity: 1;
  transition: opacity 0.5s ease;
}

.cutscene-character-right .cutscene-character-image {
  object-position: bottom right;
}
.cutscene-character-left.is-flipped .cutscene-character-image {
  transform: scaleX(-1);
}

.cutscene-character-right.is-flipped .cutscene-character-image {
  transform: scaleX(-1);
}

.cutscene-dialog {
  width: min(92vw, 980px);
  padding: 14px 16px 16px;
  border-radius: 24px;
  background: rgba(8, 10, 16, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.34);
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
  font-size:20px;
}

.cutscene-visible .cutscene-dialog:not(.is-hidden) {
  opacity: 1;
}

.cutscene-dialog.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.cutscene-inline-image {
  display: none !important;
}

.cutscene-speaker {
  position: absolute;
  left: -6px;
  top: -26px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #111;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
}

.cutscene-dialog.is-thought .cutscene-speaker {
  display: none;
}

.cutscene-text {
  min-height: 1.45em;
  white-space: pre-wrap;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.96);
}

.cutscene-text.is-thought {
  font-style: italic;
}

.cutscene-text.is-typing::after {
  content: "|";
  display: inline-block;
  margin-left: 0.06em;
  color: inherit;
  animation: cutsceneTypingCursor 1s steps(1, end) infinite;
}

@keyframes cutsceneTypingCursor {
  0%, 49.999% {
    opacity: 1;
  }
  50%, 100% {
    opacity: 0;
  }
}

.cutscene-emphasis {
  color: #ffd84d;
  font-weight: 800;
}

.cutscene-choices {
  --cutscene-choice-columns: 3;
  display: grid;
  grid-template-columns: repeat(var(--cutscene-choice-columns), minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
  margin-top: 12px;
}

.cutscene-advance-hint,
.cutscene-next-button {
  position: absolute;
  right: 14px;
  bottom: 10px;
  z-index: 3;
}

.cutscene-advance-hint {
  color: rgba(255,255,255,0.82);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.08em;
  opacity: 0;
  transform: translateY(0);
  transition: opacity 0.18s ease;
  pointer-events: none;
}

.cutscene-advance-hint.is-visible {
  opacity: 1;
  animation: cutsceneAdvancePulse 0.9s ease-in-out infinite alternate;
}

.cutscene-next-button {
  color: rgba(255,255,255,0.9);
  font-size: 0.8rem;
  font-style: italic;
  font-weight: 500;
  text-transform: lowercase;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.cutscene-next-button.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.cutscene-next-button,
.cutscene-next-button:hover,
.cutscene-next-button:focus,
.cutscene-next-button:active {
  transform: none !important;
  translate: none !important;
}

@keyframes cutsceneAdvancePulse {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-2px);
  }
}

.cutscene-choice {
  min-width: 0;
  width: 100%;
    padding: 10px;
    font-size: 17px;
}

.cutscene-dialog.has-strip-poker .cutscene-choices,
.cutscene-dialog.has-strip-poker .cutscene-advance-hint,
.cutscene-dialog.has-strip-poker .cutscene-next-button {
  display: none !important;
}

.cutscene-strip-poker[hidden] {
  display: none !important;
}

.cutscene-strip-poker {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.cutscene-strip-poker-opponent-area[hidden] {
  display: none !important;
}

.cutscene-strip-poker-opponent-area {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 8;
  width: min(86vw, 1180px);
  pointer-events: none;
}

.cutscene-strip-poker-scoreboard {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: nowrap;
  color: rgba(255,255,255,.84);
  font-size: .9rem;
  font-weight: 700;
}

.cutscene-strip-poker-scoreboard > * {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 0;
}

.strip-poker-life-label {
  font-weight: 800;
  color: rgba(255,255,255,.96);
  white-space: nowrap;
}

.strip-poker-life-icons {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.strip-poker-life-icon {
  width: 50px;
  height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 50px;
  transition: opacity .18s ease, transform .18s ease, filter .18s ease;
}

.strip-poker-life-icon img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  display: block;
}

.strip-poker-life-icon.is-lost {
  opacity: 0;
  transform: scale(.82);
  pointer-events: none;
}

.strip-poker-life-icon.is-fallback {
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.28);
}

.strip-poker-life-icon.is-fallback.is-lost {
  opacity: .14;
}

.cutscene-strip-poker-hand {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
}

.cutscene-strip-poker-player-hand.is-strip-tris-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, min(96px, 1fr)));
  justify-content: center;
  gap: 6px;
  max-width: min(320px, 100%);
  margin-inline: auto;
}

.strip-tris-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  padding: 4px;
  border: 2px solid rgba(255,255,255,.34);
  border-radius: 12px;
  background: rgba(255,255,255,.04);
  min-width: 0;
}

.strip-tris-board.is-forced {
  border-color: rgba(255, 196, 92, .95);
  box-shadow: 0 0 0 2px rgba(255, 196, 92, .22);
}

.strip-tris-board.is-won-x {
  background: rgba(80, 135, 255, .12);
  border-color: rgba(80, 135, 255, .55);
}

.strip-tris-board.is-won-o {
  background: rgba(255, 120, 120, .12);
  border-color: rgba(255, 120, 120, .55);
}

.strip-tris-board.is-won-x::after,
.strip-tris-board.is-won-o::after {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: clamp(2.8rem, 9vw, 5.8rem);
  line-height: 1;
  pointer-events: none;
  opacity: .88;
  z-index: 2;
}

.strip-tris-board.is-won-x::after {
  content: "X";
  color: rgba(95, 143, 255, .9);
}

.strip-tris-board.is-won-o::after {
  content: "O";
  color: rgba(255, 125, 110, .9);
}

.strip-tris-board {
  position: relative;
}

.strip-tris-cell {
  aspect-ratio: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.03);
  color: rgba(255,255,255,.98);
  font-size: clamp(1rem, 3vw, 1.9rem);
  font-weight: 900;
  line-height: 1;
  transition: transform .12s ease, border-color .12s ease, background .12s ease, opacity .12s ease;
}

.strip-tris-cell.is-x {
  color: #5f8fff;
}

.strip-tris-cell.is-o {
  color: #ff7d6e;
}

.strip-tris-cell.is-playable {
  cursor: pointer;
}

@media (hover:hover) and (pointer:fine) {
  .strip-tris-cell.is-playable:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 196, 92, .95);
    background: rgba(255,255,255,.08);
  }
}

.strip-tris-cell:disabled {
  cursor: default;
  opacity: 1;
}

.cutscene-strip-poker-opponent-area .cutscene-strip-poker-hand {
  grid-template-columns: repeat(5, minmax(50px, 79px));
  justify-content: center;
  gap: 8px;
}

.cutscene-strip-poker-opponent-area .strip-poker-card {
  cursor: default;
  pointer-events: none;
}

.cutscene-strip-poker-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
  min-height: 38px;
}

.cutscene-strip-poker-button {
  min-width: 120px;
  margin-inline: 0;
}

.cutscene-strip-poker-hint {
  text-align: center;
  color: rgba(255,255,255,.72);
  font-size: .84rem;
}

.strip-poker-card {
  position: relative;
  aspect-ratio: 250 / 350;
  border-radius: 10px;
  border: 2px solid rgba(255,255,255,.1);
  background-color: #f4f1ea;
  background-repeat: no-repeat;
  background-size: calc(100% * 13) calc(100% * 4);
  box-shadow: 0 8px 20px rgba(0,0,0,.25);
  overflow: hidden;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, opacity 0.18s ease;
  transform-style: preserve-3d;
  backface-visibility: hidden;
}

.strip-poker-card.is-face-down {
  background: linear-gradient(135deg, #8c1010, #5c0000 60%, #370000);
  border-color: rgba(255,255,255,.92);
}

.strip-poker-card.is-face-down::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 8px;
  border: 2px solid rgba(255,255,255,.86);
  background: repeating-linear-gradient(45deg, rgba(255,255,255,.08) 0 8px, rgba(0,0,0,.04) 8px 16px);
}

.strip-poker-card.is-selectable {
  cursor: pointer;
  pointer-events: auto;
}

.strip-poker-card.is-selected {
  transform: translateY(-8px);
  border-color: rgba(255, 214, 107, .95);
  box-shadow: 0 16px 34px rgba(0,0,0,.34);
  opacity: 0.7;
}

@media (hover:hover) and (pointer:fine) {
  .strip-poker-card.is-selectable:hover {
    transform: translateY(-8px);
    border-color: rgba(255, 214, 107, .95);
    box-shadow: 0 16px 34px rgba(0,0,0,.34);
  }
}

.strip-poker-card.is-disabled {
  opacity: 1;
}

.strip-poker-card.is-muted {
  opacity: 0.5;
}

.strip-poker-card.is-animating {
  pointer-events: none;
}

.strip-poker-card.is-flip-out {
  animation: stripPokerCardFlipOut 0.3s ease forwards;
}

.strip-poker-card.is-flip-in {
  animation: stripPokerCardFlipIn 0.3s ease forwards;
}

.strip-poker-card.has-card-back-image::before {
  display: none;
}

.strip-poker-card-badge {
  position: absolute;
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0,0,0,.72);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

@keyframes stripPokerCardFlipOut {
  from {
    transform: rotateY(0deg);
  }
  to {
    transform: rotateY(180deg);
  }
}

@keyframes stripPokerCardFlipIn {
  from {
    transform: rotateY(180deg);
  }
  to {
    transform: rotateY(360deg);
  }
}

@media (max-width: 980px) {
  .cutscene-strip-poker-opponent-area {
    width: min(90vw, 920px);
  }

  .cutscene-strip-poker-opponent-area .cutscene-strip-poker-hand {
    grid-template-columns: repeat(5, minmax(44px, 68px));
    gap: 7px;
  }
}

@keyframes cutsceneCharacterEnter {
  from {
    opacity: 0;
    transform: translateX(-40vw);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes cutsceneCharacterRightEnter {
  from {
    opacity: 0;
    transform: translateX(40vw);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

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



@media (max-width:1200px) {
.cutscene-character-left { 
left:50px;
}
.cutscene-character-right-group { 
right:50px;
}
}

@media (max-width: 720px) {
  .cutscene-choices {
    --cutscene-choice-columns: 2;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px;
    margin-top: 8px;
  }

  .cutscene-choice {
    min-width: 0;
    width: 100%;
    padding-inline: 8px;
  }

  .cutscene-dialog {
    width: min(96vw, 980px);
    padding: 10px 10px 12px;
  }

  .cutscene-strip-poker {
    gap: 8px;
  }

  .cutscene-strip-poker-opponent-area {
    width: min(96vw, 760px);
  }

  .cutscene-strip-poker-hand {
    gap: 4px;
  }

  .cutscene-strip-poker-player-hand {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    width: 100%;
  }

  .cutscene-strip-poker-player-hand.is-strip-tris-board {
    grid-template-columns: repeat(3, minmax(0, min(76px, 1fr)));
    justify-content: center;
    gap: 5px;
    max-width: min(250px, 100%);
    margin-inline: auto;
  }

  .strip-tris-board {
    gap: 2px;
    padding: 3px;
  }

  .strip-tris-cell {
    border-radius: 8px;
    font-size: clamp(.9rem, 4.6vw, 1.35rem);
  }

  .cutscene-strip-poker-player-hand .strip-poker-card {
    min-width: 0;
  }

  .cutscene-strip-poker-opponent-area .cutscene-strip-poker-hand {
    grid-template-columns: repeat(5, minmax(34px, 52px));
    gap: 4px;
  }

  .cutscene-strip-poker-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: fit-content;
    max-width: 100%;
    margin-inline: auto;
  }

  .cutscene-strip-poker-button {
    min-width: 0;
    width: auto;
    padding-inline: 8px;
  }

  .cutscene-strip-poker-scoreboard {
    justify-content: space-between;
    gap: 6px;
    flex-wrap: nowrap;
  }

  .cutscene-strip-poker-scoreboard > * {
    gap: 4px;
  }

  .strip-poker-life-label {
    font-size: .74rem;
  }

  .strip-poker-life-icons {
    gap: 2px;
  }

  .strip-poker-life-icon,
  .strip-poker-life-icon img {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
  }

  .cutscene-advance-hint,
  .cutscene-next-button {
    right: 12px;
    bottom: 8px;
  }

  .cutscene-text {
    min-height: 0;
  }
}

@media (max-width: 980px) {
  .tutorial-stage {
    grid-template-columns: 1fr;
    justify-items: center;
    align-items: end;
  }

  .tutorial-overlay.has-character .tutorial-stage {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .tutorial-character {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: auto;
    height: var(--safe-full-height);
    max-width: none;
    max-height: none;
    opacity: 1;
  }

  .tutorial-panel {
    position: absolute;
    left: 50%;
    bottom: 15px;
    transform: translateX(-50%) translateY(14px) scale(0.96);
    width: min(92vw, 540px);
    align-self: end;
    margin-inline: auto;
    background: rgba(8, 12, 18, 0.8);
  }

  .tutorial-overlay.has-character .tutorial-panel {
    width: min(92vw, 540px);
  }

  body.tutorial-visible .tutorial-panel {
    transform: translateX(-50%) translateY(0) scale(1);
  }
}



  .strip-poker-actions button {
    min-width: 0;
    padding: 0 8px;
  }
}






.cutscene-strip-poker-hand {
  grid-template-columns: repeat(var(--strip-hand-count, 5), minmax(0, 1fr));
}

.cutscene-strip-poker-opponent-area .cutscene-strip-poker-hand {
  grid-template-columns: repeat(var(--strip-hand-count, 5), minmax(50px, 79px));
}

@media (max-width: 980px) {
  .cutscene-strip-poker-opponent-area .cutscene-strip-poker-hand {
    grid-template-columns: repeat(var(--strip-hand-count, 5), minmax(44px, 68px));
  }
}

@media (max-width: 720px) {
  .cutscene-strip-poker-player-hand {
    grid-template-columns: repeat(var(--strip-hand-count, 5), minmax(0, 1fr));
  }

  .cutscene-strip-poker-opponent-area .cutscene-strip-poker-hand {
    grid-template-columns: repeat(var(--strip-hand-count, 5), minmax(34px, 52px));
  }
}


.cutscene-strip-poker-player-hand.is-strip-tris-board {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, min(96px, 1fr))) !important;
  justify-content: center;
  gap: 6px !important;
  max-width: min(320px, 100%);
  margin-inline: auto;
  width: min(320px, 100%);
}

@media (max-width: 720px) {
  .cutscene-strip-poker-player-hand.is-strip-tris-board {
    grid-template-columns: repeat(3, minmax(0, min(76px, 1fr))) !important;
    gap: 5px !important;
    max-width: min(250px, 100%);
    width: min(250px, 100%);
  }
}


.cutscene-strip-poker.is-strip-tris {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "hand"
    "hint"
    "actions";
  align-items: center;
  justify-items: center;
  row-gap: 10px;
}

.cutscene-strip-poker.is-strip-tris .cutscene-strip-poker-scoreboard,
.cutscene-strip-poker.is-strip-tris [data-role="strip-poker-opponent-score"],
.cutscene-strip-poker.is-strip-tris [data-role="strip-poker-player-score"] {
  display: none !important;
}

.cutscene-strip-poker.is-strip-tris .cutscene-strip-poker-player-hand {
  grid-area: hand;
}

.cutscene-visible.strip-poker-active .cutscene-dialog:has(.cutscene-strip-poker.is-strip-tris) {
  width: min(92vw, 500px);
}

.cutscene-strip-poker.is-strip-tris .cutscene-strip-poker-actions {
  grid-area: actions;
  justify-content: center;
}

.cutscene-strip-poker.is-strip-tris .cutscene-strip-poker-button {
  min-width: 96px;
  min-height: 34px;
  padding: 0 14px;
  font-size: 0.9rem;
}

.cutscene-strip-poker.is-strip-tris .cutscene-strip-poker-hint {
  grid-area: hint;
}

@media (max-width: 720px) {
  .cutscene-strip-poker.is-strip-tris {
    row-gap: 8px;
  }
}



.cutscene-strip-poker.is-strip-sudoku-tris {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "hand"
    "actions";
  align-items: center;
  justify-items: stretch;
  row-gap: 10px;
}

.cutscene-strip-poker.is-strip-sudoku-tris .cutscene-strip-poker-scoreboard,
.cutscene-strip-poker.is-strip-sudoku-tris [data-role="strip-poker-opponent-score"],
.cutscene-strip-poker.is-strip-sudoku-tris [data-role="strip-poker-player-score"],
.cutscene-strip-poker.is-strip-sudoku-tris .cutscene-strip-poker-hint,
.cutscene-strip-poker.is-strip-sudoku-tris + .cutscene-strip-poker-opponent-area,
.cutscene-strip-poker-opponent-area:has(+ .cutscene-dialog .cutscene-strip-poker.is-strip-sudoku-tris) {
  display: none !important;
}

.cutscene-strip-poker.is-strip-sudoku-tris .cutscene-strip-poker-player-hand {
  grid-area: hand;
}

.cutscene-strip-poker.is-strip-sudoku-tris .cutscene-strip-poker-actions {
  grid-area: actions;
  justify-content: center;
}

.cutscene-visible.strip-poker-active .cutscene-dialog:has(.cutscene-strip-poker.is-strip-sudoku-tris),
body.cutscene-visible .cutscene-dialog.has-strip-poker:has(.cutscene-strip-poker.is-strip-sudoku-tris) {
  width: min(92vw, 500px) !important;
}

.cutscene-strip-poker-player-hand.is-strip-sudoku-tris-board {
  position: relative;
  display: grid;
  gap: 10px;
  width: 100%;
  max-width: 100%;
}

.strip-sudoku-tris-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.strip-sudoku-tris-box {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  padding: 4px;
  border: 2px solid rgba(255,255,255,.24);
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  min-height: 0;
  overflow: hidden;
}

.strip-sudoku-tris-box.is-won-x {
  border-color: rgba(82, 160, 255, .9);
  background: rgba(82, 160, 255, .12);
}

.strip-sudoku-tris-box.is-won-o {
  border-color: rgba(255, 134, 134, .9);
  background: rgba(255, 134, 134, .12);
}

.strip-sudoku-tris-box.is-won-x::after,
.strip-sudoku-tris-box.is-won-o::after {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: clamp(4.8rem, 16vw, 7.5rem);
  font-weight: 900;
  pointer-events: none;
  text-shadow: 0 4px 16px rgba(0,0,0,.45);
}

.strip-sudoku-tris-box.is-won-x::after {
  content: "X";
  color: rgba(82, 160, 255, .92);
  line-height: 100%;
}

.strip-sudoku-tris-box.is-won-o::after {
  content: "O";
  color: rgba(255, 134, 134, .92);
  line-height: 100%;
}

.strip-sudoku-tris-cell {
  aspect-ratio: 1;
  min-width: 0;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.05);
  color: #ffffff;
  font: 700 clamp(.95rem, 2.8vw, 1.15rem)/1 var(--font-body, inherit);
  display: grid;
  place-items: center;
  padding: 0;
}

.strip-sudoku-tris-cell.is-given {
  background: rgba(255,255,255,.14);
  color: #fff5ce;
}

.strip-sudoku-tris-cell.has-wrong-mark {
  position: relative;
}

.strip-sudoku-tris-last-wrong {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 112, 112, .5);
  font-size: clamp(1rem, 3vw, 1.2rem);
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
}

.strip-sudoku-tris-last-wrong.is-opponent-last-wrong {
  color: rgba(255, 92, 92, .92);
  animation: strip-sudoku-tris-blink-red .8s step-end infinite;
}

.strip-sudoku-tris-cell.is-opponent-last-correct {
  animation: strip-sudoku-tris-blink-white .8s step-end infinite;
}

@keyframes strip-sudoku-tris-blink-red {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: .2; }
}

@keyframes strip-sudoku-tris-blink-white {
  0%, 49% { color: #ffffff; opacity: 1; }
  50%, 100% { color: rgba(255,255,255,.28); opacity: .45; }
}

.strip-sudoku-tris-wrong-notes {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 3px;
  display: block;
  color: rgb(255, 92, 92);
  font-size: .56rem;
  line-height: 1.08;
  letter-spacing: .01em;
  text-align: center;
  pointer-events: none;
}

.strip-sudoku-tris-cell.is-playable {
  cursor: pointer;
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.28);
}

@media (hover:hover) {
  .strip-sudoku-tris-cell.is-playable:hover {
    transform: translateY(-1px);
    background: rgba(255,255,255,.14);
  }
}

.strip-sudoku-tris-cell.is-selected {
  outline: 2px solid rgba(255, 188, 92, .95);
  outline-offset: -2px;
}

.strip-sudoku-tris-cell:disabled {
  cursor: default;
}

.strip-sudoku-tris-picker {
  position: absolute;
  z-index: 6;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  gap: 8px;
  width: 126px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(255,255,255,.98);
  border: 1px solid rgba(0,0,0,.18);
  box-shadow: 0 14px 34px rgba(0,0,0,.35);
}

.strip-sudoku-tris-picker-title {
  display: none;
}

.strip-sudoku-tris-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}

.strip-sudoku-tris-picker-button,
.strip-sudoku-tris-picker-cancel {
  min-height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,.16);
  background: rgba(255,255,255,.96);
  color: #111111;
  font: 700 .95rem/1 var(--font-body, inherit);
}

.strip-sudoku-tris-picker-button {
  cursor: pointer;
}

.strip-sudoku-tris-picker-cancel {
  display: none;
  width: 44px;
  justify-self: center;
}

@media (max-width: 720px) {
  .strip-sudoku-tris-board {
    gap: 6px;
  }
  .strip-sudoku-tris-box {
    padding: 3px;
    gap: 2px;
  }
  .strip-sudoku-tris-cell {
    font-size: .88rem;
  }
  .strip-sudoku-tris-picker {
    width: 168px;
    padding: 10px;
  }
  .strip-sudoku-tris-picker-grid {
    gap: 6px;
  }
  .strip-sudoku-tris-picker-button,
  .strip-sudoku-tris-picker-cancel {
    min-height: 48px;
    font-size: 1.05rem;
  }
}

.cutscene-strip-poker.is-strip-battleship {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "hand"
    "actions";
  align-items: start;
  justify-items: stretch;
  row-gap: 8px;
}

.cutscene-strip-poker.is-strip-battleship .cutscene-strip-poker-scoreboard,
.cutscene-strip-poker.is-strip-battleship [data-role="strip-poker-opponent-score"],
.cutscene-strip-poker.is-strip-battleship [data-role="strip-poker-player-score"],
.cutscene-strip-poker.is-strip-battleship .cutscene-strip-poker-hint,
.cutscene-strip-poker.is-strip-battleship + .cutscene-strip-poker-opponent-area,
.cutscene-strip-poker-opponent-area:has(+ .cutscene-dialog .cutscene-strip-poker.is-strip-battleship) {
  display: none !important;
}

.cutscene-strip-poker.is-strip-battleship .cutscene-strip-poker-player-hand {
  grid-area: hand;
}

.cutscene-visible.strip-poker-active .cutscene-dialog:has(.cutscene-strip-poker.is-strip-battleship),
body.cutscene-visible .cutscene-dialog.has-strip-poker:has(.cutscene-strip-poker.is-strip-battleship) {
  width: min(92vw, 500px) !important;
}

.cutscene-strip-poker-player-hand.is-strip-battleship-board {
  display: grid;
  gap: 10px;
  width: 100%;
  max-width: 100%;
}

.strip-battleship-tray {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.strip-battleship-ship-button {
  display: grid;
  gap: 4px;
  justify-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 6px;
  color: #fff;
}

.strip-battleship-ship-button.is-selected {
  border-color: rgba(255, 181, 71, 0.95);
  box-shadow: 0 0 0 2px rgba(255, 181, 71, 0.2);
}

.strip-battleship-ship-button.is-placed {
  opacity: 0.45;
}

.strip-battleship-ship-visual {
  --ship-cell-size: 18px;
  display: block;
  width: calc(var(--ship-cell-size) * var(--ship-width, 1));
  height: calc(var(--ship-cell-size) * var(--ship-height, 1));
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  background-color: rgba(88, 114, 168, 0.68);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

.strip-battleship-ship-label {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.9);
}

.strip-battleship-boards {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  justify-items: stretch;
  width: 100%;
}

.strip-battleship-board-shell {
  display: grid;
  gap: 6px;
  min-width: 0;
  width: 100%;
  padding: 8px 10px 10px;
  border-radius: 14px;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.strip-battleship-board-shell[data-board-kind="player"] {
  background: rgba(25, 48, 96, 0.72);
}

.strip-battleship-board-shell[data-board-kind="opponent"] {
  background: rgba(88, 22, 22, 0.78);
}

.strip-battleship-board-shell.is-fading-out {
  opacity: 0;
  transform: translateY(6px);
}

.strip-battleship-board-shell.is-fading-in {
  opacity: 0;
  transform: translateY(-6px);
  animation: stripBattleshipBoardFadeIn 0.22s ease forwards;
}

@keyframes stripBattleshipBoardFadeIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.strip-battleship-board-title {
  text-align: center;
  font-weight: 700;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.9);
}

.strip-battleship-board-layout {
  --bs-gap: 2px;
  --bs-axis: 18px;
  display: grid;
  grid-template-columns: var(--bs-axis) minmax(0, 1fr);
  grid-template-rows: 18px auto;
  gap: 4px;
  justify-content: stretch;
  width: 100%;
}

.strip-battleship-board-corner {
  grid-column: 1;
  grid-row: 1;
}

.strip-battleship-top-labels {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: var(--bs-gap);
}

.strip-battleship-left-labels {
  grid-column: 1;
  grid-row: 2;
  display: grid;
  grid-template-rows: repeat(10, minmax(0, 1fr));
  gap: var(--bs-gap);
  min-height: 0;
}

.strip-battleship-axis-label {
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.72);
}

.strip-battleship-surface {
  grid-column: 2;
  grid-row: 2;
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  grid-template-rows: repeat(10, minmax(0, 1fr));
  gap: var(--bs-gap);
  position: relative;
  justify-content: stretch;
  align-content: stretch;
  width: 100%;
  aspect-ratio: 1 / 1;
}

.strip-battleship-ship-layer {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  grid-template-rows: repeat(10, minmax(0, 1fr));
  gap: var(--bs-gap);
  pointer-events: none;
  z-index: 0;
}

.strip-battleship-cell {
  min-width: 0;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  position: relative;
}

.strip-battleship-cell.has-ship {
  background: rgba(94, 138, 214, 0.16);
}

.strip-battleship-cell.is-playable {
  cursor: pointer;
}

@media (hover: hover) {
  .strip-battleship-cell.is-playable:hover {
    border-color: rgba(255, 181, 71, 0.9);
    background: rgba(255, 181, 71, 0.16);
  }
}

.strip-battleship-cell.is-miss::after,
.strip-battleship-cell.is-hit::after,
.strip-battleship-cell.is-sunk::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  translate: -50% -50%;
  border-radius: 999px;
  background-image: var(--battleship-marker-image, none);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.strip-battleship-cell.is-miss::after {
  width: 70%;
  height: 70%;
  background-color: rgba(255, 255, 255, 0.65);
}

.strip-battleship-cell.is-hit::after {
  width: 70%;
  height: 70%;
  background-color: #ff7b7b;
  box-shadow: 0 0 10px rgba(255, 123, 123, 0.55);
}

.strip-battleship-cell.is-sunk,
.strip-battleship-cell.is-sunk-ship {
  border-color: rgba(255, 100, 100, 0.95);
  background: rgba(255, 100, 100, 0.16);
}

.strip-battleship-cell.is-sunk::after {
  width: 70%;
  height: 70%;
  background-color: #ff4f4f;
  box-shadow: 0 0 12px rgba(255, 79, 79, 0.7);
}

.strip-battleship-ship-overlay {
  pointer-events: none;
  z-index: 0;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background-color: rgba(88, 114, 168, 0.72);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

.strip-battleship-ship-overlay.is-sunk {
  opacity: 0.5;
  filter: grayscale(1);
}

.strip-battleship-ship-overlay.is-preview {
  opacity: 0.5;
  border-style: dashed;
  filter: none;
}

.strip-battleship-surface .strip-battleship-cell {
  z-index: 1;
}

.strip-battleship-board-shell {
  width: 100%;
  max-width: 100%;
}

@media (max-width: 760px) {
  .cutscene-visible.strip-poker-active .cutscene-dialog:has(.cutscene-strip-poker.is-strip-battleship),
  body.cutscene-visible .cutscene-dialog.has-strip-poker:has(.cutscene-strip-poker.is-strip-battleship) {
    width: min(92vw, 500px) !important;
  }

  .strip-battleship-boards {
    grid-template-columns: minmax(0, 1fr);
  }

  .strip-battleship-board-layout {
    --bs-axis: 16px;
  }
}

.cutscene-strip-poker-hint {
  display: none !important;
}


body.cutscene-visible .cutscene-dialog.has-strip-poker:has(.cutscene-strip-poker.is-strip-tris) {
  width: min(92vw, 500px) !important;
}

.cutscene-dialog.has-strip-poker .cutscene-strip-poker-hint {
  display: none !important;
}


@media (max-width: 720px) {
  .cutscene-character-left {
    left: 50% !important;
    transform: translateX(-50%);
  }

  .cutscene-character-left .cutscene-character-image {
    object-position: center bottom;
  }
}
