/* The loading card (#064, #065): the page's only render-blocking stylesheet, so the card paints as soon as the HTML and
   this small file are in, long before the code. The screens' stylesheet downloads beside the code and main.ts applies
   it (vite.config.ts loadingCard). System fonts only: the card never waits for a web font. Colours are the 말랑온실
   tokens (game/client/src/ui/tokens.css), written out because the tokens arrive with the screens' stylesheet. */
html {
  background: #a9d48f;
}

.kbn-splash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
  box-sizing: border-box;
  background: radial-gradient(120% 85% at 50% 18%, #cfe9b8 0%, #a9d48f 58%, #93c679 100%);
  font-family: system-ui, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif;
  color: #4a3728;
  -webkit-text-size-adjust: 100%;
  transition:
    opacity 260ms ease,
    visibility 0s linear 260ms;
}

.kbn-splash-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.kbn-splash-card {
  width: min(288px, 100%);
  box-sizing: border-box;
  padding: 26px 24px 22px;
  border-radius: 28px;
  background: #fff8ea;
  text-align: center;
  box-shadow:
    inset 0 2px 0 #ffffff,
    0 6px 0 #dcc8a2,
    0 18px 40px rgba(74, 55, 40, 0.18);
}

.kbn-splash-logo {
  display: block;
  width: 76px;
  height: 76px;
  margin: 0 auto 4px;
  animation: kbn-splash-bob 1.8s ease-in-out infinite;
  transform-origin: 50% 90%;
}

.kbn-splash-name {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.kbn-splash-text {
  margin: 6px 0 16px;
  min-height: 1.45em;
  font-size: 15px;
  line-height: 1.45;
  color: #6b5240;
}

.kbn-splash-track {
  height: 10px;
  border-radius: 5px;
  background: #f6ecd6;
  box-shadow: inset 0 0 0 1px #eadbbe;
  overflow: hidden;
}

/* indeterminate until main.ts knows how far along it is (then .kbn-splash-known and a width) */
.kbn-splash-fill {
  width: 32%;
  height: 100%;
  border-radius: 5px;
  background: #4fae62;
  box-shadow: inset 0 -2px 0 #37894a;
  animation: kbn-splash-slide 1.4s ease-in-out infinite;
}

.kbn-splash-known {
  animation: none;
  transition: width 300ms ease;
}

@keyframes kbn-splash-slide {
  from {
    transform: translateX(-105%);
  }
  to {
    transform: translateX(320%);
  }
}

@keyframes kbn-splash-bob {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-3px) rotate(-2deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .kbn-splash {
    transition: none;
  }
  .kbn-splash-logo,
  .kbn-splash-fill {
    animation: none;
  }
  .kbn-splash-fill:not(.kbn-splash-known) {
    width: 100%;
    opacity: 0.45;
  }
}

/* The front door's cards (src/page/door.ts): the same card turned into the maintenance card (W1), the "cannot draw"
   card (no WebGL 2) or the "could not open" card. Every button is a 44 px target; the logo keeps still on them. */
.kbn-door {
  width: min(340px, 100%);
}

.kbn-door .kbn-splash-logo {
  animation: none;
}

.kbn-door-body {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  /* Korean breaks between words, never inside one ("없어 / 요") */
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.kbn-door-title {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.35;
}

.kbn-door-line {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: #6b5240;
  overflow-wrap: anywhere;
}

.kbn-door-strong {
  color: #4a3728;
  font-weight: 600;
  white-space: pre-line;
}

.kbn-door-quiet {
  font-size: 13px;
  color: #8a6e58;
}

.kbn-door-quiet:empty {
  display: none;
}

.kbn-door-small {
  font-size: 12px;
}

.kbn-door-list {
  margin: 4px 0 6px;
  padding: 0 0 0 18px;
  text-align: left;
  font-size: 14px;
  line-height: 1.5;
  color: #6b5240;
}

.kbn-door-list li + li {
  margin-top: 4px;
}

.kbn-door-row {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.kbn-door-btn {
  min-height: 44px;
  min-width: 44px;
  margin-top: 4px;
  padding: 0 18px;
  border: 0;
  border-radius: 22px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.kbn-door-prim {
  background: #4fae62;
  color: #ffffff;
  box-shadow: 0 4px 0 #37894a;
}

.kbn-door-sec {
  background: #f6ecd6;
  color: #4a3728;
  box-shadow:
    inset 0 0 0 2px #eadbbe,
    0 4px 0 #dcc8a2;
}

.kbn-door-quiet-btn {
  background: transparent;
  color: #6b5240;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.kbn-door-btn:active {
  transform: translateY(3px);
  box-shadow: none;
}

.kbn-door-btn:focus-visible {
  outline: 3px solid #4fae62;
  outline-offset: 2px;
}
