:root {
  --sea: #071a22;
  --sea-deep: #041117;
  --sea-mid: #0d2a33;
  --paper: #f2e9d7;
  --paper-deep: #e4d7bd;
  --ink: #23312f;
  --ink-soft: #5d645a;
  --brass: #d6ad5b;
  --brass-deep: #a87d33;
  --coral: #d6654d;
  --sage: #8b9b6c;
  --line: rgba(35, 49, 47, 0.22);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: "Avenir Next", Avenir, "Segoe UI", Helvetica, sans-serif;
  --mono: "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--sea);
}

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 78% 4%, rgba(214, 173, 91, 0.12), transparent 25rem),
    radial-gradient(circle at 8% 74%, rgba(100, 182, 172, 0.08), transparent 30rem),
    var(--sea);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: 0.32;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.beam {
  position: fixed;
  top: -18vw;
  left: 33%;
  width: 120vw;
  height: 86vw;
  pointer-events: none;
  z-index: 0;
  transform-origin: 20% 10%;
  transform: rotate(19deg);
  opacity: 0.7;
  background: conic-gradient(from 194deg at 15% 4%, transparent 0deg, rgba(214, 173, 91, 0.14) 4deg, rgba(214, 173, 91, 0.02) 17deg, transparent 26deg);
  filter: blur(1px);
  animation: beam-drift 18s ease-in-out infinite alternate;
}

.page {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 44px));
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 0 18px;
}

.topbar {
  min-height: 47px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid rgba(242, 233, 215, 0.2);
  padding-bottom: 12px;
}

.shelf-link {
  width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(242, 233, 215, 0.7);
  font: 600 8px/1 var(--mono);
  letter-spacing: 0.16em;
  text-decoration: none;
}

.shelf-link span {
  font-size: 13px;
  transition: transform 160ms ease;
}

.shelf-link:hover span,
.shelf-link:focus-visible span {
  transform: translateX(-3px);
}

.top-title {
  margin: 0;
  color: var(--brass);
  font: 600 10px/1 var(--mono);
  letter-spacing: 0.24em;
}

.top-title span {
  color: rgba(242, 233, 215, 0.45);
}

.top-actions {
  justify-self: end;
  display: flex;
  gap: 16px;
}

.top-button {
  appearance: none;
  border: 0;
  padding: 6px 0;
  background: none;
  color: rgba(242, 233, 215, 0.62);
  font: 600 8px/1 var(--mono);
  letter-spacing: 0.14em;
  cursor: pointer;
}

.top-button:hover,
.top-button:focus-visible {
  color: var(--paper);
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 318px;
  gap: clamp(34px, 5vw, 74px);
  align-items: start;
  padding: 38px 0 44px;
}

.play-column {
  min-width: 0;
}

.night-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 11px;
  color: var(--brass);
  font: 600 8px/1.2 var(--mono);
  letter-spacing: 0.21em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.035em;
}

h1 {
  max-width: 760px;
  color: var(--paper);
  font-size: clamp(34px, 4.4vw, 57px);
  line-height: 0.98;
}

h2 {
  font-size: clamp(30px, 3.2vw, 42px);
  line-height: 1;
}

.night-subtitle {
  max-width: 590px;
  margin: 11px 0 0;
  color: rgba(242, 233, 215, 0.6);
  font-family: var(--serif);
  font-size: 15px;
  font-style: italic;
  line-height: 1.35;
}

.night-stars {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 3px;
  padding-bottom: 4px;
  color: var(--brass);
  font-size: 17px;
  letter-spacing: 0.03em;
}

.night-stars .empty {
  color: rgba(242, 233, 215, 0.2);
}

.logbook {
  position: relative;
  padding: clamp(20px, 3.2vw, 34px) clamp(16px, 3.8vw, 40px) 26px;
  color: var(--ink);
  background:
    repeating-linear-gradient(0deg, transparent 0 27px, rgba(35, 49, 47, 0.035) 27px 28px),
    linear-gradient(135deg, rgba(255, 255, 255, 0.4), transparent 42%),
    var(--paper);
  border: 1px solid rgba(214, 173, 91, 0.44);
  box-shadow:
    7px 7px 0 rgba(3, 11, 15, 0.28),
    0 24px 70px rgba(0, 0, 0, 0.22);
}

.logbook::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(35, 49, 47, 0.08);
  pointer-events: none;
}

.logbook-clip {
  position: absolute;
  top: -9px;
  right: 32px;
  width: 38px;
  height: 18px;
  background: linear-gradient(#d8b66d, #a77d37);
  border-radius: 3px 3px 5px 5px;
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.26);
}

.logbook-clip::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 5px;
  height: 1px;
  background: rgba(66, 47, 18, 0.45);
}

.log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font: 600 7px/1.3 var(--mono);
  letter-spacing: 0.16em;
}

.log-head span:last-child {
  text-align: right;
}

.clue {
  margin: 18px 0 20px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(17px, 2.2vw, 23px);
  font-style: italic;
  line-height: 1.35;
}

.board-wrap {
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
}

.feedback-head {
  display: grid;
  grid-template-columns: 20px 1fr 62px;
  gap: 7px;
  margin-bottom: 6px;
  color: rgba(35, 49, 47, 0.48);
  font: 600 6px/1 var(--mono);
  letter-spacing: 0.16em;
}

.feedback-head span:nth-child(2) {
  text-align: center;
}

.feedback-head span:nth-child(3) {
  text-align: center;
}

.board {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.guess-row {
  display: grid;
  grid-template-columns: 20px repeat(4, minmax(0, 1fr)) 62px;
  gap: 7px;
  align-items: stretch;
  min-height: 43px;
}

.row-number {
  align-self: center;
  color: rgba(35, 49, 47, 0.4);
  font: 600 7px/1 var(--mono);
  letter-spacing: 0.04em;
}

.cell {
  appearance: none;
  position: relative;
  min-width: 0;
  min-height: 43px;
  border: 1px solid rgba(35, 49, 47, 0.3);
  border-radius: 1px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.38), transparent),
    rgba(255, 255, 255, 0.26);
  padding: 0;
  color: var(--ink);
  font: 600 12px/1 var(--mono);
  display: grid;
  place-items: center;
  cursor: default;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.cell.empty::after {
  content: "";
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(35, 49, 47, 0.17);
}

.cell.filled {
  border-color: rgba(35, 49, 47, 0.55);
  text-shadow: 0 1px rgba(255, 255, 255, 0.2);
}

.cell.filled::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(255, 255, 255, 0.21);
  border-radius: 50%;
  pointer-events: none;
}

button.cell {
  cursor: pointer;
}

button.cell:hover {
  box-shadow: inset 0 0 0 2px rgba(214, 173, 91, 0.75);
}

.cell.selected {
  box-shadow:
    0 0 0 2px var(--paper),
    0 0 0 4px var(--brass-deep);
  z-index: 1;
}

.guess-row.future {
  opacity: 0.36;
}

.guess-row.current .row-number {
  color: var(--brass-deep);
}

.guess-row.result-row {
  animation: row-land 320ms cubic-bezier(.2, .8, .2, 1) both;
}

.row-feedback {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding-left: 4px;
  color: var(--ink-soft);
  font: 600 8px/1.1 var(--mono);
  letter-spacing: 0.03em;
}

.fb-line {
  display: flex;
  align-items: center;
  gap: 5px;
}

.feedback-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.exact-dot {
  background: var(--brass-deep);
  box-shadow: 0 0 0 2px rgba(168, 125, 51, 0.2);
}

.echo-dot {
  border: 1.5px solid var(--coral);
  background: transparent;
}

.fb-empty {
  color: rgba(35, 49, 47, 0.3);
  font-size: 7px;
  letter-spacing: 0.06em;
}

.palette-block {
  max-width: 540px;
  margin: 22px auto 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.micro-label {
  margin: 0 0 9px;
  color: var(--ink-soft);
  font: 600 6.5px/1.2 var(--mono);
  letter-spacing: 0.16em;
}

.micro-label span {
  float: right;
  color: rgba(35, 49, 47, 0.38);
  letter-spacing: 0.08em;
}

.palette {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
}

.swatch-button {
  appearance: none;
  min-width: 0;
  border: 1px solid rgba(35, 49, 47, 0.25);
  border-radius: 1px;
  padding: 8px 2px 7px;
  background: rgba(255, 255, 255, 0.2);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: background 120ms ease, transform 120ms ease;
}

.swatch-button:hover,
.swatch-button:focus-visible {
  background: rgba(255, 255, 255, 0.62);
  transform: translateY(-1px);
}

.swatch-button:active {
  transform: translateY(1px);
}

.swatch {
  position: relative;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(35, 49, 47, 0.38);
  font: 700 9px/1 var(--mono);
}

.swatch::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
}

.swatch-name {
  overflow: hidden;
  max-width: 100%;
  color: var(--ink-soft);
  font: 600 6.5px/1 var(--mono);
  letter-spacing: 0.06em;
  text-overflow: ellipsis;
  text-transform: uppercase;
}

[data-color="amber"] {
  --swatch-bg: #e7a94c;
  --swatch-ink: #2d1c06;
}

[data-color="coral"] {
  --swatch-bg: #e76f51;
  --swatch-ink: #2e0f09;
}

[data-color="tide"] {
  --swatch-bg: #64b6ac;
  --swatch-ink: #072622;
}

[data-color="iris"] {
  --swatch-bg: #a78bd4;
  --swatch-ink: #1b0f2b;
}

[data-color="moss"] {
  --swatch-bg: #a7b86b;
  --swatch-ink: #1c2308;
}

[data-color="bone"] {
  --swatch-bg: #e6ddc4;
  --swatch-ink: #2a2419;
}

.swatch[data-color],
.cell[data-color] {
  background: var(--swatch-bg);
  color: var(--swatch-ink);
}

.actions {
  max-width: 540px;
  margin: 20px auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.quiet-button,
.signal-button,
.tool-button {
  appearance: none;
  font: 700 8px/1.1 var(--mono);
  letter-spacing: 0.14em;
  cursor: pointer;
}

.quiet-button {
  border: 0;
  border-bottom: 1px solid rgba(35, 49, 47, 0.4);
  padding: 8px 0 5px;
  background: transparent;
  color: var(--ink-soft);
}

.signal-button {
  min-height: 42px;
  border: 1px solid var(--ink);
  border-radius: 1px;
  padding: 12px 20px;
  background: var(--ink);
  color: var(--paper);
  box-shadow: 3px 3px 0 rgba(35, 49, 47, 0.15);
  transition: background 130ms ease, transform 130ms ease, box-shadow 130ms ease;
}

.signal-button:hover:not(:disabled),
.signal-button:focus-visible:not(:disabled) {
  background: #384a44;
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 rgba(35, 49, 47, 0.15);
}

.signal-button:disabled {
  opacity: 0.32;
  cursor: default;
}

.status {
  min-height: 15px;
  max-width: 540px;
  margin: 15px auto 0;
  color: var(--ink-soft);
  font: 500 9px/1.4 var(--mono);
  letter-spacing: 0.02em;
  text-align: center;
}

.mobile-hint {
  display: none;
  margin: 14px 0 0;
  color: rgba(242, 233, 215, 0.44);
  font: 500 8px/1.5 var(--mono);
  letter-spacing: 0.04em;
  text-align: center;
}

kbd {
  border: 1px solid rgba(242, 233, 215, 0.28);
  border-radius: 2px;
  padding: 1px 4px;
  font: inherit;
}

.notes {
  position: sticky;
  top: 22px;
  padding-top: 7px;
}

.note-block {
  padding: 21px 0;
  border-top: 1px solid rgba(242, 233, 215, 0.18);
}

.note-block:first-child {
  border-top: 0;
  padding-top: 0;
}

.note-block h2 {
  margin-bottom: 14px;
  color: var(--paper);
  font-size: 31px;
}

.note-block p {
  margin: 0;
  color: rgba(242, 233, 215, 0.65);
  font-size: 12px;
  line-height: 1.72;
}

.rules-list {
  list-style: none;
  margin: 17px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rules-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: rgba(242, 233, 215, 0.66);
  font-size: 11.5px;
  line-height: 1.45;
}

.rules-list .feedback-dot {
  margin-top: 3px;
}

.rules-list strong {
  color: var(--paper);
  font-weight: 600;
}

.note-block .fine {
  padding-top: 13px;
  border-top: 1px solid rgba(242, 233, 215, 0.1);
  color: rgba(242, 233, 215, 0.42);
  font-size: 10.5px;
  line-height: 1.62;
}

.tool-button {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(214, 173, 91, 0.55);
  border-radius: 1px;
  padding: 11px 12px;
  background: transparent;
  color: var(--brass);
}

.tool-button + .hint-copy + .tool-button {
  margin-top: 10px;
}

.tool-button:hover:not(:disabled),
.tool-button:focus-visible:not(:disabled) {
  background: rgba(214, 173, 91, 0.08);
}

.tool-button:disabled {
  opacity: 0.35;
  cursor: default;
}

.tool-button.alt {
  color: rgba(242, 233, 215, 0.65);
  border-color: rgba(242, 233, 215, 0.24);
}

.hint-copy {
  min-height: 28px;
  margin: 9px 0 10px !important;
  color: rgba(242, 233, 215, 0.43) !important;
  font-size: 9.5px !important;
  line-height: 1.5 !important;
}

.hint-copy.revealed {
  color: var(--brass) !important;
}

.progress-track {
  height: 2px;
  margin: 17px 0 10px;
  background: rgba(242, 233, 215, 0.13);
}

.progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--brass);
  transition: width 600ms ease;
}

.progress-track span[data-step="1"] { width: 12.5%; }
.progress-track span[data-step="2"] { width: 25%; }
.progress-track span[data-step="3"] { width: 37.5%; }
.progress-track span[data-step="4"] { width: 50%; }
.progress-track span[data-step="5"] { width: 62.5%; }
.progress-track span[data-step="6"] { width: 75%; }
.progress-track span[data-step="7"] { width: 87.5%; }
.progress-track span[data-step="8"] { width: 100%; }

.progress-copy {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: rgba(242, 233, 215, 0.4) !important;
  font: 500 7px/1.3 var(--mono) !important;
  letter-spacing: 0.07em;
}

.signature {
  margin: 28px 0 0;
  color: rgba(242, 233, 215, 0.26);
  font-family: var(--serif);
  font-size: 11px;
  font-style: italic;
  line-height: 1.5;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 0 7px;
  border-top: 1px solid rgba(242, 233, 215, 0.16);
  color: rgba(242, 233, 215, 0.33);
  font: 500 7px/1.4 var(--mono);
  letter-spacing: 0.13em;
}

.footer p {
  margin: 0;
}

/* Dialogs */
.modal {
  width: min(520px, calc(100% - 30px));
  max-height: min(88dvh, 760px);
  overflow: auto;
  border: 1px solid rgba(214, 173, 91, 0.65);
  border-radius: 1px;
  padding: clamp(26px, 5vw, 42px);
  background:
    repeating-linear-gradient(0deg, transparent 0 27px, rgba(35, 49, 47, 0.03) 27px 28px),
    var(--paper);
  color: var(--ink);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.6);
}

.modal::backdrop {
  background: rgba(2, 9, 13, 0.8);
  backdrop-filter: blur(5px);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(35, 49, 47, 0.25);
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  font: 400 19px/1 var(--sans);
  cursor: pointer;
}

.modal-close:hover,
.modal-close:focus-visible {
  border-color: var(--ink);
  color: var(--ink);
}

.result-modal {
  text-align: center;
}

.modal .eyebrow {
  color: var(--brass-deep);
}

.modal h2 {
  margin-top: 3px;
  color: var(--ink);
  font-size: clamp(38px, 7vw, 55px);
}

.big-stars {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 18px 0 8px;
  color: var(--brass-deep);
  font-size: 30px;
  line-height: 1;
  letter-spacing: 0.04em;
}

.big-stars .empty {
  color: rgba(35, 49, 47, 0.18);
}

.result-copy {
  max-width: 340px;
  margin: 10px auto 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.65;
}

.reveal-secret {
  margin: 23px auto 0;
  padding: 17px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.reveal-secret .micro-label {
  margin-bottom: 12px;
}

.secret-swatches {
  display: flex;
  justify-content: center;
  gap: 9px;
}

.secret-swatches .swatch {
  width: 32px;
  height: 32px;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 11px;
  margin-top: 25px;
}

.modal-actions .signal-button {
  width: min(100%, 260px);
}

.modal-actions .quiet-button {
  align-self: center;
}

.night-modal {
  width: min(700px, calc(100% - 30px));
}

.modal-intro {
  max-width: 480px;
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.6;
}

.night-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 24px;
}

.night-choice {
  appearance: none;
  min-height: 79px;
  border: 1px solid rgba(35, 49, 47, 0.26);
  border-radius: 1px;
  padding: 13px 14px;
  background: rgba(255, 255, 255, 0.22);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.night-choice:hover:not(:disabled),
.night-choice:focus-visible:not(:disabled) {
  border-color: var(--brass-deep);
  background: rgba(255, 255, 255, 0.54);
}

.night-choice:disabled {
  opacity: 0.38;
  cursor: default;
}

.night-choice .choice-number {
  display: block;
  color: var(--brass-deep);
  font: 600 7px/1 var(--mono);
  letter-spacing: 0.13em;
}

.night-choice .choice-title {
  display: block;
  margin-top: 8px;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.05;
}

.night-choice .choice-stars {
  flex: 0 0 auto;
  color: var(--brass-deep);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.night-choice.current {
  box-shadow: inset 0 0 0 2px var(--brass-deep);
}

/* Feedback row animation */
@keyframes row-land {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes beam-drift {
  from { transform: rotate(17deg); opacity: 0.55; }
  to { transform: rotate(23deg); opacity: 0.8; }
}

button:focus-visible,
a:focus-visible {
  outline: 1px solid var(--brass);
  outline-offset: 3px;
}

.modal button:focus-visible {
  outline-color: var(--brass-deep);
}

@media (max-width: 960px) {
  .main-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .notes {
    position: static;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 26px;
    padding-top: 25px;
    border-top: 1px solid rgba(242, 233, 215, 0.18);
  }

  .note-block {
    border-top: 0;
    padding: 0;
  }

  .signature {
    display: none;
  }

  .note-block:nth-child(2) {
    order: 3;
  }

  .note-block:nth-child(3) {
    order: 2;
  }
}

@media (max-width: 700px) {
  .page {
    width: calc(100% - 28px);
    padding-top: max(12px, env(safe-area-inset-top));
  }

  .topbar {
    min-height: 39px;
    grid-template-columns: auto 1fr auto;
    gap: 14px;
    padding-bottom: 9px;
  }

  .top-actions {
    gap: 11px;
  }

  .top-button {
    font-size: 7px;
  }

  .main-grid {
    padding: 27px 0 31px;
    gap: 30px;
  }

  .night-header {
    margin-bottom: 18px;
    align-items: flex-start;
  }

  h1 {
    font-size: clamp(30px, 9.5vw, 42px);
    line-height: 1;
  }

  .night-subtitle {
    font-size: 13px;
    margin-top: 8px;
  }

  .night-stars {
    padding-top: 20px;
    font-size: 13px;
  }

  .logbook {
    padding: 24px 14px 21px;
    box-shadow: 4px 4px 0 rgba(3, 11, 15, 0.26);
  }

  .logbook-clip {
    right: 20px;
  }

  .log-head {
    font-size: 6px;
    letter-spacing: 0.1em;
  }

  .clue {
    margin: 15px 0 16px;
    font-size: 17px;
  }

  .feedback-head {
    grid-template-columns: 15px 1fr 48px;
    gap: 5px;
  }

  .guess-row {
    grid-template-columns: 15px repeat(4, minmax(0, 1fr)) 48px;
    gap: 5px;
    min-height: 42px;
  }

  .cell {
    min-height: 42px;
  }

  .row-feedback {
    padding-left: 0;
    font-size: 7px;
  }

  .fb-line {
    gap: 3px;
  }

  .palette {
    gap: 5px;
  }

  .swatch-button {
    padding: 7px 1px 6px;
  }

  .swatch {
    width: 22px;
    height: 22px;
  }

  .swatch-name {
    font-size: 5.8px;
  }

  .actions {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 10px;
  }

  .signal-button {
    width: 100%;
  }

  .quiet-button {
    align-self: center;
  }

  .status {
    margin-top: 13px;
    font-size: 8px;
  }

  .mobile-hint {
    display: block;
  }

  .notes {
    display: flex;
    flex-direction: column;
    gap: 23px;
    padding-top: 22px;
  }

  .note-block:nth-child(2) {
    order: initial;
  }

  .note-block:nth-child(3) {
    order: initial;
  }

  .note-block h2 {
    font-size: 26px;
  }

  .rules-list {
    margin: 13px 0;
  }

  .footer {
    flex-direction: column;
    gap: 5px;
    padding-bottom: 9px;
  }

  .night-grid {
    grid-template-columns: 1fr;
  }

  .modal {
    padding: 28px 20px 25px;
  }

  .result-modal h2 {
    font-size: 38px;
  }
}

@media (max-width: 370px) {
  .swatch-name {
    display: none;
  }

  .swatch-button {
    padding: 7px 1px;
  }

  .top-title {
    font-size: 8px;
  }

  .top-button {
    letter-spacing: 0.08em;
  }
}

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