@font-face { font-family: "Pretendard"; font-weight: 400; font-display: block; src: url("fonts/Pretendard-Regular.woff2") format("woff2"); }
@font-face { font-family: "Pretendard"; font-weight: 700; font-display: block; src: url("fonts/Pretendard-Bold.woff2") format("woff2"); }
@font-face { font-family: "Pretendard"; font-weight: 800; font-display: block; src: url("fonts/Pretendard-ExtraBold.woff2") format("woff2"); }

:root {
  --bg: #fbf8f1;
  --panel: #ffffff;
  --ink: #26221b;
  --muted: #6f675a;
  --line: #e6dfcf;
  --gold: #b7862b;
  --gold-soft: #f3e7c9;
  --accent: #2f6b3a;
  --accent-ink: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1c1a16; --panel: #26231d; --ink: #f2ede2; --muted: #b3aa98;
    --line: #3b362c; --gold: #d8a94a; --gold-soft: #3a3120; --accent: #4f9a5c;
  }
}
:root[data-theme="dark"] {
  --bg: #1c1a16; --panel: #26231d; --ink: #f2ede2; --muted: #b3aa98;
  --line: #3b362c; --gold: #d8a94a; --gold-soft: #3a3120; --accent: #4f9a5c;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font-family: "Pretendard", -apple-system, "Apple SD Gothic Neo", sans-serif;
  font-size: 18px; line-height: 1.5;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

.screen { max-width: 1180px; margin: 0 auto; padding: 20px 16px 24px; }
.top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
h1 { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
.count { color: var(--muted); font-variant-numeric: tabular-nums; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; margin-top: 20px; align-items: start; }
.left { display: flex; flex-direction: column; gap: 18px; }
.right { position: sticky; top: 16px; }

.scene { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.scene-btn {
  padding: 18px 12px; border-radius: 14px; font-size: 22px; font-weight: 700;
  background: var(--panel); border: 2px solid var(--line);
}
.scene-btn.on { border-color: var(--gold); background: var(--gold-soft); }

.drop {
  display: flex; flex-direction: column; gap: 6px; align-items: center; justify-content: center; text-align: center;
  min-height: 150px; padding: 20px; border-radius: 16px; cursor: pointer;
  border: 2px dashed var(--gold); background: var(--panel);
}
.drop strong, .adjust strong { font-size: 22px; }
.drop span { color: var(--muted); font-size: 16px; }
.drop.over { background: var(--gold-soft); }
.drop.has { min-height: 80px; }

.adjust { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.adjust label { display: flex; align-items: center; gap: 12px; }
.adjust input[type=range] { flex: 1; accent-color: var(--gold); height: 28px; }
.hint { margin: 0; color: var(--muted); font-size: 15px; }

.actions { display: flex; flex-direction: column; gap: 10px; }
.print {
  padding: 22px; border-radius: 16px; border: 0; font-size: 28px; font-weight: 800;
  background: var(--accent); color: var(--accent-ink);
}
.print:disabled { opacity: .35; cursor: not-allowed; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1; }
.small { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); font-size: 16px; }
.small:disabled { opacity: .4; cursor: not-allowed; }
.privacy { margin: 0; color: var(--muted); font-size: 14px; }

canvas {
  width: 100%; height: auto; display: block; border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 12px 32px rgba(60,45,15,.16);
  touch-action: none; cursor: grab; background: #fff;
}
canvas.dragging { cursor: grabbing; }

.bottom { display: flex; gap: 18px; margin-top: 24px; }
.link { background: none; border: 0; color: var(--muted); padding: 6px 0; text-decoration: underline; text-underline-offset: 3px; font-size: 16px; }

dialog { border: 0; border-radius: 18px; padding: 0; width: min(560px, calc(100vw - 32px)); background: var(--panel); color: var(--ink); }
dialog::backdrop { background: rgba(20, 16, 8, .45); }
.sheet { padding: 22px; display: flex; flex-direction: column; gap: 14px; max-height: 88vh; overflow-y: auto; }
.sheet h2 { margin: 0; font-size: 24px; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
legend { font-weight: 700; padding: 0 6px; }
fieldset label { display: flex; flex-direction: column; gap: 4px; font-size: 15px; color: var(--muted); }
fieldset label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); }
fieldset input:not([type=checkbox]), fieldset textarea { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); font-size: 17px; }
.sheet ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }

@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  .right { position: static; order: -1; }
  h1 { font-size: 24px; }
}

/* 인쇄: 4×6 인치 한 장에 액자 이미지만 */
#printImg { display: none; }
@page { size: 4in 6in; margin: 0; }
@media print {
  html, body { background: #fff; }
  .screen, dialog { display: none !important; }
  #printImg { display: block; width: 4in; height: 6in; margin: 0; }
}

/* 부스 폰 보내기 화면 · 인쇄대 대기열 */
.send { max-width: 520px; display: flex; flex-direction: column; gap: 18px; }
.send section { display: flex; flex-direction: column; gap: 16px; }
.card { display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.card strong { font-size: 22px; }
.pin { padding: 16px; border-radius: 14px; border: 2px solid var(--line); background: var(--bg); font-size: 32px; text-align: center; letter-spacing: .3em; font-weight: 800; }
.preview { width: 100%; border-radius: 12px; box-shadow: 0 8px 24px rgba(60,45,15,.16); }
.status { margin: 0; min-height: 1.5em; font-size: 20px; font-weight: 700; text-align: center; }

.queue { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.queue-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.queue-head strong { font-size: 20px; }
.queue-list { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; min-height: 96px; align-items: center; }
.queue-item { flex: none; position: relative; width: 76px; height: 95px; padding: 0; border-radius: 10px; overflow: hidden; border: 3px solid transparent; background: var(--bg); }
.queue-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.queue-item.on { border-color: var(--accent); }
.queue-item span { position: absolute; left: 4px; top: 4px; font-size: 14px; line-height: 1; }
.queue-empty { color: var(--muted); font-size: 15px; }
