/* 게임 운영툴 스타일 — 데모마켓 운영툴(시안 A: 머리줄 · 왼쪽 메뉴 · 표에서 바로 고치기)의 짜임을 그대로, 색만 게임 운영툴용 */
:root {
  --brand: #0f766e; --brand-dark: #115e59; --text: #111827; --muted: #6b7280; --line: #e5e7eb;
  --bg: #f9fafb; --card: #fff; --danger: #dc2626; --ok: #16a34a; --warn: #d97706; --radius: 10px;
}
* { box-sizing: border-box; }
/* 머리글이 80px 에서 줄 때 스크롤 고정(anchoring)이 scrollY 를 되돌려 머리글이 끝없이 커졌다 줄었다 하는 것을 막는다 */
html { overflow-anchor: none; }
body { margin: 0; font: 15px/1.6 system-ui, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif; color: var(--text); background: var(--bg); }
body.no-scroll { overflow: hidden; }
a { color: inherit; }
main { max-width: 1120px; margin: 0 auto; padding: 24px 16px 80px; min-height: 60vh; }
h1 { font-size: 24px; margin: 8px 0 20px; }
.muted { color: var(--muted); }
.error-text { color: var(--danger); font-size: 13px; margin: 4px 0 0; }

/* 버튼 · 입력 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: inherit; cursor: pointer; text-decoration: none; color: var(--text); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.danger { color: var(--danger); border-color: #fecaca; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.block { width: 100%; }
.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.form { max-width: 520px; display: grid; gap: 16px; }
.form-row { display: grid; gap: 6px; }
.form-row > label, .form-row > .label { font-weight: 600; font-size: 14px; }
.req::after { content: ' *'; color: var(--danger); }
input[type=text], input[type=password], input[type=email], input[type=tel], input[type=date], input[type=search], input[type=number], select, textarea {
  width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid #d1d5db; border-radius: 8px; font: inherit; background: #fff;
}
textarea { min-height: 160px; resize: vertical; }
input:disabled { background: #f3f4f6; color: var(--muted); }
.inline { display: flex; gap: 8px; align-items: center; }
.inline > input { flex: 1; }
.choices { display: flex; flex-wrap: wrap; gap: 14px; }
.choices label { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; }
.counter { text-align: right; font-size: 12px; color: var(--muted); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.switch input { width: 40px; height: 22px; appearance: none; background: #d1d5db; border-radius: 11px; position: relative; cursor: pointer; transition: background .2s; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .2s; }
.switch input:checked { background: var(--brand); }
.switch input:checked::after { left: 21px; }

/* 카드 · 표 · 탭 · 아코디언 · 페이지 */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
table.list { width: 100%; border-collapse: collapse; background: #fff; }
table.list th, table.list td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; }
table.list th { background: #f3f4f6; font-weight: 600; }
table.list tr.notice { background: #fffbeb; }
table.list tr.answer td { background: #f5f3ff; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 16px; }
.tabs [role=tab] { background: none; border: 0; padding: 10px 16px; font: inherit; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tabs [role=tab][aria-selected=true] { border-color: var(--brand); color: var(--brand); font-weight: 700; }
.accordion .q { width: 100%; text-align: left; background: #fff; border: 0; border-bottom: 1px solid var(--line); padding: 14px 12px; font: inherit; cursor: pointer; display: flex; justify-content: space-between; }
.accordion .q[aria-expanded=true] { font-weight: 700; }
.accordion .a { padding: 12px 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
.pager { display: flex; gap: 4px; justify-content: center; margin-top: 20px; }
.pager button { min-width: 36px; height: 36px; border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; }
.pager button[aria-current=page] { background: var(--brand); color: #fff; border-color: var(--brand); }
.pager button:disabled { opacity: .4; cursor: not-allowed; }
.empty-state { text-align: center; padding: 60px 16px; color: var(--muted); }
.status { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.skeleton { background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* 모달 · 토스트 */
.modal-backdrop { position: fixed; inset: 0; z-index: 1000; background: rgba(17,24,39,.5); display: flex; align-items: center; justify-content: center; padding: 16px; opacity: 0; transition: opacity .3s; }
.modal-backdrop.open { opacity: 1; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 440px; max-height: 90vh; display: flex; flex-direction: column; transform: translateY(12px); transition: transform .3s; }
.modal-backdrop.open .modal { transform: none; }
.modal.wide { max-width: 720px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-x { background: none; border: 0; font-size: 24px; cursor: pointer; line-height: 1; }
.modal-body { padding: 20px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; }
#toast-box { position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%); z-index: 1100; display: grid; gap: 8px; }
.toast { background: #111827; color: #fff; padding: 12px 20px; border-radius: 24px; animation: toast-in .3s ease-out; transition: opacity .3s; }
.toast.leaving { opacity: 0; }
@keyframes toast-in { from { transform: translateY(20px); opacity: 0; } }

body.ops { background: #f9fafb; }
.ops-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 24px; background: #fff; border-bottom: 1px solid var(--line); }
.ops-brand { display: flex; align-items: center; gap: 10px; }
.ops-brand span { color: var(--muted); }
.ops-util { display: flex; align-items: center; gap: 16px; font-size: 14px; }
.ops-body { display: flex; flex-wrap: wrap; min-height: calc(100vh - 61px); }
.ops-nav { flex: 1 1 180px; max-width: 220px; background: #fff; border-right: 1px solid var(--line); padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; }
.ops-nav a { color: #374151; text-decoration: none; padding: 10px 12px; border-radius: 8px; }
.ops-nav a:hover { background: #f3f4f6; }
.ops-nav a[aria-current=page] { background: #ede9fe; color: var(--brand-dark); font-weight: 700; }
.ops-main { flex: 999 1 560px; min-width: 0; padding: 24px 28px; display: flex; flex-direction: column; gap: 16px; }
.ops-main h1 { margin: 0; font-size: 22px; }
.ops-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ops-bar .push { margin-left: auto; }
.ops-bar input, .ops-bar select, .ops-main td input, .ops-main td select { font: inherit; font-size: 14px; border: 1px solid #d1d5db; border-radius: 6px; padding: 6px 8px; background: #fff; }
.ops-main td input[type=number] { width: 110px; }
.chip { font: inherit; font-size: 14px; border: 1px solid #d1d5db; background: #fff; border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.chip[aria-pressed=true] { background: var(--brand); border-color: var(--brand); color: #fff; }
.ops-table { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.ops-table td, .ops-table th { white-space: nowrap; }
.ops-table .num { text-align: right; }
.ops-table .btn { min-height: 32px; padding: 0 10px; font-size: 13px; }
.ops-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.ops-cards a { display: block; text-decoration: none; color: inherit; }
.ops-cards .card { display: flex; flex-direction: column; gap: 6px; }
.ops-cards strong { font-size: 28px; }
.ops-note { margin: 0; font-size: 13px; color: var(--muted); }
.ops-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; align-items: start; }
.ops-main .card .form-row input, .ops-main .card .form-row textarea { width: 100%; box-sizing: border-box; }
.ops-preview { margin: 0; padding: 10px 12px; border: 1px dashed #c4b5fd; border-radius: 8px; background: #faf5ff; font-size: 14px; }
.ops-ok { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 14px; border: 1px solid #bbf7d0; border-radius: 10px; background: #f0fdf4; font-size: 14px; }
.ops-nav a[aria-current=page] { background: #ccfbf1; }
.status.ok { background: #dcfce7; color: #15803d; }
.status.bad { background: #fee2e2; color: #b91c1c; }
.status.warn { background: #fef3c7; color: #b45309; }
.status.off { background: #f3f4f6; color: #6b7280; }
.status.info { background: #dbeafe; color: #1d4ed8; }
.ops-detail { display: flex; flex-direction: column; gap: 12px; }
.ops-detail h2 { margin: 0; font-size: 17px; }
.ops-picked { display: flex; flex-wrap: wrap; gap: 6px; }
.ops-picked button { font: inherit; font-size: 13px; border: 1px solid #99f6e4; background: #f0fdfa; border-radius: 999px; padding: 4px 10px; cursor: pointer; }
.ops-results { max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.ops-results button { display: block; width: 100%; text-align: left; font: inherit; font-size: 14px; background: #fff; border: 0; border-bottom: 1px solid var(--line); padding: 8px 10px; cursor: pointer; }
.ops-results button:hover { background: #f0fdfa; }
.ops-item-row { display: grid; grid-template-columns: 1fr 90px auto; gap: 8px; align-items: center; }
.login-box { max-width: 380px; margin: 12vh auto; }
.login-box h1 { margin: 0 0 4px; }
.mini { font-size: 13px; color: var(--muted); }
.link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; color: inherit; text-align: left; }
.link:hover { text-decoration: underline; }
