/* UI 텍스트 오버레이 전용 스타일. 게임 그림은 모두 art/ 의 실제 이미지에서 온다(여기에 그림 없음). */
:root { color-scheme: dark; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #17141c; color: #fff;
  font-family: "Apple SD Gothic Neo","Noto Sans KR","Malgun Gothic","Nanum Gothic",sans-serif;
  touch-action: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
#safe-probe { position: fixed; left: 0; top: 0; width: 0; height: 0; visibility: hidden;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; background: #17141c; }
#game[hidden] { display: none; }
.screen { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; text-align: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.screen.on { display: flex; }
.card-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; z-index: 0; pointer-events: none; }
.panel { position: relative; z-index: 1; max-width: min(92vw, 640px); background: rgba(24,18,34,.88); border: 2px solid #5b4a78; border-radius: 16px; padding: 20px 22px; }
.panel h1 { margin: 0 0 8px; font-size: clamp(22px, 5vw, 34px); }
.panel p { margin: 6px 0; line-height: 1.5; font-size: clamp(15px, 3.6vw, 18px); }
.btnrow { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 14px; }
.btn { min-width: 132px; min-height: 56px; padding: 10px 18px; font: inherit; font-size: clamp(17px, 4vw, 22px); font-weight: 700; color: #fff;
  background: #6b4fa0; border: 2px solid #b79be6; border-radius: 14px; cursor: pointer; }
.btn.sub { background: #3a3150; border-color: #6d5f8c; }
.btn:active { transform: translateY(1px); filter: brightness(1.1); }
.startcard .btnrow { margin-top: 0; position: absolute; z-index: 1; left: 0; right: 0; bottom: 8%; flex-direction: row; }
.startcard.portrait .btnrow { bottom: 6%; flex-direction: column; align-items: center; }
.miss { text-align: left; max-height: 46vh; overflow: auto; font-size: 14px; margin: 10px 0; padding: 8px 12px; background: rgba(0,0,0,.35); border-radius: 8px; }
.miss div { padding: 2px 0; border-bottom: 1px dashed #4a3f60; }
.dbg { position: absolute; inset: 0; overflow: auto; text-align: left; padding: 16px; background: #14111a; z-index: 5; touch-action: pan-y; -webkit-user-select: text; user-select: text; }
.dbg h1 { font-size: 22px; } .dbg h2 { font-size: 17px; margin: 18px 0 6px; border-bottom: 1px solid #4a3f60; padding-bottom: 3px; }
.dbg-bar { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
.dbg-bar button { min-height: 48px; padding: 8px 14px; font: inherit; background: #3a3150; color: #fff; border: 1px solid #6d5f8c; border-radius: 10px; }
.dbg-table { border-collapse: collapse; width: 100%; font-size: 13px; margin: 6px 0; }
.dbg-table th, .dbg-table td { border: 1px solid #3d3452; padding: 4px 6px; vertical-align: top; }
.dbg-table th { background: #241d33; }
.dbg pre { background: #000; padding: 8px; overflow: auto; font-size: 12px; }
.toast-top { position: fixed; z-index: 9; left: 50%; top: max(10px, env(safe-area-inset-top, 0px)); transform: translateX(-50%); background: rgba(24,18,34,.92); border: 1px solid #b79be6; padding: 10px 16px; border-radius: 12px; font-size: 16px; max-width: 90vw; text-align: center; }
