/* ===== 관리자 — 저녁 바 실내 톤 ===== */
.admin { max-width: 1120px; margin: 0 auto; padding: calc(22px + env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) calc(60px + env(safe-area-inset-bottom)) max(22px, env(safe-area-inset-left)); color: var(--on-dark); }
@media (max-width: 520px) { .admin { padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); } }
.admin-login { max-width: 420px; margin: 10vh auto 0; }
.admin-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.admin-head .brand { display: flex; align-items: center; gap: 12px; font-family: var(--font-serif-kr); font-weight: 700; font-size: 19px; }
.admin-head .brand .img-wrap { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; background: #150F0C; box-shadow: 0 0 0 1.5px var(--brass); }
.admin-head .brand img { width: 100%; height: 100%; object-fit: cover; }
.admin-head .brand .emoji-fallback { font-size: 24px; display: grid; place-items: center; width: 100%; height: 100%; }
.admin-head .brand em { font-family: var(--font-display); font-style: italic; font-weight: 500; color: var(--brass-2); font-size: 15px; margin-left: 4px; }
.admin-head .spacer { flex: 1; }
.tabs { display: flex; gap: 4px; max-width: 100%; overflow-x: auto; background: rgba(243,235,221,.05); border: 1px solid var(--line-dark); border-radius: 999px; padding: 4px; }
.tabs button { border: 0; background: transparent; padding: 8px 18px; min-height: 40px; border-radius: 999px; font-weight: 700; cursor: pointer; color: var(--on-dark-2); font-size: 14px; white-space: nowrap; touch-action: manipulation; }
.tabs button:hover { color: var(--on-dark); }
.tabs button.active { background: var(--brass); color: #2A1C0C; border: 0 solid transparent; border-image: url('../assets/btn-brass.webp') 0 88 fill / 0 18px stretch; }

.panel { background: linear-gradient(180deg, rgba(43,31,25,.72), rgba(26,19,16,.8)), url('../assets/tex-walnut.webp') center / 512px; border: 1px solid var(--line-dark); border-radius: 16px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { padding: 14px 16px; border-radius: 14px; background: rgba(243,235,221,.04); border: 1px solid var(--line-dark); }
.tile .k { font-size: 12px; color: var(--on-dark-3); font-weight: 600; letter-spacing: .04em; }
.tile .v { font-family: var(--font-display); font-size: 36px; font-weight: 600; line-height: 1.1; margin-top: 2px; color: var(--on-dark); }
.tile.brass .v { color: var(--brass-2); } .tile.wine .v { color: #F1B7C0; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .input { width: auto; min-width: min(240px, 100%); min-height: 42px; background: rgba(243,235,221,.06); border-color: var(--line-dark); color: var(--on-dark); }
.toolbar .input::placeholder { color: var(--on-dark-3); }
.table-wrap { overflow: auto; border-radius: 14px; border: 1px solid var(--line-dark); background: rgba(243,235,221,.03); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line-dark); white-space: nowrap; }
th { font-size: 11px; color: var(--on-dark-3); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; background: rgba(0,0,0,.2); position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
td.num { font-family: var(--font-display); font-size: 18px; font-weight: 600; color: var(--brass-2); font-variant-numeric: tabular-nums; }
tr.void td { color: var(--on-dark-3); text-decoration: line-through; }
.empty { padding: 34px; text-align: center; color: var(--on-dark-3); }
.small { font-size: 12px; color: var(--on-dark-3); }

/* 추첨 탭 */
.draw-controls { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; padding: 14px 16px; margin-bottom: 16px; }
.draw-controls .field { margin: 0; }
.draw-controls .field label { color: var(--on-dark-2); }
.draw-controls .input { min-height: 46px; background: rgba(243,235,221,.06); border-color: var(--line-dark); color: var(--on-dark); }
.draw-controls select.input option { color: var(--ink); }
.draw-controls .chk { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; min-height: 46px; color: var(--on-dark-2); }
.draw-controls .chk input { width: 17px; height: 17px; accent-color: var(--brass); }
.draw-controls .btn { width: auto; min-height: 48px; padding: 10px 24px; }
.draw-area {
  position: relative; border-radius: 22px; padding: 56px 28px 28px; overflow: hidden;
  background: radial-gradient(ellipse 70% 50% at 50% 0%, rgba(241,180,98,.22), transparent 60%), linear-gradient(180deg, #2A1E18, #1A1310 70%);
  box-shadow: inset 0 0 0 1px rgba(201,162,77,.35), 0 30px 80px rgba(0,0,0,.5);
}
.draw-area.has-bg { background-size: cover; background-position: center; }
.draw-area.has-bg::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(26,19,16,.55), rgba(26,19,16,.8)); }
.draw-area > * { position: relative; }
@media (max-width: 520px) { .draw-area { padding: 56px 12px 20px; border-radius: 18px; } }
/* 전체화면: 머신 크기는 gacha.js 의 _fit() 이 화면 높이에 맞춰 계산한다 */
.draw-area.fs {
  position: fixed; inset: 0; z-index: 40; border-radius: 0; display: flex; flex-direction: column; justify-content: center; overflow: auto;
  padding: calc(56px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.draw-area.fs .gacha-stage { max-width: 1400px; }
.draw-area .fs-tools { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: max(14px, env(safe-area-inset-right)); display: flex; gap: 8px; z-index: 10; }
.draw-area .fs-tools .btn { width: auto; }
.last-result { margin-top: 14px; padding: 14px 18px; display: none; }
.last-result.on { display: block; }
.last-result h3 { margin: 0 0 10px; font-size: 14px; color: var(--on-dark-2); font-weight: 600; }
.win-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.win-chip { display: inline-flex; align-items: center; gap: 10px; background: rgba(201,162,77,.12); border: 1px solid rgba(201,162,77,.45); border-radius: 999px; padding: 6px 16px 6px 12px; font-weight: 600; color: var(--on-dark); }
.win-chip b { font-family: var(--font-display); font-size: 20px; color: var(--brass-2); font-weight: 600; }

/* 결과 재확인 오버레이 */
.result-overlay { position: fixed; inset: 0; background: rgba(14,10,8,.94); z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: safe center; overflow: auto; padding: 30px; color: var(--on-dark); }
.result-overlay::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse 60% 40% at 50% 0%, rgba(241,180,98,.25), transparent 60%); pointer-events: none; }
.result-overlay > * { position: relative; }
.result-overlay .ro-mascot { width: 150px; height: 150px; border-radius: 50%; overflow: hidden; background: #150F0C; box-shadow: 0 0 0 2px var(--brass), 0 0 0 6px #150F0C, var(--glow-amber); margin-bottom: 14px; }
.result-overlay .ro-mascot img { width: 100%; height: 100%; object-fit: cover; }
.result-overlay .ro-mascot .emoji-fallback { display: grid; place-items: center; width: 100%; height: 100%; font-size: 80px; }
.result-overlay .ro-head { text-align: center; margin-bottom: 24px; }
.result-overlay .ro-head .r { font-family: var(--font-display); font-style: italic; font-size: 20px; letter-spacing: .16em; color: var(--brass-2); }
.result-overlay .ro-head h2 { font-family: var(--font-serif-kr); margin: 6px 0 0; font-size: 34px; font-weight: 700; }
.result-overlay .ro-grid { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; max-width: 1000px; }
.result-overlay .ro-card { background: var(--cream) url('../assets/tex-paper.webp') center / 384px; color: var(--ink); border-radius: 16px; padding: 18px 30px 20px; text-align: center; min-width: 200px; box-shadow: 0 0 0 1px rgba(201,162,77,.7), 0 20px 50px rgba(0,0,0,.5); animation: ro-in .5s cubic-bezier(.2,1.4,.4,1) both; position: relative; }
.result-overlay .ro-card::before { content: ''; position: absolute; inset: 6px; border-radius: 11px; border: 1px solid rgba(201,162,77,.5); pointer-events: none; }
.result-overlay .ro-card .n { font-family: var(--font-display); font-size: 58px; font-weight: 700; line-height: 1; }
.result-overlay .ro-card .nm { font-family: var(--font-serif-kr); font-size: 19px; font-weight: 700; color: var(--ink-2); margin-top: 6px; }
.result-overlay .ro-card .cancelled { color: var(--danger); font-size: 12px; font-weight: 700; margin-top: 4px; }
@keyframes ro-in { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.result-overlay .ro-close { margin-top: 28px; width: auto; }

/* 당첨자 */
.round-block { margin-bottom: 20px; }
.round-block h3 { margin: 0 0 8px; display: flex; align-items: center; gap: 12px; font-family: var(--font-serif-kr); font-size: 16px; font-weight: 700; }
.round-block h3 .btn { width: auto; }

/* 설정 */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.settings-grid .card h3 { font-family: var(--font-serif-kr); margin: 0 0 6px; font-size: 17px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-cream); }
.switch:last-child { border-bottom: 0; }
.toggle { position: relative; width: 52px; height: 30px; border-radius: 999px; background: #CBBFA8; border: 0; cursor: pointer; transition: .2s; flex: none; }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 2px 4px rgba(0,0,0,.25); }
.toggle.on { background: var(--olive); } .toggle.on::after { left: 25px; }
.danger-zone { background: #F6E9E6; }
.danger-zone h3 { color: var(--danger); }
.qr-box { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.qr-box canvas { border-radius: 10px; background: #fff; box-shadow: 0 0 0 1px var(--line-cream); }
.card .small { color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row .input { flex: 1; min-width: 160px; }
