@font-face {
  font-family: 'Galmuri11';
  src: url('assets/fonts/Galmuri11.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Galmuri11';
  font-weight: 700;
  src: url('assets/fonts/Galmuri11-Bold.woff2') format('woff2');
  font-display: swap;
}

:root {
  --bg: #0b1120;
  --panel: #1e293b;
  --panel-deep: #0f172a;
  --panel-edge: #475569;
  --ink: #e2e8f0;
  --muted: #94a3b8;
  --holo: #6fe3ff;
  --holo-bg: rgba(10, 40, 64, 0.92);
  --gold: #ffd25a;
  --red: #e2483d;
  --ok: #4cc27a;
  --font: 'Galmuri11', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: #fff;
  font-family: var(--font);
  overflow: hidden;
}
body {
  overscroll-behavior: none;
  touch-action: manipulation;
}
button {
  font-family: inherit;
  cursor: pointer;
}
.hidden {
  display: none !important;
}

#app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* ---------- HUD ---------- */
#hud {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  flex: none;
}
.hud-box {
  background: var(--holo-bg);
  border: 2px solid var(--holo);
  color: var(--holo);
  padding: 4px 10px;
  font-size: 16px;
  letter-spacing: 1px;
  box-shadow: 0 0 8px rgba(111, 227, 255, 0.35);
}
#timer {
  min-width: 76px;
  text-align: center;
  font-weight: 700;
  position: relative;
}
#timer.low {
  color: var(--red);
  border-color: var(--red);
  animation: blink 1s steps(2) infinite;
}
#codes {
  display: flex;
  gap: 4px;
  padding: 4px 6px;
}
#codes span {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(111, 227, 255, 0.5);
  font-size: 14px;
  color: rgba(111, 227, 255, 0.35);
}
#codes span.on {
  color: var(--gold);
  border-color: var(--gold);
  text-shadow: 0 0 6px var(--gold);
  animation: pop 0.5s;
}
.hud-btn {
  margin-left: auto;
  white-space: nowrap;
  background: var(--panel);
  color: var(--ink);
  border: 2px solid var(--panel-edge);
  padding: 6px 10px;
  font-size: 13px;
  box-shadow: 0 3px 0 var(--panel-edge);
}
.hud-btn.snd {
  margin-left: 0;
}
.hud-btn .short {
  display: none;
}
.hud-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--panel-edge);
}
.penalty.bonus {
  color: var(--ok);
}
.penalty.float-top {
  position: fixed; /* 맨 위 층: 캔버스·팝업에 가려지지 않게 (ui.js floatTime) */
  z-index: 9600;
}
#modalCard:focus {
  outline: none;
}
.penalty {
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  color: var(--red);
  font-size: 14px;
  white-space: nowrap;
  animation: floatDown 1.2s forwards;
  pointer-events: none;
  text-shadow: 0 1px 0 #000;
}

/* ---------- Stage ---------- */
#stageWrap {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
body.portrait #stageWrap {
  align-items: flex-start;
}
#stage {
  position: relative;
  transition: opacity 0.8s;
}
#stage::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(5, 10, 25, 0.45) 100%),
    repeating-linear-gradient(0deg, rgba(111, 227, 255, 0.035) 0 1px, transparent 1px 3px);
}
#stage.fadein {
  animation: fadein 1.2s;
}
#stage canvas {
  position: absolute;
  left: 0;
  top: 0;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
#cvColor {
  touch-action: pan-y;
}
#tip {
  position: absolute;
  transform: translate(-50%, -100%);
  background: var(--panel);
  color: var(--ink);
  border: 2px solid var(--panel-edge);
  font-size: 12px;
  padding: 2px 6px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 3;
}

/* ---------- Inventory ---------- */
#inv {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 12px 12px;
}
#invSlots {
  display: flex;
  gap: 8px;
}
.slot {
  width: 56px;
  height: 56px;
  background: var(--panel);
  border: 2px solid var(--panel-edge);
  box-shadow: 0 3px 0 var(--panel-edge);
  display: grid;
  place-items: center;
  position: relative;
  padding: 0;
}
.slot img {
  width: 48px;
  height: 48px;
  image-rendering: pixelated;
  object-fit: contain;
}
.slot.sel {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  animation: pulse 1s infinite;
}
.slot.new {
  animation: pop 0.6s;
}
.slot.empty {
  opacity: 0.25;
  box-shadow: none;
  cursor: default;
}
#invInfo {
  font-size: 12px;
  color: #c9d4e6;
  text-align: center;
  min-height: 1.4em;
}

/* ---------- Dialog ---------- */
#dialog {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 8px 8px calc(10px + env(safe-area-inset-bottom));
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}
#dialog::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
}
#dlgBox {
  width: min(760px, 100%);
  min-height: 132px;
  background: rgba(30, 41, 59, 0.96);
  color: var(--ink);
  border: 3px solid var(--panel-edge);
  box-shadow:
    0 4px 0 var(--panel-edge),
    0 8px 24px rgba(0, 0, 0, 0.4);
  display: flex;
  gap: 12px;
  padding: 12px;
  position: relative;
}
#dlgBox.right {
  flex-direction: row-reverse;
}
#dlgBox.system {
  background: var(--holo-bg);
  color: #dff8ff;
  border-color: var(--holo);
  box-shadow: 0 0 14px rgba(111, 227, 255, 0.5);
}
#dlgBox.system #dlgPortrait {
  display: none;
}
#dlgBox.system #dlgName {
  color: var(--holo);
}
#dlgPortrait {
  flex: none;
  width: 96px;
  height: 96px;
  border: 2px solid var(--panel-edge);
  background: #334155;
  display: grid;
  place-items: center;
  overflow: hidden;
}
#dlgPortrait.holo {
  border-color: var(--holo);
  background: #123a52;
  box-shadow: inset 0 0 12px rgba(111, 227, 255, 0.6);
  background-image: repeating-linear-gradient(0deg, rgba(111, 227, 255, 0.12) 0 2px, transparent 2px 4px);
}
#dlgPortrait img {
  width: 96px;
  height: 96px;
  image-rendering: pixelated;
}
#dlgBody {
  flex: 1;
  min-width: 0;
}
#dlgName {
  font-weight: 700;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 6px;
}
#dlgBox.sp-seoyeon #dlgName {
  color: #34d399;
}
#dlgBox.sp-agent #dlgName {
  color: #38bdf8;
}
#dlgBox.right #dlgBody {
  text-align: left;
}
#dlgText {
  font-size: 16px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
#dlgNext {
  position: absolute;
  right: 12px;
  bottom: 6px;
  font-size: 12px;
  animation: blink 1s steps(2) infinite;
}
#dlgBox.right #dlgNext {
  right: auto;
  left: 12px;
}
#dlgSkip {
  align-self: flex-end;
  margin: 6px max(0px, calc((100% - 760px) / 2)) 0 0;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.5);
  font-size: 12px;
  padding: 4px 10px;
}

/* ---------- Modal ---------- */
#modal {
  position: absolute;
  inset: 0;
  background: rgba(5, 10, 20, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
  padding: 12px;
}
#modalCard {
  width: min(560px, 100%);
  max-height: 100%;
  overflow: auto;
  background: var(--panel);
  color: var(--ink);
  border: 3px solid var(--panel-edge);
  box-shadow: 0 5px 0 var(--panel-edge);
  padding: 16px;
  position: relative;
}
#modalCard.shake {
  animation: shake 0.4s;
}
.m-title {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.m-q {
  font-size: 17px;
  line-height: 1.6;
  font-weight: 700;
  margin: 0 28px 14px 0;
  word-break: keep-all;
}
.m-close {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 32px;
  height: 32px;
  border: 2px solid var(--panel-edge);
  background: var(--panel-deep);
  color: var(--ink);
  font-size: 16px;
}
.opt {
  display: block;
  width: 100%;
  text-align: left;
  margin: 8px 0;
  padding: 12px 12px;
  font-size: 15px;
  background: var(--panel-deep);
  color: var(--ink);
  border: 2px solid var(--panel-edge);
  box-shadow: 0 3px 0 var(--panel-edge);
  word-break: keep-all;
}
.opt:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--panel-edge);
}
.opt.wrong {
  background: #3b1d22;
  border-color: var(--red);
  color: #fca5a5;
  text-decoration: line-through;
  box-shadow: none;
}
.opt.wrong.used {
  background: #1c2230; /* 이미 고른 오답: 회색으로 잠김 (다시 감점되지 않음) */
  border-color: #3b4458;
  color: var(--muted);
}
.opt:disabled {
  cursor: not-allowed;
}
.opt.right {
  background: #0f3b2c;
  border-color: var(--ok);
  color: #a7f3d0;
}
.m-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
  flex-wrap: wrap;
}
.m-btn {
  background: #10b981;
  color: #052e1f;
  font-weight: 700;
  border: 0;
  padding: 10px 14px;
  font-size: 14px;
  box-shadow: 0 3px 0 #065f46;
}
.m-btn.ghost {
  background: var(--panel-deep);
  font-weight: 400;
  color: var(--ink);
  border: 2px solid var(--panel-edge);
  box-shadow: 0 3px 0 var(--panel-edge);
}
.m-hint {
  margin-top: 10px;
  padding: 10px;
  background: #2a2412;
  color: #fde68a;
  border: 2px dashed #ca8a04;
  font-size: 14px;
  line-height: 1.5;
}
.m-note {
  font-size: 12px;
  color: var(--muted);
}

/* 자물쇠 */
.lock-plate {
  text-align: center;
  font-size: 16px;
  margin: 4px 0 14px;
  font-weight: 700;
}
.dials {
  display: flex;
  justify-content: center;
  gap: 10px;
}
.dial {
  width: 64px;
  height: 76px;
  background: #3b2a1e;
  border: 3px solid #1f150e;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--gold);
  font-size: 11px;
}
.dial img {
  width: 48px;
  height: 48px;
  image-rendering: pixelated;
}

/* 지도 */
.map-wrap {
  position: relative;
  width: 100%;
  max-width: 448px;
  margin: 0 auto;
  aspect-ratio: 128 / 96;
  background: #9c8f78;
  border: 2px solid var(--panel-edge);
}
.map-wrap > img {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  display: block;
}
.mark {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.mark img {
  width: 36px;
  height: 36px;
  image-rendering: pixelated;
  display: grid;
  place-items: center;
  font-size: 22px;
  color: #2b2118;
}
.mark .num {
  position: absolute;
  top: -10px;
  left: -12px;
  background: var(--red);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
}
.mark .lbl {
  font-size: 11px;
  background: rgba(15, 23, 42, 0.85);
  padding: 0 4px;
  margin-top: 2px;
  white-space: nowrap;
  color: var(--ink);
}

/* ---------- Toast ---------- */
#toast {
  position: absolute;
  left: 50%;
  top: 64px;
  transform: translateX(-50%);
  z-index: 40;
  background: var(--holo-bg);
  border: 2px solid var(--holo);
  color: #fff;
  padding: 10px 16px;
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 14px;
  animation: drop 0.4s;
  pointer-events: none;
}
#toast img {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
}

/* ---------- Screens ---------- */
.screen {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  background: radial-gradient(ellipse at center, #1b2a48 0%, #0b1120 70%);
  background-image: repeating-linear-gradient(0deg, rgba(111, 227, 255, 0.05) 0 2px, transparent 2px 4px),
    radial-gradient(ellipse at center, #1b2a48 0%, #0b1120 70%);
  overflow-y: auto; /* 휴대폰 가로처럼 낮은 화면에서 결과 화면이 잘리지 않게 */
}
.screen-inner {
  max-width: 520px;
  margin: auto; /* 화면보다 길면 위에서부터 보이고 스크롤됨 (가운데 정렬은 그대로) */
}
.sys-label {
  color: var(--holo);
  font-size: 12px;
  letter-spacing: 3px;
}
.screen h1 {
  font-size: clamp(24px, 6vw, 36px);
  margin: 12px 0 6px;
  color: #fff;
  text-shadow: 0 0 12px rgba(111, 227, 255, 0.6);
  word-break: keep-all;
}
.screen p {
  color: #c9d4e6;
}
.big-btn {
  margin-top: 18px;
  background: var(--gold);
  color: #1e293b;
  border: 3px solid var(--panel-edge);
  box-shadow: 0 4px 0 var(--panel-edge);
  padding: 12px 36px;
  font-size: 18px;
  font-weight: 700;
}
.big-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--panel-edge);
}
.result-code {
  font-size: 40px;
  color: var(--gold);
  text-shadow: 0 0 12px var(--gold);
  margin: 14px 0;
  letter-spacing: 6px;
}
.result-table {
  margin: 12px auto;
  border-collapse: collapse;
  font-size: 15px;
}
.result-table td {
  padding: 6px 14px;
  border-bottom: 1px solid rgba(111, 227, 255, 0.25);
}
.result-table td:first-child {
  color: var(--holo);
  text-align: left;
}
.result-table td:last-child {
  text-align: right;
}

@keyframes blink {
  50% {
    opacity: 0.3;
  }
}
@keyframes pop {
  0% {
    transform: scale(0.4);
  }
  70% {
    transform: scale(1.15);
  }
  100% {
    transform: scale(1);
  }
}
@keyframes pulse {
  50% {
    outline-color: #fff;
  }
}
@keyframes shake {
  20%,
  60% {
    transform: translateX(-8px);
  }
  40%,
  80% {
    transform: translateX(8px);
  }
}
@keyframes floatDown {
  from {
    opacity: 1;
    margin-top: 0;
  }
  to {
    opacity: 0;
    margin-top: 18px;
  }
}
@keyframes fadein {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes drop {
  from {
    opacity: 0;
    transform: translate(-50%, -12px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@media (max-width: 480px) {
  #dlgPortrait,
  #dlgPortrait img {
    width: 64px;
    height: 64px;
  }
  #dlgText {
    font-size: 15px;
  }
  #dlgBox {
    min-height: 112px;
    padding: 10px;
    gap: 10px;
  }
  .hud-btn {
    font-size: 12px;
    padding: 5px 8px;
  }
  .hud-btn .long {
    display: none;
  }
  .hud-btn .short {
    display: inline;
  }
  #hud {
    gap: 6px;
    padding: 8px;
  }
  #timer {
    min-width: 64px;
    font-size: 15px;
  }
  #codes span {
    width: 18px;
    height: 18px;
    font-size: 12px;
  }
}

/* 구역 이름 */
.hud-zone {
  color: #e2e8f0;
  font-size: 13px;
  padding: 4px 8px;
  border-left: 2px solid var(--holo);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
@media (max-width: 480px) {
  .hud-zone {
    display: none;
  }
}

/* 구역 이동 화면 (대사창보다 아래) */
#routeScreen {
  position: absolute;
  inset: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 16px 180px;
  background: rgba(11, 17, 32, 0.96);
}
.route-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(640px, 100%);
}
.route-title {
  color: #e2e8f0;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
}
#routeCanvas {
  /* 낮은 화면(휴대폰 가로)에서는 대사창 위 남은 높이에 맞춰 줄어듦: 위아래 여백 196 + 제목 20 + 간격 10 + 테두리 4 */
  width: min(100%, calc((100vh - 230px) * 1.6));
  width: min(100%, calc((100dvh - 230px) * 1.6));
  max-width: 640px;
  aspect-ratio: 320 / 200;
  image-rendering: pixelated;
  border: 2px solid var(--holo);
  box-shadow: 0 0 14px rgba(111, 227, 255, 0.35);
}

/* 최종 코드 */
.final-row {
  display: flex;
  gap: 8px;
  margin: 6px 0 10px;
}
.final-input {
  flex: 1;
  min-width: 0;
  font-family: var(--font);
  font-size: 22px;
  letter-spacing: 6px;
  padding: 10px 12px;
  background: var(--panel-deep);
  color: #34d399;
  border: 2px solid #10b981;
  outline: none;
}
.final-input:focus {
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.35);
}

/* ---------- 시작 화면: 버튼 · 톱니바퀴 · 설정 ---------- */
.title-btns {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
}
.title-btns .big-btn {
  margin-top: 0;
  width: 200px;
}
.big-btn.cont {
  background: var(--holo);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.big-btn.cont span {
  font-size: 11px;
  font-weight: 400;
  color: #0f2a3a;
}
.big-btn:disabled {
  background: #334155;
  color: #64748b;
  box-shadow: 0 4px 0 #1e293b;
  border-color: #334155;
  cursor: not-allowed;
  transform: none;
}
.big-btn.cont:disabled span {
  color: #64748b;
}
.gear-btn {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top));
  right: calc(14px + env(safe-area-inset-right));
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  background: var(--panel);
  color: var(--holo);
  border: 2px solid var(--panel-edge);
  box-shadow: 0 3px 0 var(--panel-edge);
}
.gear-btn:hover svg {
  animation: gear-spin 1.6s steps(8) infinite;
}
.gear-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--panel-edge);
}
@keyframes gear-spin {
  to {
    transform: rotate(360deg);
  }
}
#modal.top {
  z-index: 60;
}
.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  flex-wrap: wrap;
}
.set-row:last-of-type {
  border-bottom: 0;
}
.set-name {
  font-size: 15px;
}
.seg {
  display: flex;
}
.seg button {
  background: var(--panel-deep);
  color: var(--muted);
  border: 2px solid var(--panel-edge);
  padding: 6px 10px;
  font-size: 13px;
  margin-left: -2px;
}
.seg button.on {
  background: var(--holo);
  color: #0f172a;
  border-color: var(--holo);
  position: relative;
}
.set-actions,
.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}
/* 글자 크게 */
body.big-text #dlgText {
  font-size: 20px;
}
body.big-text #dlgName {
  font-size: 16px;
}
body.big-text #modalCard {
  font-size: 17px;
}
body.big-text .opt {
  font-size: 18px;
}
body.big-text .m-title {
  font-size: 14px;
}
body.big-text #invInfo,
body.big-text #tip {
  font-size: 15px;
}
.stage-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 8px 0 4px;
}
.stage-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
  background: var(--panel-deep);
  color: var(--ink);
  border: 2px solid var(--panel-edge);
  box-shadow: 0 3px 0 var(--panel-edge);
  text-align: left;
  min-width: 0;
}
.stage-card:not(:disabled):hover {
  border-color: var(--holo);
}
.stage-card:not(:disabled):active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--panel-edge);
}
.stage-pic {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #0b1120;
}
.stage-pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
  display: block;
  transition: filter 0.3s;
}
.stage-card.next {
  border-color: var(--holo); /* 아직 안 깬 다음 구역: 하늘색 테두리 + 「이어서 하기」 */
  box-shadow: 0 3px 0 var(--holo), 0 0 10px rgba(111, 227, 255, 0.35);
}
.stage-badge {
  position: absolute;
  left: 4px;
  top: 4px;
  padding: 2px 6px;
  background: var(--holo);
  color: #0b1120;
  font-size: 11px;
  font-weight: 700;
}
.stage-card.locked {
  cursor: not-allowed;
  box-shadow: none;
}
.stage-card.locked .stage-pic img {
  filter: grayscale(1) brightness(0.4);
}
.stage-card.secret .stage-pic img {
  filter: grayscale(1) brightness(0.3) blur(3px);
}
.stage-lock {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #cbd5e1;
}
.stage-name {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stage-card.locked .stage-name {
  color: var(--muted);
}
@media (max-width: 480px) {
  .stage-name {
    font-size: 12px;
  }
}
.set-actions .adm-btn {
  margin-right: auto;
  font-size: 12px;
  padding: 8px 10px;
  color: var(--muted);
}
.set-actions .adm-btn:disabled {
  color: var(--holo);
  border-color: var(--holo);
  box-shadow: none;
}

/* 튜토리얼: 화면 위 한 줄 안내, 첫 문제 안내, 눌러볼 인벤토리 칸 */
#tutBar {
  position: absolute;
  left: 50%;
  top: 10px;
  transform: translateX(-50%);
  max-width: calc(100% - 24px);
  background: rgba(13, 20, 36, 0.88);
  color: #fde68a;
  border: 2px solid #ca8a04;
  padding: 5px 12px;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  pointer-events: none;
  z-index: 3;
  animation: tutIn 0.3s;
}
@keyframes tutIn {
  from {
    opacity: 0;
    transform: translate(-50%, -6px);
  }
}
.m-tut {
  margin-top: 10px;
  padding: 8px 10px;
  background: #12223a;
  color: #bfe3ff;
  border: 2px solid #38bdf8;
  font-size: 13px;
  line-height: 1.5;
}
.slot.tut {
  outline: 2px solid #fde68a;
  outline-offset: 2px;
  animation: tutPulse 1s infinite;
}
@keyframes tutPulse {
  50% {
    outline-color: transparent;
  }
}
body.big-text #tutBar,
body.big-text .m-tut {
  font-size: 15px;
}
#guideBtn.tut {
  outline: 2px solid #fde68a;
  outline-offset: 2px;
  animation: tutPulse 1s infinite;
}

/* 휴대폰 가로처럼 낮은 화면: 결과 화면을 촘촘하게 해서 「처음부터 다시」가 스크롤 없이 보이게 */
@media (max-height: 480px) {
  .screen {
    padding: 8px 16px;
  }
  .screen h1 {
    font-size: 22px;
    margin: 4px 0 2px;
  }
  .result-code {
    font-size: 26px;
    margin: 4px 0;
    letter-spacing: 4px;
  }
  .result-table {
    margin: 4px auto;
    font-size: 13px;
  }
  .result-table td {
    padding: 2px 12px;
  }
  #resultInner p {
    margin: 4px 0;
    font-size: 13px;
  }
  #resultInner .big-btn {
    margin-top: 6px;
    padding: 8px 28px;
    font-size: 16px;
  }
}
