* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0d0c10; color: #f4efe6;
  font-family: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif; }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

#hud { position: fixed; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; pointer-events: none; flex-wrap: wrap; }
#hud > * { pointer-events: auto; }
.brand { font-weight: 700; font-size: 18px; letter-spacing: 0.02em; text-shadow: 0 1px 2px #000; display: flex; gap: 8px; align-items: center; }
.badge { font-size: 12px; font-weight: 500; background: #3a2f1f; color: #f0c987; padding: 3px 8px; border-radius: 999px; }
.tools { display: flex; gap: 6px; flex-wrap: wrap; }
.tools select, .tools button { background: rgba(20, 18, 24, 0.85); color: #f4efe6; border: 1px solid #4a4350; border-radius: 8px; padding: 7px 10px; font: inherit; font-size: 14px; cursor: pointer; }
.tools select:focus, .tools button:hover { border-color: #d9b26b; outline: none; }
#help { position: fixed; bottom: 12px; left: 50%; transform: translateX(-50%); font-size: 13px; color: #c9c2b5; background: rgba(13, 12, 16, 0.7); padding: 6px 12px; border-radius: 999px; white-space: nowrap; max-width: 96vw; overflow: hidden; text-overflow: ellipsis; }
#loading { position: fixed; inset: 0; display: grid; place-items: center; background: #0d0c10; font-size: 16px; color: #c9c2b5; }
body.clean #hud, body.clean #help { display: none; }

.layer { position: fixed; inset: 0; background: rgba(5, 4, 8, 0.55); display: grid; place-items: center; padding: 16px; z-index: 10; }
.card { width: min(440px, 100%); max-height: 86vh; overflow: auto; background: #1b1a20; border: 1px solid #3a3540; border-radius: 14px; padding: 20px; box-shadow: 0 10px 40px rgba(0,0,0,0.5); }
.card h2 { margin: 6px 0 10px; font-size: 20px; font-weight: 700; }
.card p { margin: 0 0 12px; line-height: 1.6; color: #d8d1c4; }
.card .hint { font-size: 13px; color: #a9a196; }
.eyebrow { font-size: 12px; color: #d9b26b; letter-spacing: 0.04em; }
.card input, .card textarea { width: 100%; margin: 6px 0; background: #121116; color: #f4efe6; border: 1px solid #3a3540; border-radius: 8px; padding: 10px 12px; font: inherit; font-size: 15px; resize: vertical; }
.card input:focus, .card textarea:focus { border-color: #d9b26b; outline: none; }
.count { text-align: right; font-size: 12px; color: #8d867c; }
.err { min-height: 18px; font-size: 13px; color: #ff8a80; margin-top: 4px; }
.row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; flex-wrap: wrap; }
.row button { border-radius: 8px; padding: 9px 14px; font: inherit; font-size: 14px; cursor: pointer; border: 1px solid #4a4350; background: transparent; color: #f4efe6; }
.row button.primary { background: #d9b26b; border-color: #d9b26b; color: #1b1a20; font-weight: 700; }
.row button.primary[disabled] { opacity: 0.5; cursor: default; }
.row button.danger { color: #ff8a80; border-color: #6a3a3a; }

.card.paper { background: #fbf8f1; color: #2b2b2b; border-color: #e6dfd0; }
.card.paper p, .card.paper .note-body { color: #3a3a3a; white-space: pre-wrap; }
.card.paper .row button { color: #2b2b2b; border-color: #d6cdbb; }
.card.paper .row button.primary { color: #1b1a20; }
.card.paper .row button.danger { color: #b3261e; border-color: #e6b8b4; }
.ticket { display: inline-block; font-size: 12px; font-weight: 700; color: #7a1f2b; border: 1px dashed #c9a2a8; padding: 4px 10px; border-radius: 6px; background: #fff; }
.ticket.expect { color: #8a5a00; border-color: #e0c48a; }
.note-title { color: #1b1a20; }
.by { font-size: 13px; color: #6d675d; text-align: right; }

.list { display: flex; flex-direction: column; gap: 6px; max-height: 46vh; overflow: auto; margin: 6px 0; }
.list .item { text-align: left; background: #121116; border: 1px solid #2f2b35; color: #f4efe6; border-radius: 8px; padding: 10px 12px; cursor: pointer; font: inherit; font-size: 14px; }
.list .item:hover { border-color: #d9b26b; }
.list .item span { color: #a9a196; }
.empty { color: #a9a196; font-size: 14px; padding: 8px 0; }

.toast { position: fixed; left: 50%; bottom: 56px; transform: translate(-50%, 10px); background: rgba(27, 26, 32, 0.95); border: 1px solid #4a4350; color: #f4efe6; padding: 10px 16px; border-radius: 10px; font-size: 14px; opacity: 0; transition: all 0.25s; z-index: 20; max-width: 92vw; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 640px) {
  #help { font-size: 11px; }
  .brand { font-size: 15px; }
}

/* ---------- 관람 모드 ---------- */
#seatbar { position: fixed; top: 60px; left: 12px; display: flex; align-items: center; gap: 10px; z-index: 20; }
#seatbar[hidden] { display: none; }
#seatbar .stand { font-size: 15px; padding: 10px 16px; border-radius: 999px; background: rgba(13, 12, 16, 0.78); color: #f1ebe0; border: 1px solid rgba(255, 255, 255, 0.18); min-height: 44px; }
#seatbar .seat-label { font-size: 13px; color: #c9c2b5; background: rgba(13, 12, 16, 0.6); padding: 6px 10px; border-radius: 999px; }
#notecard { position: fixed; z-index: 25; left: 10px; right: 10px; bottom: 10px; max-height: 42vh; overflow: auto; padding: 14px 16px 12px; border-radius: 14px; background: #fbf8f1; color: #2b2b2b; border: 1px solid #e6dfd0; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45); touch-action: pan-y; }
#notecard[hidden] { display: none; }
#notecard .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
#notecard .meta { font-size: 12px; color: #8a7f70; }
#notecard .x { font-size: 22px; line-height: 1; width: 44px; height: 36px; background: none; border: none; color: #8a7f70; cursor: pointer; }
#notecard .note-title { margin: 4px 0 6px; font-size: 17px; }
#notecard .note-body { margin: 0 0 6px; font-size: 15px; line-height: 1.6; white-space: pre-wrap; color: #3a3a3a; }
#notecard .nav { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; gap: 8px; }
#notecard .nav button { min-height: 44px; min-width: 88px; font-size: 15px; border-radius: 10px; border: 1px solid #d6cdbb; background: #fff; color: #2b2b2b; cursor: pointer; }
#notecard .nav .link { min-width: 0; border: none; background: none; color: #a0968a; font-size: 13px; text-decoration: underline; }
body.seated #help { bottom: auto; top: 112px; }
body.seated.cardopen #help { display: none; }
@media (min-width: 820px) and (pointer: fine) {
  #notecard { left: auto; right: 16px; top: 72px; bottom: auto; width: 340px; max-height: calc(100vh - 140px); }
  body.seated #help { top: auto; bottom: 12px; }
  body.seated.cardopen #help { display: block; }
}
@media (max-width: 640px) {
  body.seated #hud .tools { display: none; }   /* 앉아 있는 동안 좁은 화면에선 위 메뉴를 접어 일어나기 버튼 자리를 만든다 */
  #seatbar { top: 48px; }
}

#notecard .go { display: block; margin: 6px 0 0; min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid #d6cdbb; background: #fff; color: #2b2b2b; font-size: 14px; cursor: pointer; }
#notecard .go[hidden], #notecard .link[hidden] { display: none; }
#notecard .nav .mid { display: flex; gap: 10px; align-items: center; }

/* 포스터 저작권 안내 */
#notice { position: fixed; top: 58px; right: 12px; width: min(320px, calc(100vw - 24px)); background: rgba(16, 15, 19, 0.94); color: #d8d1c4; border: 1px solid #3a3530; border-radius: 12px; padding: 12px 14px; font-size: 13px; line-height: 1.55; z-index: 30; }
#notice p { margin: 0 0 8px; }
#notice .mail a { color: #e2bd78; }
#notice button { float: right; }
body.clean #notice { display: none; }
@media (max-width: 600px) { #notice { top: 104px; } }

/* 관람 반응 고르기 */
.chips-label { font-size: 13px; color: #a69d8f; margin: 10px 0 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.chip { font: inherit; font-size: 13px; padding: 5px 11px; border-radius: 999px; border: 1px solid #5a534a; background: transparent; color: #ddd5c7; cursor: pointer; }
.chip.on { background: #e2bd78; border-color: #e2bd78; color: #1b1712; }
