/* 액자 PWA — 구형 태블릿 대상이라 flex/gradient 정도까지만 쓴다 */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #000;
  color: #fff;
  font-family: -apple-system, "Noto Sans KR", "Malgun Gothic", sans-serif;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.screen { position: fixed; top: 0; left: 0; right: 0; bottom: 0; }
[hidden] { display: none !important; }

/* ── F1. 토큰 입력 ─────────────────────────────────────── */
#screen-token { display: flex; align-items: center; justify-content: center; padding: 24px; }

.token-box { width: 100%; max-width: 640px; text-align: center; }
.token-box h1 { font-size: 34px; font-weight: 600; margin: 0 0 28px; }

.token-input {
  display: block;
  width: 100%;
  padding: 20px 12px;
  font-size: 44px;
  letter-spacing: 6px;
  text-align: center;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  color: #fff;
  background: #1a1a1a;
  border: 2px solid #444;
  border-radius: 12px;
  outline: none;
}
.token-input:focus { border-color: #7aa7ff; }

.big-button {
  display: block;
  width: 100%;
  margin-top: 20px;
  padding: 20px;
  font-size: 26px;
  font-weight: 600;
  color: #fff;
  background: #2f6fed;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
}
.big-button:active { background: #2559c4; }

.token-error { margin-top: 18px; font-size: 20px; color: #ff8080; }

/* ── F2. 슬라이드쇼 ────────────────────────────────────── */
.stage { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: #000; }

.layer {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  -webkit-transition: opacity 900ms ease-in-out;
  transition: opacity 900ms ease-in-out;
}
.layer.visible { opacity: 1; }

.caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 40px 32px 28px;
  font-size: 22px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
  background: -webkit-linear-gradient(top, rgba(0,0,0,0), rgba(0,0,0,0.65));
  background: linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,0.65));
  pointer-events: none;
}

.status {
  position: absolute;
  top: 16px; left: 16px;
  padding: 8px 14px;
  font-size: 15px;
  color: #ddd;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 999px;
  pointer-events: none;
}

/* 야간 모드 */
.night-veil {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  -webkit-transition: opacity 1200ms ease;
  transition: opacity 1200ms ease;
}
.night-veil.dim   { opacity: 0.82; }
.night-veil.black { opacity: 1; }

/* ── F3. 설정 오버레이 ─────────────────────────────────── */
.overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.72);
  padding: 20px;
  z-index: 10;
}

.panel {
  width: 100%;
  max-width: 560px;
  max-height: 100%;
  overflow-y: auto;
  padding: 24px;
  background: #141414;
  border-radius: 16px;
}
.panel h2 { margin: 0 0 20px; font-size: 24px; font-weight: 600; }

.row { margin-bottom: 22px; }
.row .label { display: block; margin-bottom: 10px; font-size: 17px; color: #aaa; }

.choices { display: flex; }
.choices button {
  flex: 1;
  padding: 14px 6px;
  margin-right: 8px;
  font-size: 18px;
  color: #ddd;
  background: #262626;
  border: 2px solid transparent;
  border-radius: 10px;
  cursor: pointer;
}
.choices button:last-child { margin-right: 0; }
.choices button.active { color: #fff; background: #2f6fed; border-color: #7aa7ff; }

.night-range { margin-top: 10px; font-size: 16px; color: #aaa; }
.night-range input {
  width: 68px;
  padding: 8px;
  font-size: 17px;
  color: #fff;
  background: #262626;
  border: 1px solid #444;
  border-radius: 8px;
  text-align: center;
}

.row.info { font-size: 15px; color: #888; }

.row.actions { display: flex; margin-bottom: 0; }
.row.actions button { flex: 1; margin-right: 8px; margin-top: 0; }
.row.actions button:last-child { margin-right: 0; }

.ghost-button {
  padding: 18px 10px;
  font-size: 18px;
  color: #ddd;
  background: #262626;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
}
.ghost-button.danger { color: #ff9a9a; }
