/* 025-kamigonn — iOS / touch base */
*, *::before, *::after {
  box-sizing: border-box;
  font-family: 'Zen Maru Gothic', 'Hiragino Maru Gothic ProN', sans-serif;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}

::selection {
  background: transparent;
  color: inherit;
}

html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #f8fafc;
}

body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 100%;
  overflow: hidden;
  position: relative;
  overscroll-behavior: none;
  background: #f1f5f9;
  color: #0f172a;
  touch-action: none;
  display: flex;
  justify-content: center;
  align-items: center;
}

#appContainer {
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  min-height: 0;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* Keep the cutout confirmation controls inside the visible mobile viewport. */
#screenCutout {
  min-height: 0;
}

#screenCutout > .relative.flex-1 {
  min-height: 0;
}

#screenCutout > .glass-panel {
  flex: 0 0 auto;
}

@media (max-width: 767px) {
  #screenCutout {
    padding-top: 0.75rem !important;
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom)) !important;
    gap: 0.25rem;
  }

  #screenCutout > .relative.flex-1 {
    margin-top: 0.5rem !important;
    margin-bottom: 0.5rem !important;
    min-height: 120px;
  }

  #screenCutout > .glass-panel {
    padding: 0.625rem !important;
    gap: 0.5rem !important;
    max-height: 42dvh;
    overflow: visible;
  }

  #screenCutout .game-btn {
    min-height: 44px;
  }
}

.glass-panel {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.05), 0 8px 10px -6px rgba(15, 23, 42, 0.02);
}

.glass-btn,
.game-btn {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(241, 245, 249, 0.85));
  backdrop-filter: blur(8px);
  border: 1px solid rgba(203, 213, 225, 0.8);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.08s ease, opacity 0.08s ease, filter 0.08s ease;
  will-change: transform;
  min-height: 48px;
}

.glass-btn:active,
.game-btn:active,
.glass-btn.is-pressed,
.game-btn.is-pressed {
  transform: scale(0.92);
  opacity: 0.88;
  background: rgba(226, 232, 240, 0.95);
}

.game-btn:disabled,
.glass-btn:disabled {
  opacity: 0.4;
  pointer-events: none;
}

@keyframes scanline {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(1000%); }
}
.scanline-effect {
  animation: scanline 2.5s linear infinite;
}

@keyframes pulseGlow {
  0%, 100% { filter: drop-shadow(0 0 12px rgba(99, 102, 241, 0.4)); }
  50% { filter: drop-shadow(0 0 24px rgba(168, 85, 247, 0.6)); }
}
.pulse-glow {
  animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes sfxPop {
  0% { opacity: 0; transform: translate(-50%, 8px) scale(0.8); }
  20% { opacity: 1; transform: translate(-50%, 0) scale(1.08); }
  70% { opacity: 1; transform: translate(-50%, -12px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -28px) scale(0.95); }
}

#sfxWordLayer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 80;
  overflow: hidden;
}

.sfx-word {
  position: absolute;
  left: 50%;
  top: 42%;
  font-size: 1.35rem;
  font-weight: 900;
  color: #312e81;
  text-shadow: 0 2px 0 #fff, 0 0 12px rgba(99, 102, 241, 0.35);
  animation: sfxPop 0.9s ease-out forwards;
  white-space: nowrap;
}

.sfx-word.is-rare {
  color: #b45309;
  font-size: 1.6rem;
  text-shadow: 0 2px 0 #fff7ed, 0 0 18px rgba(251, 191, 36, 0.7);
}

.sfx-word.is-legend {
  color: #7c3aed;
  font-size: 1.8rem;
  text-shadow: 0 2px 0 #f5f3ff, 0 0 22px rgba(167, 139, 250, 0.85);
}

#resultRarity {
  display: none;
}

#resultRarity.is-visible {
  display: inline-block;
}

[data-scrollable] {
  touch-action: pan-y;
  overscroll-behavior: contain;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(241, 245, 249, 0.8);
}
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.5);
  border-radius: 999px;
}

input[type="range"] {
  touch-action: manipulation;
}
