:root {
  color-scheme: light;
  --paper: #f4f1ec; --surface: #fffefa; --ink: #282822; --muted: #5c5c51;
  --line: #d9d6cc; --accent: #295f51; --wash: #e8f1eb; --danger: #a43a33;
  background: var(--paper); color: var(--ink);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
body[data-app="elevator-rush"] { --paper:#f3efe6; --accent:#325c4b; --wash:#e4eee3; }
body[data-app="room-detective"] { --paper:#f1eae0; --accent:#713e2c; --wash:#f1e3d4; }
body[data-app="voice-bgm"] { --paper:#edf1f4; --accent:#2a4d76; --wash:#e6eef7; }
body[data-app="shorts-safe-zone"] { --paper:#eeedf4; --accent:#594389; --wash:#eee8fa; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.wrap { width: min(1060px, calc(100% - 36px)); margin-inline: auto; }
.site-head { display:flex; justify-content:space-between; align-items:center; min-height:58px; gap:12px; border-bottom:1px solid var(--line); font-size:.83rem; }
.brand { display:flex; align-items:center; gap:8px; font-weight:800; text-decoration:none; white-space:nowrap; }
.site-head > a:last-child { color:var(--muted); }
.skip { position:absolute; top:-100px; left:12px; z-index:2; background:var(--surface); padding:12px; }
.skip:focus { top:10px; }
.intro { padding:25px 0 21px; }
.intro h1 { margin:0; font-size:clamp(2rem,5vw,3.6rem); letter-spacing:-.075em; line-height:1.14; }
.intro p { margin:8px 0 0; color:var(--muted); line-height:1.6; }
.workspace { display:grid; grid-template-columns:minmax(0,1.65fr) minmax(255px,1fr); gap:14px; align-items:start; }
.panel { min-width:0; border:1px solid var(--line); background:var(--surface); border-radius:13px; padding:16px; }
.panel h2, .panel h3 { font-size:1.02rem; margin:0 0 9px; letter-spacing:-.035em; }
.group + .group { margin-top:13px; padding-top:13px; border-top:1px solid var(--line); }
.row { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.fields.three { grid-template-columns:repeat(3,minmax(0,1fr)); }
.fields > label, .field { display:grid; gap:5px; min-width:0; font-size:.78rem; font-weight:730; }
input:is([type="number"],[type="text"],[type="file"]),select { width:100%; min-width:0; min-height:40px; padding:7px; border:1px solid var(--line); border-radius:6px; background:#fff; }
input[type="file"] { font-size:.78rem; }
input[type="range"] { width:100%; accent-color:var(--accent); }
input[type="checkbox"] { accent-color:var(--accent); }
button,.action { min-height:42px; padding:8px 12px; border:1px solid var(--line); border-radius:7px; background:var(--surface); font-size:.83rem; font-weight:760; cursor:pointer; text-align:center; }
button:hover,.action:hover { border-color:var(--accent); }
button:disabled,.action[aria-disabled="true"] { opacity:.5; cursor:default; }
button.primary,.action.primary { background:var(--accent); border-color:var(--accent); color:white; }
button[aria-pressed="true"] { background:var(--wash); border-color:var(--accent); color:var(--accent); }
.action { display:inline-grid; align-items:center; text-decoration:none; }
.status { margin:9px 0 0; color:var(--muted); font-size:.8rem; line-height:1.55; }
.status[data-error] { color:var(--danger); }
.hint { color:var(--muted); font-size:.78rem; line-height:1.55; margin:7px 0; }
.section-title { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:12px; }
.section-title h2 { margin:0; }
.fig { margin:0; }
.fig figcaption { margin-top:8px; }
.guide { margin:29px 0 0; padding:20px 0 0; border-top:1px solid var(--line); }
.guide h2 { margin:0 0 9px; font-size:1.3rem; letter-spacing:-.045em; }
.guide p,.guide li { color:var(--muted); font-size:.91rem; line-height:1.68; }
.guide ol { padding-left:22px; }
details { border-bottom:1px solid var(--line); }
summary { padding:10px 0; font-weight:750; font-size:.88rem; cursor:pointer; }
.ad-zone { width:min(100%,760px); min-height:110px; margin:28px auto; text-align:center; }
.ad-zone small { display:block; margin-bottom:5px; color:var(--muted); font-size:.7rem; }
.ad-zone:has(ins[data-ad-status="unfilled"]) { display:none; }
.site-foot { margin-top:32px; border-top:1px solid var(--line); display:flex; align-items:center; justify-content:space-between; gap:12px; padding:16px 0 25px; color:var(--muted); font-size:.77rem; }
@media (max-width:730px) {
  .wrap { width:calc(100% - 22px); }
  .site-head { min-height:52px; }
  .intro { padding:18px 0 16px; }
  .intro p { font-size:.87rem; }
  .workspace { grid-template-columns:minmax(0,1fr); gap:9px; }
  .panel { padding:11px; }
}
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior:auto !important; animation-duration:.001ms !important; transition-duration:.001ms !important; } }

/* Room plan */
#plan { display:block; width:100%; height:auto; border:1px solid #e2ded1; border-radius:7px; touch-action:none; cursor:grab; }
#plan:active { cursor:grabbing; }
@media (min-width:731px) {
  body[data-app="room-fit"] .fig { position:sticky; top:12px; }
}
#preset { flex:1; width:auto; }
#items { margin-bottom:8px; }
.door-field { margin-top:8px; }
.item-fields { min-width:0; border:0; padding:0; margin:0; display:grid; gap:8px; }

/* Elevator panel */
.game-clock { font:800 1.34rem ui-monospace,monospace; color:var(--accent); font-variant-numeric:tabular-nums; }
.building { --level:46px; display:grid; grid-template-columns:58px minmax(0,1fr); gap:8px; }
.floors { display:grid; grid-auto-rows:var(--level); }
.shaft { position:relative; overflow:hidden; background:#dedbd0; border:1px solid #aaa99d; border-radius:5px; }
.shaft::before,.shaft::after { content:""; position:absolute; inset:0 auto 0 14px; border-left:1px solid #b3b0a5; }
.shaft::after { left:auto; right:14px; }
.lift-car { position:absolute; z-index:1; left:6px; right:6px; top:93.75%; transform:translateY(-50%); height:34px; display:flex; gap:2px; padding:4px; border:1px solid #394f42; border-radius:5px; background:#466652; }
.lift-car span { flex:1; background:#bed1bd; border-radius:2px; }
.floor { min-height:0; display:grid; grid-template-columns:38px 1fr 44px; align-items:center; text-align:left; padding:3px 9px; border-radius:0; border-bottom:0; }
.floor:first-child { border-radius:6px 6px 0 0; }
.floor:last-child { border-radius:0 0 6px 6px; border-bottom:1px solid var(--line); }
.floor span { font-size:.76rem; color:var(--muted); }
.floor b { text-align:right; color:var(--accent); }
.floor.here { background:var(--wash); }
.floor[aria-disabled="true"] { cursor:default; }
.floor[aria-disabled="true"]:hover { border-color:var(--line); }
.counter { flex:1; min-width:95px; padding:9px 11px; border:1px solid var(--line); border-radius:7px; }
.counter span { display:block; font-size:.72rem; color:var(--muted); }
.counter strong { display:block; margin-top:4px; font-size:1.5rem; font-variant-numeric:tabular-nums; color:var(--accent); }
.counter + .group,.panel > .row + .group { margin-top:15px; }
.route { min-height:2.2em; margin:0; color:var(--accent); font-size:.85rem; font-weight:750; overflow-wrap:anywhere; }
.result-note { background:var(--wash); border-left:3px solid var(--accent); margin:12px 0 0; padding:9px 11px; font-size:.85rem; line-height:1.55; }

/* Case room */
.scene { display:grid; grid-template-columns:1fr 1fr; gap:8px; padding:12px; border:1px solid #c5a98d; border-radius:5px; background:repeating-linear-gradient(90deg,#ead5b9 0 42px,#e7d0b2 42px 44px); }
.clue-button { display:grid; grid-template-rows:78px auto; gap:7px; align-items:end; justify-items:center; min-width:0; min-height:120px; padding:9px 6px; background:#fff8ea; border-color:#c9ad91; }
.clue-button.read { background:#f1e5d2; border-color:#916b52; }
.prop { display:block; position:relative; align-self:center; width:66px; height:51px; border-radius:4px; background:#916d4f; }
.prop::before,.prop::after { position:absolute; content:""; display:block; }
.desk .prop { height:46px; border:4px solid #79553e; background:#c49767; }
.desk .prop::before { width:35px; height:25px; left:10px; top:6px; transform:rotate(-8deg); background:repeating-linear-gradient(#fff9eb 0 5px,#dcc8a9 5px 6px); }
.desk .prop::after { width:5px; height:25px; right:9px; top:8px; background:#476b6a; transform:rotate(18deg); }
.fridge .prop { width:46px; height:70px; border:2px solid #76837b; background:#d7e2d8; }
.fridge .prop::before { width:100%; left:0; top:22px; border-top:2px solid #76837b; }
.fridge .prop::after { right:6px; top:31px; width:3px; height:15px; border-radius:1px; background:#5a6b60; }
.door .prop { width:45px; height:69px; border:4px solid #80583f; background:#b1835d; }
.door .prop::before { right:4px; top:32px; width:8px; height:6px; border-radius:5px; background:#fff2ce; }
.wall .prop { width:56px; height:59px; border:3px solid #a3735b; background:repeating-linear-gradient(#faf0df 0 9px,#e2cead 9px 10px); }
.wall .prop::before { left:17px; top:-7px; width:16px; height:8px; border-radius:3px; background:#896652; }
.clue-note { margin-top:10px; padding:11px; border-left:3px solid #a57b61; background:#faf0df; min-height:76px; }
.clue-note b { font-size:.78rem; color:#713e2c; }
.clue-note p { margin:5px 0 0; font-size:.89rem; line-height:1.48; }
.suspects { display:grid; gap:6px; }
.suspects button { text-align:left; display:grid; gap:4px; }
.suspects button span { color:var(--muted); font-weight:500; }

/* Sound and video workspaces */
.wave-track { min-width:0; margin:0 0 9px; padding:9px; border:1px solid #cdd9e5; background:#edf4fc; border-radius:6px; color:#395779; }
.wave-track.music { background:#f1ecf6; border-color:#ddd2e8; color:#66527e; }
.wave-track b { font-size:.76rem; }
.wave-track canvas { display:block; width:100%; height:auto; }
#mix-preview { width:100%; margin-top:6px; }
.panel .field + .field { margin-top:8px; }
.item-fields .field + .field { margin:0; }
.check { display:block; margin:7px 0; font-size:.83rem; }
.safe-preview { background:#dfdce8; }
.phone { position:relative; isolation:isolate; overflow:hidden; width:min(100%,294px); aspect-ratio:9/16; margin-inline:auto; border-radius:13px; background:#211f2c; color:white; box-shadow:0 0 0 1px #4a4358; }
.phone video,.phone img,.example-frame,.safe-overlay { position:absolute; inset:0; width:100%; height:100%; object-fit:contain; }
.phone[data-fit="cover"] :is(video,img) { object-fit:cover; }
.example-frame { display:grid; place-items:center; text-align:center; background:linear-gradient(156deg,#39314a 0 48%,#4d405d 48% 78%,#30283e 78%); }
.example-frame strong { font-size:1.55rem; letter-spacing:-.06em; }
.example-frame > span { position:absolute; bottom:13%; padding:4px 6px; background:#211f2c; font-size:.75rem; }
.safe-overlay { pointer-events:none; }
.safe-overlay::before { content:""; position:absolute; inset:var(--safe-top) auto var(--safe-bottom) 0; width:var(--safe-left); background:#3020438c; }
.overlay-top,.overlay-actions,.overlay-bottom { position:absolute; background:#3020438c; font-size:.66rem; }
.overlay-top { inset:0 0 auto; height:var(--safe-top); padding:9px; }
.overlay-actions { inset:var(--safe-top) 0 var(--safe-bottom) auto; width:var(--safe-right); display:flex; align-items:center; justify-content:flex-end; flex-direction:column; gap:9px; padding-bottom:6px; }
.overlay-actions i { display:grid; place-items:center; border-radius:50%; width:24px; height:24px; background:#282431; font-size:.96rem; font-style:normal; }
.overlay-bottom { inset:auto 0 0; height:var(--safe-bottom); padding:10px; display:flex; flex-direction:column; gap:6px; }
.safe-border { position:absolute; inset:var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left); border:1px dashed #ddd0ff; }
.safe-border span { position:absolute; top:0; left:0; background:#493469; padding:3px 5px; font-size:.65rem; }
.safe-play { justify-content:center; margin-top:12px; }
.safe-play input { width:min(50%,230px); }
.safe-play output { font-size:.77rem; font-variant-numeric:tabular-nums; }
@media (max-width:400px) {
  .building { --level:41px; grid-template-columns:45px minmax(0,1fr); }
  .clue-button { min-height:105px; grid-template-rows:66px auto; }
}
