@charset "UTF-8";

:root {
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  color: #374839;
  background: #eeece2;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --ink: #374839;
  --muted: #777d69;
  --paper: #f9f6eccc;
  --line: #66705526;
  --accent: #ad652e;
  --green: #3f5c46;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; }
body { -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
img, a { -webkit-user-drag: none; }
input, textarea, [contenteditable="true"] { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; touch-action: manipulation; }
button, input { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible { outline: 3px solid #658d81; outline-offset: 4px; }
button:disabled { opacity: .4; cursor: default; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
[hidden] { display: none !important; }
.icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
.playground { position: relative; width: 100%; height: 100%; height: 100dvh; isolation: isolate; overflow: hidden; }
#scene { position: absolute; inset: 0; touch-action: none; }
#scene canvas { display: block; width: 100%; height: 100%; touch-action: none; outline: none; }
#scene canvas.rotation-mode { cursor: grab; }
#scene canvas.rotating { cursor: grabbing; }
#scene canvas:focus-visible { outline: 3px solid #658d81; outline-offset: -4px; }
.scene-vignette { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 44%, transparent 47%, #e9e7da35 100%); pointer-events: none; }
.hud { position: absolute; z-index: 2; pointer-events: none; }
.hud button, .hud input, .hud label { pointer-events: auto; }

.field-header { top: 36px; left: 40px; }
h1 { margin: 15px 0 7px; font-family: "Iowan Old Style", "AppleMyungjo", "Nanum Myeongjo", "Batang", Georgia, serif; font-size: 34px; letter-spacing: -.075em; line-height: 1.2; font-weight: 700; }
.title-comma { color: #ab693a; margin-right: 4px; }
.title-period { color: #ab693a; }

.top-actions { top: 31px; right: 32px; display: flex; align-items: center; gap: 3px; z-index: 5; }
.utility-button { position: relative; display: flex; align-items: center; justify-content: center; gap: 7px; height: 40px; border: 1px solid transparent; border-radius: 50%; background: transparent; transition: background .15s, transform .15s; }
.utility-button:hover { background: #fffaf07d; }
.utility-button:active { transform: translateY(1px); }
.utility-button svg { width: 19px; height: 19px; stroke-width: 1.6; }
.utility-button.icon-only { width: 40px; }
.weather-picker summary { display: flex; align-items: center; gap: 7px; height: 40px; padding: 0 12px; border: 1px solid #a6b8a25c; border-radius: 24px; background: #f5f6eccc; font-size: 11px; cursor: pointer; list-style: none; pointer-events: auto; }
.weather-picker summary::-webkit-details-marker { display: none; }
.weather-picker summary:focus-visible { outline: 2px solid #658d81; outline-offset: 3px; }
.weather-picker summary > svg { width: 20px; height: 20px; }
.weather-picker summary .weather-chevron { width: 12px; height: 12px; transition: transform .15s; }
.weather-picker[open] .weather-chevron { transform: rotate(180deg); }
body[data-weather="storm"] .weather-picker summary { color: #425769; background: #e0e7e8; border-color: #9fadb7; }
body[data-weather="rain"] .weather-picker summary { color: #315b60; background: #e1eeea; border-color: #91a7a0; }
body[data-weather="heat"] .weather-picker summary { color: #8a5b21; background: #f3dfb3; border-color: #d9b96f; }
.weather-menu { position: absolute; top: calc(100% + 10px); right: 0; width: min(326px, calc(100vw - 28px)); padding: 15px; border: 1px solid #8d98714a; border-radius: 16px; background: #faf8ef; box-shadow: 0 12px 35px #43543d24; pointer-events: auto; }
.weather-menu-title { margin: 0 0 12px; color: #747b66; font-size: 10px; }
.weather-options { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; }
.weather-options button { display: flex; align-items: center; gap: 9px; min-height: 65px; padding: 10px; text-align: left; border: 1px solid #a4ae9138; border-radius: 10px; background: #f1f0e5; }
.weather-options button > svg { width: 26px; height: 26px; flex-shrink: 0; }
.weather-options button strong { display: block; font-size: 12px; font-weight: 650; }
.weather-options button small { display: block; margin-top: 5px; font-size: 9px; line-height: 1.4; color: #737b68; }
.weather-options button[aria-pressed="true"] { background: #e7eedd; border-color: #8caa78; box-shadow: inset 0 0 0 1px #8caa7840; }
.weather-options #rain-toggle[aria-pressed="true"] { background: #dfede8; border-color: #91a7a0; }
.weather-options #storm-toggle[aria-pressed="true"] { background: #dfe6e9; border-color: #8298a7; }
.weather-options #heat-toggle[aria-pressed="true"] { background: #f3dfb3; border-color: #d9b96f; }
.weather-menu-note { margin: 12px 0 0; font-size: 9px; line-height: 1.5; color: #848872; }
.action-divider { width: 1px; height: 16px; margin: 0 9px; background: #6f786128; }

.discovery-note { top: 119px; right: 41px; width: 213px; transform: rotate(1deg); padding: 22px 20px 16px; border: 1px solid #66705517; border-radius: 2px 2px 12px 2px; background: linear-gradient(110deg, #faf7ecce, #f7f2e4b8); box-shadow: 2px 6px 18px #5f5a3a06, inset 0 1px #ffffffe0; }
.discovery-note::before { content: ""; position: absolute; top: -8px; left: 75px; width: 61px; height: 16px; background: #dad7b561; rotate: -5deg; clip-path: polygon(2% 0, 100% 5%, 97% 100%, 0 91%); }
.note-eyebrow { font-size: 8px; letter-spacing: .035em; color: #92907a; }
.discovery-note h2 { display: flex; align-items: center; justify-content: space-between; font-family: "AppleMyungjo", "Nanum Myeongjo", "Batang", Georgia, serif; font-size: 19px; font-weight: 700; margin: 8px 0 18px; letter-spacing: -.07em; }
.note-spark { width: 20px; height: 20px; stroke-width: 1.3; color: #ae743f; transform: rotate(12deg); }
.discovery-list { list-style: none; padding: 0; margin: 0; }
.discovery-list li { display: flex; align-items: center; gap: 9px; margin-top: 12px; font-size: 11px; color: #737963; transition: color .3s; }
.goal-check { position: relative; width: 13px; height: 13px; border: 1px solid #a6a68c99; border-radius: 50%; flex: 0 0 auto; }
.done { color: #3f6448 !important; }
.done .goal-check { border-color: #5e7752; background: #5e7752; }
.done .goal-check::after { content: ""; position: absolute; top: 2px; left: 3px; width: 4px; height: 6px; border-right: 1.5px solid #fffdf4; border-bottom: 1.5px solid #fffdf4; transform: rotate(40deg); }
.note-bottom { margin-top: 21px; padding-top: 12px; border-top: 1px dashed #8c8c6433; display: flex; align-items: center; justify-content: space-between; font-size: 9px; color: #858571; }
.coin-total { display: flex; align-items: center; gap: 5px; color: #a8782f; font-size: 12px; }
.coin-total svg { width: 16px; height: 16px; stroke-width: 1.3; }
.coin-total b { min-width: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.coin-pickup { position: fixed; z-index: 20; width: 22px; height: 22px; display: grid; place-items: center; pointer-events: none; border-radius: 50%; border: 2px solid #c6933e; outline: 2px solid #fff4c766; background: #f8d67a; color: #ab7530; box-shadow: 0 3px 10px #bd8f3d44, inset 0 0 0 2px #ffe7a3; font-size: 12px; will-change: transform, opacity; }

.side-actions { left: 38px; bottom: 206px; display: flex; flex-direction: column; gap: 9px; }
.side-button { display: flex; align-items: center; gap: 9px; padding: 10px 13px; border: 1px solid #77816024; border-radius: 9px; font-size: 10px; background: #faf7ecb8; width: fit-content; transition: background .15s; box-shadow: 0 2px 3px #44421e02; }
.side-button svg { width: 17px; height: 17px; stroke-width: 1.6; }
.side-button:hover { background: #fffdf4; }
.side-button[aria-pressed="true"] { background: #e5dbc1; border-color: #c5b386; }

.tool-dock { bottom: max(18px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: min(814px, calc(100% - 80px)); }
.material-options { grid-column: 3; grid-row: 1; justify-self: start; display: inline-flex; align-items: center; gap: 3px; padding: 3px; border: 1px solid #b7a57a4d; border-radius: 11px; background: #f1eddfed; pointer-events: auto; }
.material-options button { display: flex; align-items: center; justify-content: center; gap: 5px; min-width: 48px; min-height: 31px; padding: 3px 9px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #8b8771; font-size: 11px; white-space: nowrap; }
.material-options button svg { width: 17px; height: 17px; stroke-width: 1.6; }
.material-options button:hover:not(:disabled) { background: #fffaf1a6; }
.material-options button[aria-pressed="true"] { color: #8a602b; border-color: #c9a86a70; background: #fff7e8; box-shadow: 0 1px 4px #7e663114; font-weight: 650; }
.material-options button[data-material="water"][aria-pressed="true"] { color: #356f68; border-color: #81aaa180; background: #eff8f0; }
.water-options { grid-column: 2; display: flex; gap: 4px; width: fit-content; padding: 3px; background: #e7eadfd9; border: 1px solid #9dab8b33; border-radius: 10px; pointer-events: auto; }
.water-options button { display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 30px; padding: 3px 13px; border: 1px solid transparent; border-radius: 7px; font-size: 10px; color: #6c7a67; background: transparent; white-space: nowrap; }
.water-options button[aria-pressed="true"] { color: #325f50; border-color: #91b19e66; background: #fcfcf4; box-shadow: 0 1px 4px #4d634717; font-weight: 650; }
.water-options button:hover { background: #fbfcf177; }
.water-options button svg { width: 17px; height: 17px; }
.ant-options { grid-column: 2; display: flex; align-items: center; gap: 9px; color: #727d63; font-size: 10px; }
#ant-status { min-width: 0; line-height: 1.5; }
#ant-clear { flex-shrink: 0; min-height: 30px; min-width: 42px; padding: 4px 8px; border: 1px solid #a4ae9155; border-radius: 8px; background: #f8f7ed; font-size: 10px; }
#ant-clear:hover { background: #e9eddf; }
.toolbox { background: #fbf8efe8; border: 1px solid #fefcf4; border-radius: 22px; padding: 9px 11px 0; box-shadow: 0 8px 28px #4b4c3510, 0 1px 3px #4b4c3510, inset 0 0 0 1px #7770440c; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); pointer-events: auto; }
.tools-scroll { display: flex; gap: 5px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; scroll-behavior: smooth; }
.tools-scroll::-webkit-scrollbar { display: none; }
.tool-button { position: relative; display: flex; flex: 1 0 0; min-width: 74px; flex-direction: column; align-items: center; justify-content: center; gap: 5px; height: 87px; border: 1px solid transparent; border-radius: 13px; background: transparent; color: #75806a; transition: color .15s, background .15s, border-color .15s, transform .15s; }
.tool-button svg { width: 42px; height: 42px; stroke-width: 1.55; transition: transform .18s; }
.tool-button > span { font-size: 10px; font-weight: 500; letter-spacing: -.035em; white-space: nowrap; }
.tool-button > kbd { position: absolute; top: 7px; left: 9px; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 8px; font-weight: 400; color: #999d89; }
.tool-button:hover { background: #eae9d955; color: #475b42; }
.tool-button:hover svg { transform: translateY(-2px) rotate(-4deg); }
.tool-button:active { transform: translateY(1px); }
.tool-button[aria-pressed="true"] { background: #ead6b2; border-color: #d7bb8c; color: #855b28; box-shadow: inset 0 1px #ffffff70, 0 2px 3px #ab824713; }
.tool-button[aria-pressed="true"] > span { font-weight: 650; }
.tool-button[aria-pressed="true"] > kbd { color: #af8b56; }
.tool-button[aria-pressed="true"]::after { content: ""; position: absolute; bottom: -5px; left: 50%; width: 4px; height: 4px; transform: translateX(-50%); background: #aa7d40; border-radius: 50%; display: none; }
.tool-navigation { display: flex; flex-shrink: 0; gap: 4px; }
.tool-navigation button { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 1px solid #a4ae914d; border-radius: 8px; background: #f4f1e6; color: #667858; }
.tool-navigation button:hover:not(:disabled) { background: #e5ead9; }
.tool-navigation button:disabled { opacity: .3; }
.tool-navigation svg { width: 17px; height: 17px; }

.toast { position: fixed; z-index: 24; top: var(--toast-top,76px); right: var(--toast-right,24px); transform: translateY(-4px); max-width: min(320px, calc(100vw - var(--toast-right,24px) - 16px)); padding: 10px 14px; border-radius: 12px; background: #3f523eea; color: #fffdf0; box-shadow: 0 5px 18px #263a2220; font-size: 12px; line-height: 1.6; text-align: left; overflow-wrap: anywhere; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; }
.toast.show, .toast.visible, .toast.is-visible { opacity: 1; transform: translateY(0); }
.toast:empty { display: none; }
.toast .toast-timer { position: absolute; inset: auto 12px 0; width: calc(100% - 24px); height: 2px; fill: none; pointer-events: none; }
.toast-timer line { stroke: #ffe58acc; stroke-width: 2; stroke-dasharray: 100; stroke-dashoffset: 0; stroke-linecap: butt; }

.flag-panel { top: 245px; left: 40px; transform: none; width: 240px; max-width: calc(100% - 32px); padding: 20px 18px 17px; background: #fff9ecee; border: 1px solid #c3b58d75; border-radius: 4px 4px 19px 4px; box-shadow: 0 8px 30px #5d53231a; backdrop-filter: blur(12px); }
.flag-label { display: flex; gap: 6px; align-items: center; color: #a1753d; font-size: 10px; }
.flag-label svg { width: 16px; height: 16px; }
.flag-panel h2 { margin: 12px 0 9px; font-family: "AppleMyungjo", "Batang", Georgia, serif; font-size: 18px; letter-spacing: -.06em; }
.flag-panel > p { font-size: 11px; color: #82816a; line-height: 1.8; margin: 0; }
.flag-turn-line { margin-top: 18px; padding-top: 16px; border-top: 1px dashed #aaa07e55; display: flex; flex-direction: column; gap: 5px; }
.flag-turn-line strong { font-size: 12px; }
.flag-turn-line span { font-size: 10px; color: #99947a; }
.flag-panel-actions { display: flex; gap: 10px; margin-top: 15px; }
.primary-button, .secondary-button { border: 1px solid #3f5c46; border-radius: 8px; min-height: 41px; padding: 10px 17px; font-size: 11px; font-weight: 600; background: #3f5c46; color: #fffcef; transition: background .15s; }
.primary-button:hover { background: #2f4b36; }
.secondary-button { background: #f7f4e7; color: #5c6b50; border-color: #c7c9b5; }
.secondary-button:hover { background: #ecebdc; }
.text-button { border: 0; background: transparent; color: #8c896f; font-size: 11px; padding: 9px 7px; }

.paper-dialog { color: var(--ink); width: min(490px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); margin: auto; padding: 37px 37px 28px; border: 1px solid #fffdf7; border-radius: 7px 7px 24px 7px; background: #faf7ec; box-shadow: 0 20px 100px #1a291b40; overflow-y: auto; }
.paper-dialog::backdrop { background: #33402c53; backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.dialog-close { position: absolute; top: 13px; right: 13px; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: none; color: #7f846c; }
.dialog-close:hover { background: #ebebdc; }
.dialog-close svg { width: 18px; height: 18px; }
.dialog-eyebrow { font-size: 10px; letter-spacing: .04em; color: #ac8454; }
.paper-dialog h2 { margin: 13px 0 15px; font-family: "AppleMyungjo", "Batang", Georgia, serif; font-size: 26px; letter-spacing: -.07em; line-height: 1.4; }
.dialog-intro { font-size: 12px; line-height: 1.95; color: #797e69; margin: 0 0 25px; }
.help-sharing { margin: 0 0 24px; padding: 16px; border: 1px solid #cbd3bc; border-radius: 12px; background: #eef1e4; }
.help-sharing h3 { margin: 0 0 10px; font-size: 13px; color: #425b43; }
.help-sharing p { margin: 9px 0 0; font-size: 12px; line-height: 1.85; color: #596650; }
.help-sharing strong { font-weight: 650; color: #3d563e; }
.help-sharing .help-sharing-note { padding-top: 9px; border-top: 1px solid #cbd3bc; font-size: 11px; }
.help-steps { border-top: 1px solid #a3a48a35; padding: 21px 0 0; }
.help-steps > div { display: flex; gap: 16px; margin-bottom: 18px; }
.help-steps > div > span { font: italic 18px/1.5 Georgia, serif; color: #bca077; }
.help-steps p { margin: 0; font-size: 11px; color: #82836e; line-height: 1.9; }
.help-steps strong { display: block; font-size: 12px; font-weight: 650; color: #58664d; margin-bottom: 2px; }
.help-shortcuts { display: flex; gap: 13px; flex-wrap: wrap; padding: 14px 0; border-top: 1px dashed #a5a28545; font-size: 10px; color: #7d846c; }
.help-shortcuts kbd { font: 9px ui-monospace, "SFMono-Regular", Consolas, monospace; padding: 3px 5px; border: 1px solid #b7b7a280; border-radius: 4px; background: #fffffa5e; }
.keyboard-help { font-size: 10px; line-height: 1.8; color: #82836e; margin: 0 0 14px; }
.keyboard-help kbd { font: 9px ui-monospace, "SFMono-Regular", Consolas, monospace; }
.dialog-smallprint { font-size: 10px; line-height: 1.8; color: #92907a; margin: 8px 0 0; }
.reset-dialog { width: min(455px, calc(100vw - 32px)); }
.reset-dialog h2 { font-size: 24px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }

.loading-screen { position: absolute; z-index: 10; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; background: #eeece2; color: #4d5d43; transition: opacity .6s; }
.loading-mark { display: flex; align-items: center; justify-content: center; width: 74px; height: 74px; margin-bottom: 18px; border: 1px solid #9e9e7135; border-radius: 50%; background: #f7f3e580; }
.loading-mark svg { width: 40px; height: 40px; stroke-width: 1.3; color: #9a7545; }
.loading-screen strong { font-family: "AppleMyungjo", "Batang", Georgia, serif; font-size: 22px; letter-spacing: -.055em; }
.loading-screen > span { margin-top: 12px; font-size: 11px; letter-spacing: .03em; color: #98947a; }
.loading-line { width: 88px; height: 2px; overflow: hidden; margin-top: 31px; background: #c9c9ae50; }
.loading-line::after { content: ""; display: block; width: 40%; height: 100%; background: #9d9872; animation: waiting 1.6s ease-in-out infinite alternate; }
@keyframes waiting { from { transform: translateX(-70%); } to { transform: translateX(220%); } }

@media (min-width: 1600px) {
  .field-header { top: 45px; left: 52px; }
  .top-actions { top: 41px; right: 43px; }
  .discovery-note { top: 140px; right: 52px; }
  .side-actions { left: 50px; }
  .tool-dock { bottom: 26px; }
}

@media (max-width: 1100px) {
  .field-header { top: 25px; left: 25px; }
  h1 { font-size: 30px; }
  .top-actions { top: 19px; right: 19px; }
  .discovery-note { right: 26px; top: 96px; width: 182px; padding: 18px 16px 14px; }
  .discovery-note::before { left: 58px; }
  .note-eyebrow { font-size: 7px; }
  .discovery-note h2 { font-size: 17px; }
  .discovery-list li { font-size: 10px; gap: 7px; }
  .tool-dock { width: min(770px, calc(100% - 42px)); }
  .side-actions { left: 25px; }
}

@media (max-width: 760px) {
  .field-header { top: max(20px, env(safe-area-inset-top)); left: 21px; }
  h1 { font-size: 27px; margin: 24px 0 4px; letter-spacing: -.075em; }
  .discovery-note { top: 132px; right: 17px; width: auto; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; transform: none; }
  .discovery-note::before, .discovery-note .note-eyebrow, .discovery-note h2, .discovery-list, .note-bottom > span:first-child { display: none; }
  .note-bottom { margin: 0; padding: 6px 10px; border: 1px solid #7781601a; border-radius: 20px; background: #f7f5e99e; }
  .coin-total { gap: 4px; font-size: 10px; }
  .coin-total svg { width: 14px; height: 14px; }
  .top-actions { top: max(13px, env(safe-area-inset-top)); right: 14px; gap: 0; }
  .utility-button.icon-only { width: 34px; height: 34px; }
  .utility-button svg { width: 17px; height: 17px; }
  .weather-picker summary { height: 36px; padding: 0 8px; gap: 5px; font-size: 10px; }
  .weather-picker summary > svg { width: 18px; height: 18px; }
  .weather-menu { padding: 12px; }
  .action-divider { margin: 0 4px; height: 14px; }
  .side-actions { left: auto; right: 17px; top: 90px; bottom: auto; flex-direction: row; gap: 7px; }
  .side-button { border-radius: 50%; width: 33px; height: 33px; padding: 8px; background: #f7f5e99e; }
  .side-button span { display: none; }
  #rotate-toggle { width: auto; padding: 8px 10px; border-radius: 18px; }
  #rotate-toggle span { display: inline; font-size: 10px; white-space: nowrap; }
  .side-button svg { width: 16px; height: 16px; }
  .tool-dock { width: calc(100% - 24px); bottom: max(11px, env(safe-area-inset-bottom)); }
  .material-options { gap: 2px; padding: 3px; }
  .material-options button { min-width: 46px; min-height: 32px; padding: 3px 7px; gap: 4px; }
  .water-options button { min-height: 32px; padding: 3px 9px; font-size: 10px; }
  .ant-options { gap: 4px; font-size: 9px; }
  #ant-clear { padding: 3px 6px; min-width: 36px; min-height: 32px; font-size: 9px; }
  .toolbox { border-radius: 18px; padding: 7px 7px 0; box-shadow: 0 4px 20px #4b4c3514; }
  .tools-scroll { gap: 4px; scroll-padding: 5px; }
  .tool-button { height: 76px; min-width: 65px; flex: 1 0 65px; gap: 4px; border-radius: 11px; }
  .tool-button svg { width: 36px; height: 36px; }
  .tool-button > span { font-size: 9px; }
  .tool-button > kbd { display: none; }
  .toast { font-size: 11px; }
  .flag-panel { top: 115px; left: 17px; right: auto; width: min(290px, calc(100% - 100px)); padding: 11px 13px; border-radius: 4px 4px 14px 4px; }
  .flag-panel h2, .flag-panel .flag-label { display: none; }
  .flag-panel > p { font-size: 10px; line-height: 1.55; }
  .flag-turn-line { margin-top: 7px; padding-top: 0; border-top: 0; }
  .flag-turn-line strong { font-size: 10px; }
  .flag-turn-line span { display: none; }
  .flag-panel-actions { margin-top: 8px; gap: 8px; }
  .flag-panel-actions .primary-button { min-height: 32px; padding: 7px 11px; font-size: 10px; }
  .flag-panel-actions .text-button { padding: 7px 5px; font-size: 10px; }
  .paper-dialog { padding: 32px 24px 24px; }
  .paper-dialog h2 { font-size: 23px; }
  .dialog-intro { font-size: 11px; }
  .help-steps > div { gap: 13px; }
  .help-shortcuts { gap: 10px; font-size: 9px; }
  .help-shortcuts > span:not(:last-child) { display: none; }
  .keyboard-help { display: none; }
}

@media (max-width: 390px) {
  .field-header { left: 17px; }
  h1 { font-size: 25px; }
  .top-actions { right: 10px; }
  .utility-button.icon-only { width: 30px; }
  .action-divider { margin: 0 2px; }
  .tool-dock { width: calc(100% - 18px); }
  .tool-button { min-width: 61px; flex-basis: 61px; }
}

@media (max-height: 540px) and (orientation: landscape) {
  .field-header { top: max(13px, env(safe-area-inset-top)); left: max(20px, env(safe-area-inset-left)); }
  .discovery-note { display: none; }
  h1 { font-size: 22px; margin: 7px 0 0; }
  .top-actions { top: 12px; right: max(15px, env(safe-area-inset-right)); }
  .utility-button.icon-only { width: 31px; height: 31px; }
  .weather-picker summary { height: 33px; }
  .utility-button svg { width: 16px; height: 16px; }
  .side-actions { top: auto; left: 18px; right: auto; bottom: 128px; flex-direction: row; gap: 7px; }
  .side-button { width: 32px; height: 32px; border-radius: 50%; padding: 7px; }
  .side-button span { display: none; }
  .side-button svg { width: 16px; height: 16px; }
  .tool-dock { width: min(665px, calc(100% - 34px)); bottom: max(6px, env(safe-area-inset-bottom)); }
  .material-options { padding: 2px; gap: 2px; border-radius: 9px; }
  .material-options button { min-width: 39px; min-height: 28px; padding: 2px 6px; gap: 3px; font-size: 10px; border-radius: 6px; }
  .material-options button svg { width: 14px; height: 14px; }
  .playground:has(.material-context) .side-actions { bottom: 172px; }
  .ant-options { gap: 6px; font-size: 9px; }
  #ant-status { white-space: nowrap; }
  #ant-clear { min-height: 28px; padding: 3px 7px; font-size: 9px; }
  .playground:has(.ant-options:not([hidden])) .side-actions { bottom: 172px; }
  .water-options { padding: 2px; }
  .water-options button { min-height: 28px; padding: 2px 10px; }
  .toolbox { border-radius: 15px; padding: 5px 7px 0; }
  .tools-scroll { gap: 4px; }
  .tool-button { height: 56px; min-width: 58px; flex: 1 0 58px; gap: 1px; border-radius: 9px; }
  .tool-button svg { width: 29px; height: 29px; }
  .tool-button > span { font-size: 8px; }
  .tool-button > kbd { display: none; }
  .toast { font-size: 11px; padding: 8px 12px; }
  .flag-panel { top: 75px; left: max(16px, env(safe-area-inset-left)); right: auto; transform: none; width: 190px; padding: 10px 12px; border-radius: 4px 4px 12px 4px; }
  .flag-panel .flag-label, .flag-panel h2 { display: none; }
  .flag-panel > p { font-size: 9px; line-height: 1.55; }
  .flag-turn-line { margin-top: 7px; padding-top: 0; border-top: 0; gap: 4px; }
  .flag-turn-line strong { font-size: 10px; }
  .flag-turn-line span { display: none; }
  .flag-panel-actions { margin-top: 7px; gap: 6px; }
  .flag-panel-actions .primary-button { min-height: 31px; font-size: 9px; padding: 7px 12px; }
  .flag-panel-actions .text-button { font-size: 9px; padding: 7px 4px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* The intro owns input temporarily; the game HUD returns on the same frame. */
.school-intro{position:fixed;inset:0;z-index:90;pointer-events:none;background:linear-gradient(180deg,rgba(242,247,229,.12),transparent 35%,transparent 72%,rgba(224,233,195,.08));color:#344e46;}
.school-intro[hidden]{display:none;}
.intro-story{position:absolute;left:max(28px,6vw);top:max(28px,7vh);}
.intro-story>span{font-size:11px;letter-spacing:.18em;}
.intro-story h2{font-family:var(--font-serif,serif);font-weight:400;font-size:clamp(25px,3.1vw,44px);line-height:1.4;margin:14px 0;}
.intro-story p{font-size:12px;}
.intro-actions{position:absolute;bottom:max(24px,env(safe-area-inset-bottom));right:6vw;display:flex;align-items:center;gap:22px;pointer-events:auto;}
.intro-actions label{font-size:12px;display:flex;align-items:center;gap:7px;}
.intro-actions input,.intro-settings input{accent-color:#536e59;width:17px;height:17px;}
.intro-actions button{border:1px solid #647862;background:#f7f5e8;border-radius:30px;padding:15px 24px;font:inherit;font-size:13px;color:#3c5541;cursor:pointer;}
.intro-playing .playground>.hud,.intro-playing .playground>.tool-dock,.intro-playing #toast,.intro-playing #publication-badge{visibility:hidden;}
.intro-settings{margin:0 0 24px;padding:16px;border:1px solid #d8ceba;border-radius:12px;background:#f2eddf;}
.intro-settings h3{font-size:13px;margin:0 0 8px;}.intro-settings p,.intro-settings label{font-size:12px;line-height:1.8;}.intro-settings label{display:flex;align-items:center;gap:7px;}.intro-settings button{display:block;margin:12px 0;padding:9px 12px;background:#fffcf2;border:1px solid #bebda6;border-radius:8px;color:#4e624c;font:inherit;font-size:12px;cursor:pointer;}.intro-settings small{display:block;font-size:11px;line-height:1.8;color:#777563;}
@media(max-width:700px){.intro-story{top:7vh;left:24px}.intro-actions{left:24px;right:24px;justify-content:space-between;gap:10px}.intro-actions label{font-size:11px}.intro-actions button{padding:13px 18px;white-space:nowrap}}

/* Keep the subject and controls sharp; soften distant edges and near flowers. */
.school-intro::before,.school-intro::after{content:"";position:absolute;inset:0;pointer-events:none;opacity:var(--intro-softness,1);}
.school-intro::before{backdrop-filter:blur(3px);-webkit-backdrop-filter:blur(3px);mask-image:radial-gradient(ellipse 52% 49% at 50% 47%,transparent 48%,#000 100%);-webkit-mask-image:radial-gradient(ellipse 52% 49% at 50% 47%,transparent 48%,#000 100%);}
.school-intro::after{backdrop-filter:blur(7px);-webkit-backdrop-filter:blur(7px);mask-image:linear-gradient(transparent 63%,#000 100%);-webkit-mask-image:linear-gradient(transparent 63%,#000 100%);}
.intro-story,.intro-actions{z-index:1;text-shadow:0 1px 12px rgba(245,250,228,.9);}
.intro-story{max-width:min(520px,calc(100vw - 48px));}.intro-story h2{word-break:keep-all;}
.intro-actions label{padding:9px 11px;background:rgba(245,247,222,.78);border-radius:18px;}

/* The wooden community boards receive taps before terrain tools. */
#scene canvas.over-community-board{cursor:pointer}

#bridge-options { display:flex; align-items:center; gap:6px; width:max-content; padding:4px 6px; border:1px solid #d5cbae; border-radius:14px; background:#fbf8eefa; color:#655c3e; font-size:12px; }
#bridge-options[hidden] { display:none; }
#bridge-options button { width:44px; height:44px; border:1px solid #d0c6a9; border-radius:10px; background:#fffaf0; color:inherit; font-size:26px; touch-action:manipulation; }
#bridge-options svg { width:26px; height:26px; }
#bridge-angle { min-width:31px; text-align:center; font-variant-numeric:tabular-nums; }
.pocket-bridge { color:#81673d; }
.pocket-bridge > svg { width:44px; height:44px; flex-shrink:0; }
