:root { color-scheme: light; font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Kaku Gothic ProN', sans-serif; color: #28433b; background: #d7e4d8; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid #245d49; outline-offset: 5px; }
.field { position: relative; width: 100%; max-width: 600px; height: 100vh; height: 100dvh; margin: auto; overflow: hidden; background: #a7bd88; isolation: isolate; touch-action: none; user-select: none; -webkit-user-select: none; }
#town { display: block; width: 100%; height: 100%; touch-action: none; }
.field-header { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 18px); left: max(20px, env(safe-area-inset-left, 0px)); right: max(20px, env(safe-area-inset-right, 0px)); display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; pointer-events: none; }
.place { padding: 12px 17px; border: 1px solid #ffffffa3; border-radius: 18px; background: #fffdf2ed; box-shadow: 0 4px 20px #28433b12; }
.place h1 { font-size: 18px; letter-spacing: .04em; margin: 0; }
.place p { margin: 5px 0 0; font-size: 14px; color: #54705e; }
.field-header.has-delivery { left: max(12px, env(safe-area-inset-left, 0px)); right: max(12px, env(safe-area-inset-right, 0px)); gap: 8px; }
.field-header.has-delivery .place { flex: 0 0 auto; max-width: 48%; padding: 10px 12px; }
.field-header.has-delivery .place h1 { font-size: 16px; letter-spacing: 0; white-space: nowrap; }
.field-header.has-delivery #wallet { overflow-wrap: anywhere; }
.delivery-header { flex: 1 1 0; min-width: 0; max-width: 280px; }
.field-header { padding-right: 52px; }
.menu-toggle { display: grid; place-items: center; }
.menu-icon { display: block; width: 20px; height: 16px; background: linear-gradient(to bottom, currentColor 0 2px, transparent 2px 7px, currentColor 7px 9px, transparent 9px 14px, currentColor 14px 16px); }
.reject-offer { padding: 0; }
.reject-icon { position: relative; display: block; width: 18px; height: 18px; }
.reject-icon::before, .reject-icon::after { content: ''; position: absolute; left: 0; top: 8px; width: 18px; height: 2px; background: currentColor; border-radius: 1px; transform: rotate(45deg); }
.reject-icon::after { transform: rotate(-45deg); }
.field-header.has-delivery .place { flex: 0 0 132px; max-width: 132px; }
.menu-toggle { position: absolute; right: 0; top: 0; width: 44px; height: 44px; padding: 0; border: 1px solid #ffffffa3; border-radius: 12px; background: #fffdf2ed; color: #28433b; font-size: 24px; pointer-events: auto; touch-action: manipulation; }
.field-header:has(.field-menu:not([hidden])) { z-index: 5; }
.field-menu { position: absolute; top: calc(100% + 8px); right: 0; width: 220px; max-width: 100%; padding: 14px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid #599bb6; border-radius: 14px; background: #24364e; color: #f4f8ff; box-shadow: 0 6px 20px #0d1c354d; font-size: 16px; pointer-events: auto; }
.reception-toggle { display: flex; align-items: center; gap: 7px; min-height: 44px; min-width: 86px; padding: 6px 10px; border: 1px solid #9cf1fa; border-radius: 24px; background: #7ce4f2; color: #122b41; font-size: 14px; font-weight: 700; touch-action: manipulation; }
.switch-knob { width: 22px; height: 22px; border-radius: 50%; background: #fff; order: 1; }
.reception-toggle[aria-checked="false"] { background: #43536a; color: #fff; border-color: #91a8c2; }
.reception-toggle[aria-checked="false"] .switch-knob { order: 0; }
.reception-paused { position: absolute; top: calc(100% + 5px); right: 0; padding: 3px 7px; border-radius: 6px; background: #fffdf2ed; color: #54705e; font-size: 12px; line-height: 1.4; }
.field-header:has(.field-menu:not([hidden])) .reception-paused { visibility: hidden; }
.delivery-header .delivery-panel.active { padding: 10px 12px; border-radius: 16px; }
.delivery-header .delivery-heading { font-size: 12px; line-height: 1.4; }
.delivery-header .delivery-guide { font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.walk-hint { position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 172px); transform: translateX(-50%); margin: 0; padding: 10px 14px; max-width: calc(100% - 36px); width: max-content; border-radius: 14px; background: #fffdf2ed; color: #365b48; font-size: 14px; line-height: 1.5; pointer-events: none; transition: opacity .6s; }
.walk-hint.quiet { opacity: 0; }
.npc-dialogue { position: absolute; z-index: 4; left: max(16px, env(safe-area-inset-left, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(env(safe-area-inset-bottom, 0px) + 156px); max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 180px); overflow-y: auto; padding: 12px 16px 14px; border: 1px solid #b2b894; border-radius: 16px; background: #fff8eaf7; box-shadow: 0 6px 24px #304b4433; color: #365346; touch-action: pan-y; }
.npc-dialogue-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
#npc-name { font-size: 16px; }
#close-dialogue { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; padding: 0; border: 1px solid #b5bda5; border-radius: 10px; background: #e9ead9; color: #4e675c; touch-action: manipulation; }
#npc-line { margin: 4px 0 10px; font-size: 16px; line-height: 1.65; overflow-wrap: anywhere; }
.npc-receipt { margin: 6px 0 10px; font-size: 14px; line-height: 1.5; font-weight: 700; color: #8b6734; }
.field.talking .walk-hint { visibility: hidden; }
.stick { position: absolute; z-index: 1; left: 0; top: 0; width: 136px; height: 136px; padding: 0; border-radius: 50%; border: 2px solid #fffdf29c; background: #fffdf23d; box-shadow: 0 4px 24px #2a473417, inset 0 0 0 14px #ffffff12; pointer-events: none; opacity: 0; }
.stick.held { opacity: 1; }
.field-header, .interact { z-index: 2; }
.delivery-stack { position: absolute; z-index: 3; bottom: calc(env(safe-area-inset-bottom, 0px) + 140px); left: max(16px, env(safe-area-inset-left, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); display: grid; gap: 8px; pointer-events: none; }
.delivery-stack.compact { top: calc(env(safe-area-inset-top, 0px) + 100px); bottom: auto; }
.delivery-panel { padding: 14px; border: 1px solid #599bb6; border-radius: 18px 6px 18px 18px; background: linear-gradient(145deg, rgb(36 54 78 / 90%), rgb(21 36 59 / 90%)); color: #f4f8ff; box-shadow: 0 8px 28px #0d1c354d, inset 0 1px 0 #9eefff40, 0 0 14px #62d9ee20; }
.delivery-heading { position: relative; display: flex; justify-content: flex-start; align-items: center; gap: 8px; min-height: 40px; padding-right: 48px; font-size: 14px; }
.offer-kind { display: inline-flex; align-items: center; gap: 7px; color: #ecf6ff; font-size: 16px; font-weight: 700; }
.offer-kind > span { color: #72e6fa; font-size: 24px; line-height: 1; }
.delivery-panel:not(.active) #delivery-phase { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.reject-offer { position: absolute; top: 0; right: 0; display: grid; place-items: center; width: 40px; height: 40px; margin: 0; border: 1px solid #9ab1c866; border-radius: 9px; background: #30435c; color: #e4f4ff; font-size: 28px; line-height: 1; pointer-events: auto; touch-action: manipulation; cursor: pointer; }
.reward-module { margin: 10px 0 12px; padding: 6px 12px; border-left: 2px solid #f4d271; border-right: 2px solid #f4d271; background: #0d1c354d; text-align: center; }
.reward-caption { color: #dfd2a7; font-size: 12px; }
#delivery-reward { margin: 2px 0 0; color: #ffe394; font-size: 44px; line-height: 1.1; letter-spacing: .02em; white-space: nowrap; font-weight: 800; font-variant-numeric: tabular-nums; }
.delivery-route { display: grid; gap: 0; margin: 0; }
.route-stop { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 5px 9px; border: 1px solid #7890ac40; border-radius: 8px; background: #334b6559; line-height: 1.35; }
.route-icon { display: grid; place-items: center; flex: 0 0 28px; height: 28px; border: 1px solid #72e6fa66; border-radius: 7px; color: #9cefff; font-size: 12px; font-weight: 700; }
.dropoff-stop .route-icon { color: #ffe394; border-color: #f4d27166; }
.route-stop > div { min-width: 0; }
.route-stop div > span { display: block; color: #b4c7db; font-size: 12px; }
.route-stop strong { display: block; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.route-arrow { padding-left: 18px; color: #8cdcea; font-size: 14px; line-height: 16px; }
.delivery-guide { margin: 5px 0 0; font-size: 14px; line-height: 1.5; color: #e2efff; }
.delivery-panel.active { padding: 12px 16px; border-radius: 16px; }
.delivery-panel.active .delivery-heading { min-height: 0; padding-right: 0; color: #9cefff; }
.delivery-panel.active .delivery-route, .delivery-panel.active .reward-module, .delivery-panel.active .offer-kind, .delivery-panel.active .delivery-actions { display: none; }
.delivery-actions { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 14px; }
.delivery-actions button { min-width: 0; min-height: 46px; border: 1px solid #91a8c2; border-radius: 9px; background: #283c55; color: #edf4ff; font-size: 16px; font-weight: 700; pointer-events: auto; touch-action: manipulation; cursor: pointer; }
#accept-delivery { border-color: #9cf1fa; background: #b5c9d2; color: #122b41; }
.delivery-panel:not(.active) { width: min(100%, 320px); justify-self: center; }
.route-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.delivery-actions button:active, .reject-offer:active { filter: brightness(1.15); }
.delivery-stack button:focus-visible { outline-color: #ffe394; }
.delivery-save { margin: 0; padding: 10px 13px; border-radius: 12px; background: #fff2e9f5; color: #a33f2c; font-size: 12px; line-height: 1.5; }
.interact.ready { background: #fff4bb; border-color: #fffbd9; box-shadow: 0 0 0 5px #edca6350; }
#wallet { color: #426d54; font-weight: 700; }
.stick::before, .stick::after { content: ''; position: absolute; background: #fffdf280; border-radius: 2px; pointer-events: none; }
.stick::before { width: 2px; top: 12px; bottom: 12px; left: calc(50% - 1px); }
.stick::after { height: 2px; left: 12px; right: 12px; top: calc(50% - 1px); }
.stick-knob { position: absolute; z-index: 1; left: calc(50% - 27px); top: calc(50% - 27px); width: 54px; height: 54px; border-radius: 50%; border: 2px solid #ffffffba; background: #fffdf2b8; box-shadow: 0 4px 10px #28433b21; pointer-events: none; transform: translate(0px, 0px); }
.stick:not(.held) .stick-knob { transition: transform .12s ease-out; }
.interact { position: absolute; right: max(28px, env(safe-area-inset-right, 0px)); bottom: calc(env(safe-area-inset-bottom, 0px) + 53px); width: 92px; height: 92px; border: 2px solid #fffdf2bb; border-radius: 50%; display: grid; place-content: center; gap: 3px; color: #395b4c; background: #fffdf2c9; box-shadow: 0 4px 18px #28433b18; touch-action: manipulation; cursor: pointer; }
.interact b { font-size: 25px; font-weight: 500; line-height: 1; }
.interact { padding: 0; }
.interact span { font-size: 12px; font-weight: 700; white-space: nowrap; }
.interact:active { transform: scale(.95); background: #fffdf2; }
@media (max-height: 520px) { .field-header { top: calc(env(safe-area-inset-top, 0px) + 8px); } .place { padding: 8px 12px; } .place p { display: none; } .stick { width: 112px; height: 112px; } .interact { bottom: calc(env(safe-area-inset-bottom, 0px) + 34px); width: 80px; height: 80px; } .walk-hint { bottom: calc(env(safe-area-inset-bottom, 0px) + 146px); } }
@media (max-height: 520px) and (min-width: 600px) {
  .delivery-stack { right: calc(env(safe-area-inset-right, 0px) + 140px); bottom: calc(env(safe-area-inset-bottom, 0px) + 14px); }
  .delivery-panel:not(.active) { display: grid; grid-template-columns: .8fr 1.2fr; column-gap: 12px; padding: 12px; }
  .delivery-panel:not(.active) .delivery-heading, .delivery-actions { grid-column: 1 / -1; }
  .reward-module { align-self: center; padding: 8px 4px; }
  #delivery-reward { font-size: 32px; }
  .delivery-route { margin-top: 10px; }
  .route-stop { padding: 5px; gap: 6px; }
  .route-stop strong { font-size: 14px; }
  .route-icon { flex-basis: 24px; }
  .walk-hint { max-width: 75%; bottom: calc(env(safe-area-inset-bottom, 0px) + 16px); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.encounter-save {
  position: absolute; z-index: 6; left: 12px; right: 12px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 120px);
  margin: 0; padding: 10px 12px; border-radius: 12px;
  background: #fff5e7; color: #8b372a; font-size: 12px; line-height: 1.5;
}
#open-equipment { flex-basis: 100%; min-height: 44px; border: 1px solid #599bb6; border-radius: 8px; background: #344963; color: #fff; font-size: 16px; }
.field:has(.facilities:not([hidden])) { touch-action: pan-y; }
.facilities { position: absolute; z-index: 5; top: calc(env(safe-area-inset-top, 0px) + 104px); left: max(14px, env(safe-area-inset-left, 0px)); right: max(14px, env(safe-area-inset-right, 0px)); max-width: 440px; margin: 0 auto; max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 260px); overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; touch-action: pan-y; padding: 16px; border: 1px solid #b7bba2; border-radius: 18px; background: #fff8eaf7; color: #395b4c; box-shadow: 0 10px 36px #263e4160; font-size: 16px; }
.facilities-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.facilities h2 { margin: 0; font-size: 20px; }
.facilities button { min-height: 44px; border: 1px solid #a4b4a1; border-radius: 10px; background: #e4ecdc; color: #395b4c; padding: 8px 12px; font-size: 14px; font-weight: 700; }
.facilities button:disabled { opacity: .5; }
#close-facilities { position: relative; width: 44px; flex: 0 0 44px; display: grid; place-items: center; padding: 0; }
#equipment-stats, #shop-wallet { font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.equipment-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid #d9d6c3; padding: 14px 0; }
.equipment-row > div { min-width: 0; overflow-wrap: anywhere; }
.equipment-row strong { font-size: 16px; }
.equipment-row p { margin: 6px 0 0; font-size: 12px; line-height: 1.5; }
.equipment-row button { flex-shrink: 0; }
#diary-record-title { font-size: 16px; margin: 16px 0; }
.diary-totals { margin: 0 0 18px; font-size: 16px; }
.diary-totals > div { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid #d9d6c3; }
.diary-totals dt { min-width: 0; }
.diary-totals dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; text-align: right; }
#write-diary { width: 100%; font-size: 16px; }
#diary-result { font-size: 14px; line-height: 1.5; }
@media (max-width: 360px) { .equipment-row { flex-wrap: wrap; } .equipment-row button { margin-left: auto; } }
@media (max-height: 520px) { .facilities { top: calc(env(safe-area-inset-top, 0px) + 70px); max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 90px); right: max(110px, env(safe-area-inset-right, 0px)); } }
