:root { --forest:#202921; --page:#f1f1e7; --edge:#cbcebe; --olive:#515d47; --soft:#f9f9f2; color:#242b21; background:var(--page); }
body { margin:0; }
.studio-wrap { width:min(94%,92rem); margin:auto; }
.studio-mast { background:var(--forest); color:#f9f8e9; border-bottom:3px solid #d8b83b; }
.top-line,.game-title,.head-actions,.history,.world-head,.world-label,.world-foot,.game-bottom,.ref-title,.dialog-head,.dialog-actions,.action-row { display:flex; align-items:center; }
.top-line { min-height:57px; justify-content:space-between; }
.top-line .brand img { width:32px; }
.top-line .brand strong { font-size:1.65rem; }
.back-link { font-weight:600; padding:.65rem 0; }
main.studio-wrap { padding-bottom:2.5rem; }
.game-title { justify-content:space-between; gap:1rem; padding:clamp(1rem,2.7vw,2.4rem) 0 1.15rem; }
.game-title h1 { margin:0; font-size:clamp(2.65rem,4.1vw,4.5rem); line-height:.95; text-transform:none; letter-spacing:-.028em; }
.game-title p { margin-top:.47rem; color:var(--olive); font-size:1.05rem; }
.head-actions,.action-row { gap:.6rem; flex-wrap:wrap; }
.ctrl,.history button,.camera button,.brush button,.close-import { min-height:44px; cursor:pointer; font:600 1rem/1.15 Barlow, sans-serif; color:var(--forest); border:1px solid #a5ad96; background:#fff; border-radius:5px; }
.ctrl { display:inline-flex; align-items:center; justify-content:center; gap:.8rem; text-align:center; padding:.68rem 1rem; }
.ctrl.light { background:var(--soft); }
.ctrl.dark,.dialog-actions { background:var(--forest); color:#fafbee; }
.ctrl.yellow { background:var(--yellow); color:#262719; border-color:#ac932c; }
.ctrl:hover,.history button:not(:disabled):hover,.camera button:hover,.toolbox button:hover { border-color:#414c34; box-shadow:inset 0 0 0 1px #787e57; }
.ctrl.quiet { border-color:transparent; background:transparent; }
button:disabled { opacity:.45; cursor:default; }
.game-layout { display:grid; grid-template-columns:clamp(12.3rem,18.7vw,16.2rem) minmax(0,1fr); align-items:stretch; gap:1rem; }
.toolbox,.world { border:1px solid var(--edge); border-radius:12px; background:var(--soft); overflow:hidden; min-width:0; }
.box-head,.world-head { padding:.6rem .95rem; min-height:52px; border-bottom:1px solid var(--edge); }
.box-head { display:flex; align-items:center; }
.box-head h2,.world-head h2 { font:700 1.45rem/1.12 var(--display); letter-spacing:0; }
.toolbox fieldset { margin:.75rem .8rem 0; border:0; padding:0; min-width:0; }
.toolbox legend,.brush p { font:600 .79rem/1.15 Barlow,sans-serif; letter-spacing:.025em; color:var(--olive); padding:0; margin:0 0 .4rem; }
.tools-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.32rem; }
.tools-grid button { display:flex; flex-direction:column; align-items:center; justify-content:center; min-width:0; min-height:50px; border:1px solid #d7dacd; background:#f0f2e6; color:#374330; font:600 .79rem/1.15 Barlow,sans-serif; border-radius:5px; padding:.12rem .05rem .3rem; cursor:pointer; }
.tools-grid canvas { display:block; width:min(100%,46px); height:30px; }
.tools-grid button[aria-pressed=true],.brush button[aria-pressed=true] { border-color:#6d6b37; background:#fae785; box-shadow:inset 0 0 0 1px #a79743; color:#202616; }
.brush { border-top:1px solid var(--edge); margin:.9rem .8rem .75rem; padding-top:.75rem; }
.brush>div { display:flex; gap:.3rem; }
.brush button { flex:1; min-height:40px; padding:.2rem; background:var(--soft); font-size:.86rem; }
.world { display:flex; flex-direction:column; }
.world-head { justify-content:space-between; gap:.45rem; padding-block:.24rem; }
.world-label { gap:.5rem; }
.world-label i { border:2px solid #5c7051; border-radius:3px; width:13px; height:13px; transform:rotate(45deg); background:#b4c29a; }
.history { gap:.25rem; }
.history button { min-width:39px; min-height:40px; font:1.65rem/1 system-ui,sans-serif; background:none; border:1px solid transparent; }
.history .new-map { border-color:var(--edge); font:600 .9rem/1 Barlow,sans-serif; padding:.5rem .65rem; }
.map-surface { position:relative; isolation:isolate; overflow:hidden; flex:1 0 auto; min-height:clamp(22rem,45vh,39rem); background-color:#dfe7d8; background-image:radial-gradient(ellipse at 45% 55%,#edf0db55,transparent 65%),radial-gradient(#67796144 .7px,transparent .9px); background-size:auto,10px 10px; }
#peta { position:absolute; inset:0; display:block; width:100%; height:100%; touch-action:none; user-select:none; }
#peta:focus-visible { outline-offset:-3px; }
.map-scale,.camera { position:absolute; z-index:1; border:1px solid #b8c2ab; background:#fafbf2ee; border-radius:5px; }
.map-scale { top:.65rem; left:.65rem; padding:.25rem .55rem; font:600 .79rem/1.3 Barlow,sans-serif; pointer-events:none; }
.camera { right:.65rem; bottom:.65rem; display:flex; overflow:hidden; }
.camera button { border:0; border-radius:0; background:transparent; min-width:40px; font-size:1.2rem; padding:.35rem; }
.camera button+button { border-left:1px solid var(--edge); }
.camera button[data-action=fit] { font-size:.84rem; }
.world-foot { justify-content:space-between; gap:.45rem 1rem; padding:.55rem .85rem; min-height:36px; border-block:1px solid var(--edge); font-size:.88rem; flex-wrap:wrap; }
#petak-info { color:var(--olive); font-variant-numeric:tabular-nums; }
.game-stats { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); }
.game-stats>div { min-width:0; padding:.55rem .9rem .7rem; }
.game-stats>div+div { border-left:1px solid var(--edge); }
.game-stats span { display:block; font-size:.84rem; color:var(--olive); }
.game-stats strong { display:block; font:700 clamp(1.5rem,2.3vw,2.22rem)/1.1 var(--display); color:var(--forest); font-variant-numeric:tabular-nums; }
.game-stats small { font:600 .85rem Barlow,sans-serif; }
.game-bottom { justify-content:space-between; align-items:start; gap:1rem; margin-top:1.1rem; }
.game-bottom .ctrl { flex:none; }
#game-status { font-weight:600; }
.fine { color:var(--olive); font-size:.9rem; max-width:75ch; }
.new-choice { padding:1rem; margin:.8rem 0; border:1px solid var(--edge); border-radius:7px; background:var(--soft); }
.new-choice h2,.dialog-head h2,#quote-host h2 { font-size:clamp(1.8rem,3vw,2.6rem); }
.new-choice p { margin:.5rem 0 .7rem; }
dialog { padding:0; width:min(94vw,42rem); border:1px solid #9aa38f; border-radius:12px; color:var(--ink); background:var(--soft); max-height:90vh; max-height:90dvh; }
dialog::backdrop { background:#17201899; }
.dialog-head { justify-content:space-between; align-items:start; gap:1rem; padding:1.1rem 1.25rem; border-bottom:1px solid var(--edge); }
.dialog-head p { margin-top:.4rem; color:var(--olive); }
.close-import { min-width:44px; font:1.6rem/1 sans-serif; }
.import-body { padding:1rem 1.25rem; }
.file-pick { display:grid; gap:.5rem; padding:1.05rem; background:#eef0e4; border:1px dashed #84907c; border-radius:6px; }
.file-pick span,.import-fields label,.pdf-select,.ref-title { font-weight:600; }
.file-pick input { max-width:100%; padding:.35rem 0; }
.file-pick small { color:var(--olive); }
#impor-status,#ukur-pesan { margin:.65rem 0; }
.ref-title { gap:1rem; justify-content:space-between; margin-top:1rem; overflow-wrap:anywhere; }
.ref-title button { border:0; font:inherit; background:none; cursor:pointer; min-height:44px; }
.preview-area { text-align:center; background:#dee2d5; border:1px solid var(--edge); border-radius:5px; margin:.5rem 0; overflow:hidden; }
#pratinjau-acuan { vertical-align:middle; width:auto; height:auto; max-height:27vh; max-width:100%; touch-action:manipulation; }
.import-fields { display:grid; grid-template-columns:1fr 1fr; gap:.65rem 1rem; margin:.8rem 0; }
.import-fields input,.pdf-select select,#kalibrasi input { display:block; width:100%; min-width:0; min-height:44px; padding:.5rem; border:1px solid #a3ab98; border-radius:4px; background:#fff; color:var(--ink); font:inherit; }
.range-label { grid-column:1/-1; }
.range-label input { padding:0; accent-color:#556843; }
.import-check { display:flex; gap:.6rem; align-items:center; min-height:42px; }
.import-check input { width:1.1rem; height:1.1rem; flex:none; accent-color:#52613e; }
#kalibrasi { margin:.6rem 0; border-left:3px solid #aebd93; padding:.45rem .8rem; }
#terapkan-skala { margin-top:.5rem; }
.dialog-actions { justify-content:flex-end; padding:.75rem 1.25rem; }
@media(max-width:780px) {
  .studio-wrap { width:94%; } .game-title { align-items:start; }
  .game-layout { grid-template-columns:minmax(0,1fr); gap:.65rem; }
  .world { grid-row:1; } .toolbox { display:grid; grid-template-columns:1.1fr 1fr .65fr; align-items:start; padding:.65rem; gap:.55rem; }
  .box-head { display:none; } .toolbox fieldset { margin:0; } .brush { grid-column:1/-1; margin:0; display:flex; align-items:center; gap:.6rem; padding-top:.45rem; }
  .brush p { margin:0; } .brush button { min-width:49px; } .map-surface { min-height:clamp(18rem,44svh,27rem); }
  .tools-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .toolbox fieldset:nth-of-type(1) .tools-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .world-foot { align-items:start; justify-content:flex-start; } .game-bottom { flex-wrap:wrap; }
}
@media(max-width:540px) {
  .game-title { flex-wrap:wrap; gap:.7rem; } .game-title p { margin-top:.3rem; font-size:.96rem; }
  .head-actions .ctrl { padding:.55rem .8rem; }
  .toolbox { grid-template-columns:1.05fr 1fr; } .toolbox fieldset:nth-of-type(3) { grid-column:1; }
  .toolbox fieldset:nth-of-type(2) .tools-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .brush { grid-column:2; grid-row:2; flex-direction:column; align-items:stretch; border:0; gap:.35rem; padding-top:0; }
  .brush button { min-width:0; } .tools-grid button { font-size:.75rem; }
  .game-stats { grid-template-columns:repeat(4,minmax(0,1fr)); }
  .game-stats>div { padding:.45rem .35rem; } .game-stats span { font-size:.75rem; }
  .game-stats small { font-size:.72rem; } .game-stats strong { font-size:1.3rem; }
  .map-scale { font-size:.72rem; } .map-surface { min-height:clamp(17rem,40svh,22rem); }
  .brand>span { display:none; } .dialog-head,.import-body { padding:.85rem; } .import-fields { gap:.6rem; }
}
