:root {
  --ui-ink: #203e32;
  --ui-muted: #4d6558;
  --ui-paper: #fffcf2;
  --ui-line: #c3cdbb;
  --ui-accent: #28573f;
  --ui-radius: 14px;
  --ui-shadow: 0 8px 26px #17352822;
}
.world-feedback-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 8;
  overflow: hidden;
}
.world-feedback {
  position: absolute;
  transform: translate(-50%, -100%);
  min-width: 130px;
  max-width: min(270px, 68%);
  padding: 9px 12px;
  border: 1px solid var(--ui-line);
  border-radius: 12px;
  background: #fffcf2f5;
  color: var(--ui-ink);
  font:
    600 13px/1.4 Lato,
    sans-serif;
  text-align: center;
  box-shadow: var(--ui-shadow);
}
.world-feedback progress {
  display: block;
  margin-top: 6px;
  width: 100%;
  height: 6px;
  accent-color: var(--ui-accent);
}
.world-feedback button {
  display: block;
  margin: 2px auto 0;
  min-height: 36px;
  pointer-events: auto;
}
.world-feedback[hidden] {
  display: none;
}
:where(button, input, select, textarea, summary):focus-visible {
  outline: 3px solid #977130;
  outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
  .world-feedback {
    animation: none;
    transition: none;
  }
}

/* The map and primary controls share one fitted play surface. */
.activity-grid .activity-tile {
  min-height: 90px;
}
.pet-care-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pet-command-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-block: 8px;
}
.arrival-help p {
  margin: 8px 0 12px;
  font-size: 13px;
  line-height: 1.5;
}
.arrival-help > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pet-exploration-hint {
  margin: 0;
  padding: 6px 12px;
  color: var(--ui-ink);
  background: #eef2e5;
  font-size: 12px;
}
@media (max-width: 650px) {
  main {
    padding-inline: 10px;
  }
  .arrival-help p {
    font-size: 11px;
    line-height: 1.4;
    margin: 5px 0;
  }
  .arrival-help .button,
  .arrival-help .text-button {
    min-height: 36px;
    padding: 6px 9px;
    font-size: 11px;
  }
  .world-feedback {
    font-size: 11px;
    padding: 7px 8px;
    max-width: 70%;
  }
}
.journal-tabs {
  display: flex;
  gap: 6px;
  position: sticky;
  top: 0;
  padding: 8px 0;
  background: var(--ui-paper);
  z-index: 2;
}
.journal-tabs button {
  flex: 1;
  min-width: 0;
}
.journal-content {
  padding-top: 8px;
}
.journal-lead {
  line-height: 1.6;
  color: var(--ui-muted);
  margin-bottom: 16px;
}
.journal-card {
  background: #f2f5e9;
  border: 1px solid var(--ui-line);
  border-radius: 14px;
  padding: 16px;
  margin: 12px 0;
}
.journal-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
}
.journal-card p {
  font-size: 13px;
  line-height: 1.6;
  margin: 6px 0;
}
.journal-card .button {
  margin: 6px 6px 6px 0;
}
.journal-card details {
  padding: 8px 0;
  font-size: 13px;
}
.relationship-memory {
  border-left: 3px solid #bba66f;
  padding-left: 12px;
  color: var(--ui-muted);
  font-size: 13px;
  line-height: 1.6;
}
.fishing-hud canvas {
  grid-column: 1/-1;
  width: 96px;
  height: 42px;
  justify-self: center;
  image-rendering: pixelated;
  border-radius: 8px;
}
.fishing-hud p {
  grid-column: 1/-1;
  font-size: 12px;
  line-height: 1.5;
  min-height: 36px;
  margin: 0;
}
.fishing-hud meter,
.fishing-hud progress {
  grid-column: 1/-1;
  width: 100%;
  height: 16px;
  accent-color: #527653;
}
.fishing-hud .button {
  min-height: 44px;
  padding: 6px;
  font-size: 12px;
}
.fishing-actions {
  grid-column: 1/-1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.fishing-actions > button:last-child {
  grid-column: 1/-1;
}
.fishing-actions:has(> button:nth-child(2)[hidden]) > button:last-child {
  grid-column: auto;
}
@media (max-width: 650px) {
  .fishing-hud canvas {
    display: none;
  }
  .fishing-hud p {
    font-size: 11px;
    min-height: 30px;
  }
  .fishing-hud .button {
    min-height: 44px;
    font-size: 11px;
  }
}
.puzzle-clue {
  grid-column: 1/-1;
  padding: 8px;
  line-height: 1.5;
  font-size: 13px;
  background: #eef1e2;
  border-radius: 8px;
}
.exploration-tile.song-note {
  outline: 4px solid #9b763d;
  outline-offset: 3px;
}
.trial-lesson {
  color: var(--ui-muted);
  line-height: 1.6;
  font-size: 13px;
}
.trial-trail {
  background: linear-gradient(
    130deg,
    #dbe6c7 45%,
    #c5bd91 46%,
    #c5bd91 54%,
    #dbe6c7 55%
  );
  padding: 14px;
  border-radius: 12px;
}
.trial-ridge {
  background: linear-gradient(160deg, #d4dfe0, #91a6af);
  padding: 14px;
  border-radius: 12px;
}
.trial-sky {
  background: #273e51;
  padding: 14px;
  border-radius: 12px;
}
.trial-sky button {
  border-radius: 50%;
  background: #fff8dc;
}
.trial-pairs {
  grid-template-columns: repeat(4, 1fr);
}
#progression-dialog .progress-runes.trial-spatial {
  display: block;
  position: relative;
  height: 320px;
}
.trial-spatial > svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.trial-spatial line {
  stroke: #e7cf8b;
  stroke-width: 1.5;
}
#progression-dialog .trial-spatial > button {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 68px;
  min-height: 64px;
  padding: 4px;
  font-size: 11px;
}
.trial-ridge > button {
  border-radius: 15px 8px 12px 7px;
  background: #f3f2df;
  border: 2px solid #567078;
}
.trial-spatial > button.trial-visited {
  box-shadow: 0 0 0 3px #e7cf8b;
}
.trial-spatial > button.trial-safe {
  outline: 4px dashed #254f39;
  outline-offset: 4px;
}
#progression-dialog .trial-spatial > button:hover,
#progression-dialog .trial-spatial > button:active:not(:disabled) {
  transform: translate(-50%, -50%);
  translate: 0;
}
.breathing-hud .breath-orb {
  width: 100px;
  height: 100px;
  margin: 12px auto;
  font-size: 12px;
}
.breathing-hud #breath-progress {
  font-size: 12px;
  line-height: 1.5;
}
.breathing-options {
  display: grid;
  gap: 6px;
  font-size: 12px;
}
.breathing-options label {
  display: flex;
  align-items: center;
  gap: 6px;
}
.breathing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.breathing-actions button {
  min-height: 44px;
  margin: 0;
}
@media (max-width: 650px) {
  .breathing-hud .breath-orb {
    width: auto;
    height: auto;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    transform: none;
    font-size: 12px;
    font-weight: 700;
  }
  .breathing-hud #breath-progress {
    font-size: 11px;
    line-height: 1.4;
    margin: 0;
  }
  .breathing-options {
    grid-column: 1/-1;
    grid-template-columns: 1.2fr 1fr 1fr;
    align-items: center;
    gap: 5px;
    font-size: 11px;
  }
  .breathing-options select {
    min-width: 0;
    min-height: 44px;
    padding: 4px;
  }
  .breathing-options label {
    min-height: 44px;
    gap: 3px;
  }
  .breathing-actions {
    grid-column: 1/-1;
    margin-top: 0;
  }
  .breathing-actions button {
    flex: 1;
    padding: 6px;
    font-size: 12px;
  }
}
@media (max-height: 500px) and (min-width: 651px) {
  .fishing-hud canvas {
    display: none;
  }
  .fishing-hud p {
    grid-column: 1;
    min-height: 0;
    font-size: 11px;
  }
  .fishing-actions {
    grid-column: 2;
    grid-row: 1;
    display: flex;
  }
  .fishing-hud .button {
    min-height: 44px;
    padding: 6px 10px;
  }
  .fishing-hud meter,
  .fishing-hud progress {
    height: 10px;
  }
  .breathing-hud .breath-orb {
    width: auto;
    height: auto;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    transform: none;
    font-size: 12px;
    font-weight: 700;
  }
  .breathing-hud #breath-progress {
    font-size: 11px;
    line-height: 1.4;
    margin: 0;
  }
  .breathing-options {
    grid-column: 3;
    grid-row: 1;
    grid-template-columns: 100px 86px 86px;
    align-items: center;
    font-size: 11px;
  }
  .breathing-options select,
  .breathing-options label {
    min-height: 44px;
  }
  .breathing-options select {
    padding: 4px;
  }
  .breathing-actions {
    grid-column: 4;
    grid-row: 1;
    margin: 0;
    flex-wrap: nowrap;
  }
  .breathing-actions button {
    padding: 6px 10px;
    font-size: 12px;
  }
}
.task-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.task-row > div {
  flex: 1;
  min-width: 100px;
}
.task-row small {
  display: block;
  color: var(--ui-muted);
}
.task-row .text-button {
  min-height: 40px;
}
.task-editor {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
}
.task-editor input {
  min-width: 0;
}
#task-add-form {
  flex-wrap: wrap;
}
#new-task-subject {
  width: 150px;
  flex: 1;
}
.room-preferences {
  margin: 10px 0;
  padding: 10px;
  background: var(--ui-paper);
  border-radius: 12px;
}
.room-preferences > label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
}
.room-preferences p,
.account-status-overview p {
  font-size: 13px;
  line-height: 1.6;
}
.room-preferences input[type="checkbox"] {
  width: 20px;
  height: 20px;
}
.peer-controls {
  display: flex;
  gap: 6px;
}
.peer-controls button {
  min-height: 40px;
  padding: 6px 10px;
}
#room-report-dialog {
  max-width: 500px;
}
#room-report-dialog textarea {
  width: 100%;
}
.account-status-overview {
  padding: 12px;
  border: 1px solid var(--ui-line);
  border-radius: 12px;
  margin-bottom: 18px;
}
@media (max-width: 650px) {
  .room-presence .presence-player {
    flex-wrap: wrap;
  }
  .presence-player .peer-controls {
    width: 100%;
    justify-content: flex-end;
  }
  .task-editor {
    grid-template-columns: 1fr;
  }
}
@media (max-height: 500px) {
  .arrival-help .button,
  .arrival-help .text-button {
    min-height: 44px;
  }
}
