:root {
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', sans-serif;
  color: #293f35;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #e5dec8;
  overflow: hidden;
}
#world {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}
header {
  position: absolute;
  top: 30px;
  left: 38px;
  right: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  color: inherit;
  text-decoration: none;
  font-family: Georgia, serif;
  font-size: 32px;
  letter-spacing: -1.4px;
}
.brand span {
  font-family: system-ui;
  display: block;
  font-size: 10px;
  letter-spacing: 2px;
  margin-top: 5px;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 12px;
}
button {
  font: inherit;
  font-size: 13px;
  color: inherit;
  border: 1px solid #ffffff80;
  border-radius: 24px;
  background: #f8faf0de;
  padding: 11px 17px;
  cursor: pointer;
  backdrop-filter: blur(12px);
}
button:hover {
  background: #fff;
}
button:focus-visible,
input:focus-visible {
  outline: 3px solid #578d71;
  outline-offset: 3px;
}
button[aria-pressed='true'] {
  background: #345d4c;
  color: white;
  border-color: #345d4c;
}
.intro {
  position: absolute;
  top: 150px;
  left: 40px;
  pointer-events: none;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 3px;
  color: #55695c;
}
h1 {
  font-size: clamp(24px, 3vw, 40px);
  font-weight: 400;
  letter-spacing: -1.8px;
  margin: 17px 0;
}
.intro p {
  font-size: 13px;
  line-height: 1.9;
  color: #536454;
}
.weather {
  display: flex;
  gap: 6px;
  margin-top: 22px;
  pointer-events: auto;
}
.weather button {
  font-size: 11px;
  padding: 9px 13px;
}
#settings {
  position: absolute;
  right: 32px;
  top: 95px;
  width: 285px;
  padding: 24px;
  background: #f6f6ecf2;
  border: 1px solid white;
  border-radius: 20px;
  max-height: 65vh;
  overflow: auto;
  z-index: 3;
  box-shadow: 0 12px 50px #213c2520;
}
h2 {
  font-size: 17px;
  margin: 0 0 20px;
}
label {
  display: block;
  font-size: 13px;
  margin: 15px 0;
}
input[type='range'] {
  display: block;
  width: 100%;
  accent-color: #3c6755;
  margin-top: 9px;
}
input[type='checkbox'] {
  accent-color: #3c6755;
}
aside p {
  font-size: 12px;
  line-height: 1.7;
  color: #4f5f52;
}
#notice {
  position: absolute;
  bottom: 138px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  text-align: center;
  background: #f7f8eed9;
  border-radius: 20px;
  padding: 10px 18px;
  max-width: 90%;
  width: max-content;
}
.place {
  position: absolute;
  bottom: 34px;
  left: 38px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.place small {
  font-size: 10px;
  display: block;
  margin-bottom: 5px;
}
.place strong {
  font-size: 13px;
  font-weight: 500;
}
.place-dot {
  width: 7px;
  height: 7px;
  border-radius: 100%;
  background: #477c5b;
}
.place button {
  font-size: 23px;
  padding: 4px 12px;
}
footer {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  width: max-content;
  max-width: 98%;
}
.controls {
  display: flex;
  gap: 7px;
  background: #f4f5ea99;
  padding: 7px;
  border: 1px solid #ffffff90;
  border-radius: 36px;
  backdrop-filter: blur(12px);
}
footer p {
  font-size: 11px;
  color: #3f5244;
  margin: 10px 0;
}
.stop {
  background: #365b4c;
  color: #fff;
}
.stop:hover {
  background: #284337;
}
#joystick {
  display: none;
  position: absolute;
  bottom: 150px;
  left: 28px;
  width: 110px;
  height: 110px;
  border: 1px solid #ffffffc0;
  background: #f9fff344;
  border-radius: 50%;
  touch-action: none;
}
#stick {
  position: absolute;
  left: 34px;
  top: 34px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #eff4e9c9;
  box-shadow: 0 3px 18px #23412b20;
}
#error {
  position: absolute;
  inset: 40% 15%;
  background: white;
  padding: 30px;
  border-radius: 20px;
}
@media (pointer: coarse) {
  #joystick {
    display: block;
  }
}
@media (max-width: 800px) {
  header {
    left: 20px;
    right: 20px;
    top: 20px;
  }
  .brand {
    font-size: 27px;
  }
  .brand span {
    font-size: 8px;
  }
  .top-actions {
    gap: 9px;
    font-size: 10px;
  }
  .intro {
    left: 22px;
    top: 105px;
  }
  .intro p {
    font-size: 11px;
  }
  .intro h1 {
    font-size: 26px;
  }
  .weather {
    margin-top: 15px;
  }
  .place {
    bottom: 118px;
    left: auto;
    right: 20px;
  }
  .place small {
    font-size: 9px;
  }
  .place strong {
    font-size: 11px;
  }
  footer {
    bottom: 17px;
  }
  .controls {
    gap: 3px;
    padding: 5px;
  }
  .controls button {
    font-size: 10px;
    padding: 11px 9px;
  }
  #notice {
    bottom: 82px;
    font-size: 10px;
    padding: 8px 12px;
    max-width: 95%;
  }
  footer p {
    display: none;
  }
  #settings {
    right: 15px;
    top: 80px;
  }
  #joystick {
    display: block;
    bottom: 175px;
    left: 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
.intro {
  padding: 20px 24px 24px;
  margin-left: -24px;
  margin-top: -20px;
  border-radius: 22px;
  background: linear-gradient(100deg, #f3eedbd9, #f3eedb8c 75%, #f3eedb00);
  text-shadow: 0 1px 8px #ffffff45;
}
header {
  z-index: 1;
}
.top-actions > span {
  background: #f4f4e7ce;
  border-radius: 20px;
  padding: 8px 12px;
}
@media (max-width: 800px) {
  .intro {
    padding: 15px 18px 18px;
    margin-left: -10px;
    margin-top: -10px;
  }
  .top-actions > span {
    display: none;
  }
}

button:disabled {
  opacity: 0.55;
  cursor: default;
  background: #eceee3;
  color: #697367;
}

/* Mobile HUD: keep the centre open and controls clear of browser safe areas. */
@media (max-width: 800px) {
  :root {
    --hud-bottom: max(10px, env(safe-area-inset-bottom));
    --hud-left: max(16px, env(safe-area-inset-left));
    --hud-right: max(16px, env(safe-area-inset-right));
    --hud-top: max(12px, env(safe-area-inset-top));
  }
  header {
    position: fixed;
    top: var(--hud-top);
    left: var(--hud-left);
    right: var(--hud-right);
  }
  .brand {
    font-size: 25px;
  }
  .brand span {
    font-size: 9px;
    letter-spacing: 1px;
    margin-top: 3px;
  }
  #settingsButton {
    min-height: 44px;
    padding: 10px 16px;
  }
  .intro {
    position: fixed;
    top: calc(var(--hud-top) + 64px);
    left: var(--hud-left);
    right: var(--hud-right);
    margin: 0;
    padding: 12px 14px;
    width: auto;
    border-radius: 18px;
    background: #f3eedbc9;
  }
  .intro .eyebrow {
    font-size: 10px;
    letter-spacing: 2px;
  }
  .intro h1 {
    font-size: 20px;
    letter-spacing: -0.7px;
    margin: 6px 0 10px;
    line-height: 1.3;
  }
  .intro p {
    display: none;
  }
  .weather {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
  .weather button {
    min-height: 44px;
    font-size: 12px;
    padding: 8px 5px;
    white-space: nowrap;
  }
  footer {
    position: fixed;
    left: var(--hud-left);
    right: var(--hud-right);
    bottom: var(--hud-bottom);
    width: auto;
    max-width: none;
    transform: none;
  }
  .controls {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
    padding: 7px;
    border-radius: 22px;
    background: #f4f5eadb;
  }
  .controls button {
    min-height: 44px;
    min-width: 0;
    padding: 8px 5px;
    font-size: 12px;
    line-height: 1.25;
    white-space: normal;
    grid-column: span 2;
  }
  #auto {
    order: 0;
  }
  #run {
    order: 1;
  }
  #stop {
    order: 2;
  }
  #sit {
    order: 3;
    grid-column: span 3;
  }
  #notice {
    position: fixed;
    bottom: calc(var(--hud-bottom) + 122px);
    left: var(--hud-left);
    right: var(--hud-right);
    width: auto;
    max-width: none;
    transform: none;
    margin: 0;
    font-size: 11px;
    line-height: 1.45;
    padding: 8px 10px;
    border-radius: 14px;
  }
  #joystick {
    position: fixed;
    left: var(--hud-left);
    bottom: calc(var(--hud-bottom) + 174px);
    width: 110px;
    height: 110px;
  }
  .place {
    position: fixed;
    left: auto;
    right: var(--hud-right);
    bottom: calc(var(--hud-bottom) + 180px);
    max-width: calc(100% - 158px);
    gap: 8px;
    padding: 6px 8px;
    border-radius: 18px;
    background: #f4f5eac9;
  }
  .place small {
    font-size: 10px;
  }
  .place strong {
    font-size: 12px;
    line-height: 1.4;
  }
  .place button {
    min-width: 44px;
    min-height: 44px;
    padding: 4px 8px;
  }
  .place-dot {
    display: none;
  }
  #settings {
    position: fixed;
    top: calc(var(--hud-top) + 56px);
    left: var(--hud-left);
    right: var(--hud-right);
    width: auto;
    max-height: calc(100dvh - var(--hud-top) - var(--hud-bottom) - 80px);
    padding: 20px;
    overscroll-behavior: contain;
  }
  #settings button {
    min-height: 44px;
  }
  #settings label {
    line-height: 1.5;
  }
}
@media (max-width: 800px) and (max-height: 650px) {
  .intro {
    top: calc(var(--hud-top) + 54px);
    padding: 8px 10px;
  }
  .intro .eyebrow,
  .intro h1 {
    display: none;
  }
  #joystick {
    bottom: calc(var(--hud-bottom) + 165px);
  }
  .place {
    bottom: calc(var(--hud-bottom) + 170px);
  }
}
@media (max-width: 950px) and (max-height: 500px) and (orientation: landscape) {
  header {
    top: max(8px, env(safe-area-inset-top));
    left: max(12px, env(safe-area-inset-left));
    right: max(12px, env(safe-area-inset-right));
  }
  .brand span {
    display: none;
  }
  .intro {
    top: 62px;
    left: max(12px, env(safe-area-inset-left));
    right: auto;
    width: 280px;
    padding: 8px 10px;
    margin: 0;
  }
  .intro .eyebrow,
  .intro h1,
  .intro p {
    display: none;
  }
  .weather {
    margin: 0;
  }
  footer {
    left: auto;
    right: max(12px, env(safe-area-inset-right));
    bottom: max(8px, env(safe-area-inset-bottom));
    width: 360px;
    max-width: 52%;
    transform: none;
  }
  .controls {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
    padding: 7px;
  }
  .controls button {
    grid-column: span 2;
    min-height: 44px;
    font-size: 12px;
    padding: 8px 5px;
  }
  #sit {
    grid-column: span 3;
  }
  #joystick {
    display: block;
    left: max(20px, env(safe-area-inset-left));
    bottom: max(18px, env(safe-area-inset-bottom));
  }
  #notice {
    left: auto;
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(max(8px, env(safe-area-inset-bottom)) + 122px);
    width: 360px;
    max-width: 52%;
    transform: none;
    font-size: 10px;
  }
  .place {
    left: 150px;
    right: auto;
    bottom: 24px;
    max-width: 180px;
  }
  .place small {
    display: none;
  }
  footer p {
    display: none;
  }
  #settings {
    top: 60px;
    bottom: 12px;
    left: auto;
    right: 12px;
    width: 300px;
    max-height: calc(100dvh - 72px);
  }
}
@media (max-width: 950px) and (max-height: 500px) and (orientation: landscape) {
  .weather {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
  .weather button {
    min-height: 44px;
    font-size: 11px;
    padding: 8px 4px;
  }
  #auto {
    order: 0;
  }
  #run {
    order: 1;
  }
  #stop {
    order: 2;
  }
  #sit {
    order: 3;
  }
  #notice {
    padding: 8px 10px;
    line-height: 1.4;
  }
  .top-actions > span {
    display: none;
  }
}

/* Progressive disclosure: scenery first, secondary actions on demand. */
.mobile-only {
  display: none;
}
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.panel-heading h2 {
  margin: 0;
}
.panel-heading button {
  min-height: 44px;
  white-space: nowrap;
}
#panelBackdrop {
  position: fixed;
  inset: 0;
  z-index: 4;
  background: #182e2528;
  backdrop-filter: blur(2px);
}
#panelBackdrop[hidden] {
  display: none;
}
#settings {
  z-index: 5;
}
#actionSheet {
  z-index: 5;
  position: fixed;
  background: #f7f7edf5;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid white;
  box-shadow: 0 12px 50px #213c2530;
}
#actionsSlot {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
#actionsSlot button {
  min-height: 48px;
  font-size: 13px;
}
#actionSheet[hidden] {
  display: none;
}
body.compact-ui header {
  top: max(10px, env(safe-area-inset-top));
  left: max(14px, env(safe-area-inset-left));
  right: max(14px, env(safe-area-inset-right));
}
body.compact-ui .brand {
  font-size: 24px;
  text-shadow: 0 1px 6px #fff9;
}
body.compact-ui .brand span,
body.compact-ui .intro {
  display: none;
}
body.compact-ui #settingsButton {
  min-height: 44px;
  font-size: 12px;
  padding: 8px 13px;
}
body.compact-ui .place {
  top: max(40px, calc(env(safe-area-inset-top) + 30px));
  bottom: auto;
  left: max(14px, env(safe-area-inset-left));
  right: auto;
  padding: 0;
  background: none;
  max-width: 170px;
  pointer-events: none;
  text-shadow: 0 1px 5px #fff;
}
body.compact-ui .place small,
body.compact-ui .place-dot {
  display: none;
}
body.compact-ui .place strong {
  font-size: 11px;
  font-weight: 500;
}
body.compact-ui footer {
  position: fixed;
  left: auto;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  width: 164px;
  max-width: none;
  transform: none;
}
body.compact-ui .controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  backdrop-filter: none;
}
body.compact-ui .controls button {
  grid-column: auto;
  order: 0;
  min-height: 44px;
  font-size: 12px;
  padding: 9px 5px;
  white-space: nowrap;
}
body.compact-ui #moreActions {
  display: block;
  grid-column: span 2;
  background: #f4f5eab8;
}
body.compact-ui footer p {
  display: none;
}
body.compact-ui #joystick {
  display: block;
  position: fixed;
  left: max(16px, env(safe-area-inset-left));
  bottom: max(18px, env(safe-area-inset-bottom));
  width: 100px;
  height: 100px;
  background: #f9fff329;
}
body.compact-ui #stick {
  left: 29px;
  top: 29px;
}
body.compact-ui #nearBench:not([hidden]) {
  display: block;
  min-height: 44px;
  background: #f4f5ead9;
}
body.compact-ui #notice {
  position: fixed;
  top: 72px;
  bottom: auto;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 7px 12px;
  font-size: 12px;
  line-height: 1.4;
  opacity: 0;
  transition: opacity 0.35s;
  pointer-events: none;
}
body.compact-ui.notice-active #notice {
  opacity: 1;
}
body.compact-ui.panel-open #notice {
  visibility: hidden;
}
body.compact-ui #settings,
body.compact-ui #actionSheet {
  position: fixed;
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
  top: auto;
  bottom: max(12px, env(safe-area-inset-bottom));
  width: auto;
  max-width: 440px;
  margin: 0 auto;
  max-height: min(72dvh, 540px);
  padding: 18px;
  overflow: auto;
  overscroll-behavior: contain;
}
body.compact-ui .panel-heading {
  position: sticky;
  top: -18px;
  padding: 10px 0;
  background: #f7f7ed;
  z-index: 1;
}
body.compact-ui #weatherSlot:has(.weather) {
  margin-bottom: 18px;
}
body.compact-ui #weatherSlot:has(.weather)::before {
  content: '날씨';
  display: block;
  font-size: 12px;
  margin: 0 0 8px;
}
body.compact-ui .weather {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
}
body.compact-ui .weather button {
  min-height: 44px;
  padding: 8px 4px;
  font-size: 12px;
}
@media (max-height: 500px) and (orientation: landscape) {
  body.compact-ui #settings,
  body.compact-ui #actionSheet {
    left: auto;
    right: max(12px, env(safe-area-inset-right));
    width: 320px;
    max-height: calc(100dvh - 24px);
    margin: 0;
  }
  body.compact-ui #notice {
    top: 16px;
    max-width: 48%;
  }
}
body.compact-ui #auto {
  order: 0;
  grid-column: auto;
}
body.compact-ui #stop {
  order: 1;
  grid-column: auto;
}
body.compact-ui #moreActions {
  order: 2;
  grid-column: span 2;
}
body.compact-ui #actionsSlot button {
  grid-column: auto;
  order: 0;
  min-width: 0;
}
body.compact-ui #actionsSlot #favorite {
  font-size: 13px;
}

/* Prevent selection during scenery/pad drags; retain editing and keyboard focus. */
body {
  -webkit-user-select: none;
  user-select: none;
}
canvas,
button,
a,
#joystick {
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}
input,
textarea,
[contenteditable='true'] {
  -webkit-user-select: text;
  user-select: text;
}
input[type='range'],
input[type='checkbox'] {
  touch-action: auto;
}

/* Contextual fishing action appears only in water, sharing the bench-action area. */
#catchFish {
  min-height: 44px;
  background: #f4f5eadf;
}
#catchFish[hidden],
#catchResult[hidden] {
  display: none;
}
#catchResult {
  position: fixed;
  top: 90px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  width: 340px;
  padding: 16px 20px;
  border-radius: 20px;
  background: #f7f5e9ed;
  color: #345849;
  text-align: center;
  font-size: 14px;
  line-height: 1.6;
  pointer-events: none;
}
body.compact-ui #catchResult {
  top: 112px;
  font-size: 13px;
  padding: 12px 16px;
}
@media (max-height: 500px) and (orientation: landscape) {
  body.compact-ui #catchResult {
    top: 60px;
    width: 300px;
  }
}

#underwaterView {
  min-height: 44px;
  background: #e6f3e7ee;
}
#underwaterView[hidden] {
  display: none;
}
#underwaterView[aria-pressed='true'] {
  background: #345d4c;
  color: white;
}

body.underwater-view .intro {
  display: none;
}

#heartCount {
  font-size: 13px;
  color: #8c4c54;
  white-space: nowrap;
  background: #fff9e8db;
  padding: 8px 11px;
  border-radius: 20px;
}
#talkQuiz {
  min-height: 46px;
  background: #f9e5bedf;
  font-weight: 600;
}
#talkQuiz::before {
  content: '💬 ';
}
#quizPanel {
  position: fixed;
  z-index: 25;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(440px, calc(100% - 28px));
  max-height: calc(100dvh - 28px);
  overflow: auto;
  padding: 24px;
  border-radius: 26px;
  background: #fffaf0;
  box-shadow: 0 20px 80px #243c3540;
}
#quizPanel h2 {
  font-size: 20px;
  margin: 0;
}
#quizPanel h3 {
  font-size: 27px;
  margin: 20px 0;
}
#quizGreeting {
  font-size: 14px;
  line-height: 1.6;
}
#quizProgress {
  font-size: 13px;
  color: #8c4c54;
}
#quizOptions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
#quizOptions button {
  font-size: 18px;
  min-height: 52px;
  border: 1px solid #becbbb;
  background: #edf2e5;
}
#quizOptions button:disabled {
  opacity: 0.55;
}
#quizOptions button.correct {
  background: #345d4c;
  color: white;
  opacity: 1;
}
#quizFeedback {
  min-height: 24px;
  line-height: 1.5;
  font-size: 14px;
}
#quizPanel small {
  display: block;
  font-size: 12px;
  color: #55644f;
  margin-top: 18px;
}
#nextQuiz,
#watchFireworks {
  background: #345d4c;
  color: white;
  margin-right: 6px;
  margin-bottom: 6px;
}
#quizPanel[hidden],
#talkQuiz[hidden],
#nextQuiz[hidden],
#watchFireworks[hidden] {
  display: none;
}
body.compact-ui #quizPanel {
  padding: 20px;
}
body.compact-ui #heartCount {
  font-size: 12px;
  padding: 7px 9px;
}
body.compact-ui .top-actions {
  gap: 8px;
}
@media (max-height: 500px) {
  #quizPanel {
    padding: 16px;
  }
  #quizPanel h3 {
    font-size: 22px;
    margin: 10px 0;
  }
  #quizGreeting {
    margin: 6px 0;
  }
  #quizPanel small {
    margin-top: 6px;
  }
  #quizFeedback {
    margin: 8px 0;
  }
}
body.compact-ui .top-actions #heartCount {
  display: inline-block;
}

@media (pointer: coarse) {
  footer > p {
    display: none;
  }
}

#entryDialog {
  border: 0;
  border-radius: 26px;
  background: #fffaf0;
  color: #293f35;
  width: min(470px, calc(100% - 28px));
  max-height: calc(100dvh - 28px);
  padding: 26px;
  overflow: auto;
}
#entryDialog::backdrop {
  background: #203c3455;
  backdrop-filter: blur(5px);
}
#entryDialog h2 {
  font-size: 24px;
  line-height: 1.35;
  font-weight: 500;
}
#entryDialog p {
  font-size: 13px;
  line-height: 1.65;
}
#entryDialog input[type='text'],
#walkerName {
  display: block;
  box-sizing: border-box;
  width: 100%;
  border: 1px solid #becbbb;
  background: white;
  border-radius: 12px;
  padding: 12px;
  margin: 8px 0 20px;
  font: inherit;
}
#entryDialog fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}
#entryDialog legend {
  font-size: 14px;
  margin-bottom: 10px;
}
.avatar-picks {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.avatar-picks label {
  position: relative;
  cursor: pointer;
}
.avatar-picks input {
  position: absolute;
  opacity: 0;
}
.avatar-picks span {
  display: block;
  text-align: center;
  font-size: 12px;
  line-height: 2.2;
  border: 1px solid #d8dfd1;
  border-radius: 14px;
  padding: 10px 2px;
  background: #edf2e5;
}
.avatar-picks input:checked + span {
  border: 2px solid #345d4c;
  background: #dcebd8;
  padding: 9px 1px;
}
.avatar-picks input:focus-visible + span {
  outline: 3px solid #d5aa62;
}
.entry-actions {
  display: flex;
  gap: 8px;
  margin: 18px 0 12px;
}
.entry-actions button {
  flex: 1;
  min-height: 46px;
}
.entry-actions button:first-child {
  background: #345d4c;
  color: white;
}
#entryDialog small {
  font-size: 12px;
  color: #55644f;
}
#peerRoster {
  overflow-wrap: anywhere;
}
@media (max-width: 480px) {
  #entryDialog {
    padding: 20px;
  }
  #entryDialog h2 {
    font-size: 21px;
  }
}

#arrivalToast {
  position: fixed;
  z-index: 8;
  top: 94px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  width: max-content;
  background: #fff8e9f5;
  color: #345849;
  border: 1px solid #fff;
  border-radius: 22px;
  padding: 12px 20px;
  box-shadow: 0 5px 24px #34584922;
  font-size: 13px;
  text-align: center;
  overflow-wrap: anywhere;
  pointer-events: none;
}
body.compact-ui #arrivalToast {
  top: calc(env(safe-area-inset-top) + 74px);
  font-size: 12px;
  padding: 10px 14px;
}
@media (max-height: 500px) {
  body.compact-ui #arrivalToast {
    top: 12px;
    max-width: 48%;
  }
}

.appearance-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 14px;
}
.appearance-options label {
  margin: 4px 0;
}
.appearance-options label:last-child {
  grid-column: 1/-1;
}
.appearance-options select {
  display: block;
  width: 100%;
  margin: 7px 0;
  padding: 10px;
  border: 1px solid #becbbb;
  border-radius: 12px;
  font: inherit;
  background: #fff;
  color: #293f35;
}
#entryDialog .appearance-note {
  font-size: 11px;
  margin: 8px 0 12px;
}
#entryDialog .avatar-picks label {
  margin: 6px 0;
}
#entryDialog .entry-actions {
  position: sticky;
  bottom: -20px;
  background: #fffaf0;
  padding: 8px 0;
  margin-bottom: 0;
}

#actionSheet {
  right: 20px;
  bottom: 100px;
  width: min(360px, calc(100vw - 40px));
  max-height: 75dvh;
  overflow: auto;
}
#actionSheet > p {
  font-size: 13px;
  line-height: 1.6;
  color: #5d7367;
}
#moreActions {
  display: inline-flex;
}

#rodFish { min-height:44px; background:#fff7df; color:#344e43; }
#rodFish[hidden] { display:none; }

.character-preview {
  border: 1px solid #d6dfcd;
  border-radius: 20px;
  background: radial-gradient(ellipse at 50% 35%, #fffdf6, #e4edda);
  margin: 12px 0 18px;
  overflow: hidden;
}
#characterPreview {
  display: block;
  width: 100%;
  height: 240px;
}
.preview-views {
  display: flex;
  justify-content: center;
  gap: 6px;
}
.preview-views button {
  padding: 7px 12px;
  font-size: 12px;
}
.preview-views button[aria-pressed='true'] {
  color: #fff;
  background: #365e48;
}
#entryDialog #previewDescription {
  text-align: center;
  font-size: 11px;
  margin: 10px 8px 12px;
}
@media (max-width: 520px) {
  #characterPreview { height: 210px; }
}

#huntPanel {
  width: 220px;
  padding: 14px;
  border: 1px solid #d9d7bc;
  border-radius: 18px;
  background: #fffaf0f2;
  color: #344c3c;
  display: grid;
  gap: 8px;
}
#huntPanel[hidden] { display: none; }
#huntPanel strong { font-size: 14px; }
#huntPanel small { font-size: 11px; }
#huntHealth { width: 100%; height: 12px; accent-color: #609b62; }
#attackMonster { min-height: 44px; background: #365e48; color: white; }
#attackMonster:disabled { opacity: 0.55; }
body.compact-ui #huntPanel {
  width: 100%;
  padding: 10px;
  gap: 6px;
}

/* Nearby-only actions (quiz, fishing, bench, hunting) stack in one column and never overlap. */
#contextActions {
  position: fixed;
  z-index: 5;
  right: 38px;
  bottom: 130px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  max-width: 260px;
  pointer-events: none;
}
#contextActions > * {
  pointer-events: auto;
}
body.panel-open #contextActions {
  visibility: hidden;
}
body.compact-ui #contextActions {
  right: max(14px, env(safe-area-inset-right));
  bottom: calc(max(14px, env(safe-area-inset-bottom)) + 106px);
  width: 164px;
  align-items: stretch;
  gap: 6px;
}
body.compact-ui #contextActions > button {
  font-size: 12px;
  line-height: 1.3;
  padding: 9px 8px;
}

/* Keyboard focus that stays visible on every control. */
select:focus-visible,
summary:focus-visible {
  outline: 3px solid #578d71;
  outline-offset: 3px;
}
#world:focus-visible {
  outline: 3px solid #578d71b0;
  outline-offset: -4px;
}
#entryTitle:focus {
  outline: none;
}
kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 1px 5px;
  margin: 0 1px;
  border: 1px solid #c9d1c3;
  border-bottom-width: 2px;
  border-radius: 6px;
  background: #fbfcf6;
  font: inherit;
  font-size: 0.92em;
  line-height: 1.4;
  text-align: center;
}
.touch-only {
  display: none;
}
@media (pointer: coarse) {
  .key-only {
    display: none;
  }
  .touch-only {
    display: block;
  }
}
.how-to {
  margin-top: 16px;
  border-top: 1px solid #dfe3d6;
  padding-top: 12px;
  font-size: 12px;
}
.how-to summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 13px;
  border-radius: 12px;
}
.how-to ul {
  margin: 4px 0 0;
  padding-left: 18px;
  line-height: 1.9;
  color: #4f5f52;
}
#actionSheet .sheet-tip {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: #ecf1e4;
  font-size: 12px;
  line-height: 1.6;
}

/* Entry dialog: numbered steps, clear avatar selection, sticky actions that never hide fields. */
#entryDialog {
  scroll-padding-bottom: 104px;
}
#entryDialog .entry-step-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  margin: 16px 0 6px;
}
.step-no {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #345d4c;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}
#walkerName {
  margin-bottom: 4px;
  min-height: 46px;
  font-size: 16px;
}
#walkerName:focus-visible {
  outline: 3px solid #578d71;
  outline-offset: 1px;
}
#entryDialog .field-hint {
  font-size: 11px;
  margin: 0 0 4px;
  color: #5c6b5e;
}
.legend-hint {
  font-size: 11px;
  color: #5c6b5e;
  margin-left: 4px;
}
.avatar-picks span {
  position: relative;
  line-height: 1.3;
  padding: 10px 2px;
  min-height: 72px;
}
.avatar-picks span b {
  display: block;
  font-size: 26px;
  font-weight: 400;
  margin-bottom: 4px;
}
.avatar-picks label:hover span {
  background: #e3ecdb;
}
.avatar-picks input:checked + span {
  padding: 9px 1px;
  font-weight: 600;
  box-shadow: 0 2px 10px #345d4c2a;
}
.avatar-picks input:checked + span::after {
  content: '✓';
  position: absolute;
  top: -7px;
  right: -5px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #345d4c;
  color: #fff;
  font-size: 12px;
  line-height: 22px;
}
.avatar-picks input:focus-visible + span {
  outline-offset: 2px;
}
.preview-views button {
  min-height: 40px;
}
#entryDialog .entry-actions {
  box-shadow: 0 -10px 12px -6px #fffaf0;
  border-top: 1px solid #e7e6d6;
}
.entry-actions button {
  line-height: 1.3;
  font-weight: 600;
}
#entryDialog .entry-actions button small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: inherit;
  opacity: 0.85;
}
@media (max-height: 720px) {
  #characterPreview {
    height: 160px;
  }
  .character-preview {
    margin: 8px 0 10px;
  }
  #entryDialog h2 {
    font-size: 20px;
    margin: 4px 0 0;
  }
  #entryDialog .eyebrow {
    margin: 0;
  }
  #entryDialog #previewDescription {
    margin: 6px 8px 8px;
  }
}
@media (max-height: 500px) {
  #characterPreview {
    height: 120px;
  }
  #entryDialog {
    padding: 16px 20px;
  }
}

/* Quiz: progress at a glance, and right/wrong shown with shape and words, not colour alone. */
.quiz-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  font-size: 13px;
}
#quizRound {
  padding: 4px 10px;
  border-radius: 12px;
  background: #edf2e5;
  color: #345d4c;
  font-weight: 600;
}
#quizHeartMeter {
  color: #b85c6a;
  font-size: 18px;
  letter-spacing: 2px;
}
#quizPanel #quizProgress {
  margin: 6px 0 0;
  font-size: 12px;
}
#quizOptions button {
  position: relative;
  line-height: 1.3;
  padding: 10px 14px;
  overflow-wrap: anywhere;
  color: #293f35;
}
#quizOptions button::before {
  content: attr(data-key);
  position: absolute;
  top: 5px;
  left: 9px;
  font-size: 11px;
  color: #6a7a6c;
}
#quizOptions button:not(:disabled):hover {
  background: #fff;
  border-color: #8fa894;
}
#quizOptions button.correct::after {
  content: ' ✓';
}
#quizOptions button.correct::before {
  color: #d9e8de;
}
#quizOptions button.wrong {
  opacity: 1;
  background: #f6e9e4;
  border: 1px dashed #c69a8d;
  color: #8a5b50;
  text-decoration: line-through;
}
#quizOptions button.wrong::after {
  content: ' ✕';
  display: inline-block;
  text-decoration: none;
}
#quizFeedback {
  border-radius: 14px;
}
#quizFeedback[data-state='correct'],
#quizFeedback[data-state='wrong'] {
  padding: 8px 12px;
  font-weight: 600;
}
#quizFeedback[data-state='correct'] {
  background: #e1eedf;
  color: #2d5a43;
}
#quizFeedback[data-state='wrong'] {
  background: #fbefe3;
  color: #85512f;
}
#nextQuiz,
#watchFireworks {
  min-height: 48px;
  font-weight: 600;
}
@media (pointer: coarse) {
  #quizOptions button::before {
    content: none;
  }
}
