:root {
  color-scheme: dark;
  --ink: #142b30;
  --paper: #f5eddb;
  --muted: #a4bbb9;
  --line: #c8e1d221;
  --gold: #eeb878;
  --coral: #e58a76;
  --mint: #d8e1c0;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background:
    radial-gradient(ellipse at 80% 0, #24505255, transparent 50%), var(--ink);
  color: var(--paper);
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}
button {
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}
button:disabled {
  cursor: default;
}
button:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 5px;
}
button,
summary {
  -webkit-tap-highlight-color: transparent;
}
main {
  max-width: 1050px;
  margin: auto;
  padding: 0 34px 28px;
}
.masthead {
  height: 81px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand {
  letter-spacing: 0.17em;
  font-size: 11px;
  font-weight: 800;
}
.brand i {
  color: var(--gold);
  font-style: normal;
  margin: 0 10px;
}
.quiet {
  background: none;
  color: var(--muted);
  border: 0;
  font-size: 12px;
  padding: 12px 0 12px 18px;
}
.quiet span {
  display: inline-grid;
  place-items: center;
  margin-left: 10px;
  border: 1px solid #829d9580;
  border-radius: 50%;
  width: 22px;
  height: 22px;
}
.introduction {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 35px 0 29px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 0.19em;
  color: var(--gold);
  font-weight: 700;
  margin: 0 0 5px;
}
h1 {
  font:
    normal 80px/0.98 Georgia,
    serif;
  letter-spacing: -0.065em;
  margin: 0;
}
h1 span {
  color: var(--coral);
}
.tagline {
  font:
    20px/1.45 Georgia,
    serif;
  color: #d1d9c9;
  margin: 12px 5px 0 20px;
}
.play-area {
  position: relative;
  border-radius: 24px;
  border: 1px solid #809a843f;
  background:
    radial-gradient(ellipse at 50% 20%, #2b515053, transparent 70%), #10272b;
  box-shadow: 0 18px 55px #05171b60;
  overflow: hidden;
}
.table-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 29px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.table-top b {
  color: var(--paper);
  font-size: 18px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  margin-right: 5px;
}
.turn-indicator {
  color: var(--gold);
  font-size: 10px;
  letter-spacing: 0.17em;
  font-weight: 800;
}
.turn-indicator:before {
  content: "";
  display: inline-block;
  background: currentColor;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 9px;
  vertical-align: 2px;
}
.rows {
  max-width: 750px;
  margin: 14px auto 8px;
  padding: 0 28px 15px;
}
.row {
  min-height: 100px;
  display: grid;
  grid-template-columns: 85px 1fr;
  align-items: center;
  border-bottom: 1px solid #9ac6ae0e;
}
.row:last-child {
  border-bottom: 0;
}
.row-label {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.12em;
  line-height: 1.5;
}
.row-label b {
  display: block;
  font:
    21px/1.2 Georgia,
    serif;
  color: var(--paper);
  letter-spacing: 0;
  margin-bottom: 2px;
}
.pebbles {
  display: flex;
  gap: 15px;
  justify-content: center;
  align-items: center;
  min-height: 86px;
}
.pebble {
  position: relative;
  flex: 0 0 54px;
  width: 54px;
  height: 64px;
  border: 0;
  border-radius: 46% 49% 45% 48%;
  color: #473e31;
  background:
    radial-gradient(ellipse at 32% 24%, #ffffff5c 0 7%, transparent 9%),
    linear-gradient(130deg, #fff2 9%, transparent 55%), var(--stone);
  box-shadow:
    inset -5px -7px 9px #362b3320,
    inset 2px 2px 2px #fff3,
    0 9px 0 var(--shadow),
    0 14px 11px #0006;
  transform: rotate(var(--angle));
  transition:
    transform 0.18s,
    box-shadow 0.18s,
    opacity 0.18s;
}
.pebble:nth-child(2n) {
  --angle: 4deg;
}
.pebble:nth-child(2n + 1) {
  --angle: -5deg;
}
.pebble:hover:enabled {
  transform: translateY(-4px) rotate(var(--angle));
}
.pebble.selected {
  transform: translateY(-9px) rotate(var(--angle));
  outline: 2px solid var(--paper);
  outline-offset: 5px;
  box-shadow:
    inset -5px -7px 9px #362b3320,
    inset 2px 2px 2px #fff3,
    0 9px 0 var(--shadow),
    0 22px 16px #0006;
}
.pebble.selected:after {
  content: "−";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #503726a6;
  font-size: 26px;
}
.pebble:disabled {
  opacity: 0.85;
}
.row[data-row="0"] {
  --stone: var(--gold);
  --shadow: #9f724c;
}
.row[data-row="1"] {
  --stone: var(--coral);
  --shadow: #9d5349;
}
.row[data-row="2"] {
  --stone: var(--mint);
  --shadow: #839789;
}
.empty-row {
  width: 100%;
  text-align: center;
  color: #90aea256;
  font-size: 12px;
  letter-spacing: 0.12em;
}
.move-bar {
  border-top: 1px solid var(--line);
  background: #213c392b;
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 19px 29px;
}
.move-bar p {
  margin: 0 0 3px;
  font-size: 14px;
}
.move-bar #selection-note {
  color: var(--muted);
  font-size: 11px;
}
.primary {
  border: 0;
  background: var(--gold);
  color: #20322e;
  padding: 15px 24px;
  font-weight: 800;
  border-radius: 9px;
  white-space: nowrap;
  min-width: 190px;
  box-shadow: 0 3px 0 #9a754b;
}
.primary span {
  margin-left: 20px;
}
.primary:disabled {
  background: #496059;
  color: #a2b4a6;
  box-shadow: none;
}
.primary:not(:disabled):hover {
  background: #f5c78c;
}
.settings {
  display: flex;
  align-items: center;
  gap: 46px;
  padding: 28px 3px 22px;
}
.field-label {
  display: block;
  color: #94aaa5;
  letter-spacing: 0.13em;
  font-size: 9px;
  font-weight: 800;
  margin-bottom: 9px;
}
.switch {
  display: flex;
  border: 1px solid #779a8847;
  border-radius: 8px;
  padding: 3px;
  gap: 3px;
}
.switch button {
  border: 0;
  background: none;
  color: #a8bcb3;
  font-size: 12px;
  padding: 9px 21px;
  border-radius: 5px;
}
.switch button[aria-pressed="true"] {
  color: var(--ink);
  background: #e8dec6;
  box-shadow: 0 2px 7px #0003;
}
.restart-setting {
  margin-left: auto;
}
.restart {
  background: none;
  color: #dedfc9;
  border: 1px solid #78998747;
  border-radius: 8px;
  padding: 12px 21px;
  font-size: 12px;
}
.restart:hover {
  background: #7f9f8720;
}
.below-table {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 3px;
}
.hint-toggle {
  color: var(--gold);
  background: none;
  border: 0;
  padding: 10px 0;
  font-size: 12px;
}
.keyboard-note {
  font-size: 10px;
  color: #91a7a0;
  letter-spacing: 0.04em;
}
.hint {
  margin: 10px 0 20px;
  padding: 18px 22px;
  background: #39514566;
  border-left: 2px solid var(--gold);
  border-radius: 2px 9px 9px 2px;
  max-width: 720px;
  color: #d3dfd0;
  font-size: 13px;
  line-height: 1.7;
}
.hint strong {
  color: var(--gold);
}
.history {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
  min-height: 24px;
}
.history span {
  padding: 4px 9px;
  background: #799e8010;
  color: #9bb4a6;
  font-size: 10px;
  border-radius: 4px;
}
.result {
  margin: 0 28px 20px;
  background: #e4d7b714;
  border: 1px solid #dec39144;
  border-radius: 12px;
  padding: 17px 25px;
  text-align: center;
}
.result h2 {
  font:
    32px Georgia,
    serif;
  color: var(--gold);
  margin: 0 0 4px;
}
.result p {
  font-size: 12px;
  color: #d0decf;
  margin: 0;
}
details {
  margin-top: 25px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
summary {
  padding: 21px 3px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 700;
}
summary span {
  float: right;
  color: #98b0a8;
  font-size: 11px;
  font-weight: 400;
  margin: 0 12px;
}
.rules-copy {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 38px;
  padding: 0 3px 22px;
  color: #a8bdb1;
  font-size: 12px;
  line-height: 1.8;
}
.rules-copy h2 {
  font:
    20px Georgia,
    serif;
  color: #e7e7d1;
  font-weight: 400;
}
.rules-copy strong {
  color: #d9e1ca;
}
footer {
  display: flex;
  justify-content: space-between;
  padding-top: 20px;
  font-size: 9px;
  color: #7f9a8e;
  letter-spacing: 0.13em;
}
footer span {
  letter-spacing: 0;
  font-size: 10px;
}
::selection {
  background: #d48c69;
  color: var(--ink);
}
[hidden] {
  display: none !important;
}
@media (max-width: 760px) {
  main {
    padding: 0 22px 25px;
  }
  .pebbles {
    gap: 12px;
  }
  .pebble {
    flex-basis: 44px;
    width: 44px;
    height: 54px;
  }
  .row {
    grid-template-columns: 64px 1fr;
  }
  .rows {
    padding: 0 18px 15px;
  }
  .settings {
    gap: 24px;
  }
  .switch button {
    padding: 9px 15px;
  }
  .tagline {
    font-size: 18px;
  }
  .move-bar {
    padding: 19px 22px;
  }
  .primary {
    min-width: 170px;
    padding: 15px 18px;
  }
}
@media (max-width: 520px) {
  main {
    padding: 0 16px 25px;
  }
  .masthead {
    height: 64px;
  }
  .brand {
    font-size: 10px;
  }
  .quiet {
    font-size: 11px;
  }
  .introduction {
    padding: 28px 2px 25px;
    align-items: end;
  }
  .eyebrow {
    font-size: 8px;
    letter-spacing: 0.15em;
  }
  h1 {
    font-size: 67px;
  }
  .tagline {
    font-size: 15px;
    margin: 0 0 3px 12px;
  }
  .play-area {
    border-radius: 17px;
  }
  .table-top {
    margin: 0 18px;
    padding: 17px 0;
  }
  .table-top b {
    font-size: 16px;
  }
  .table-top {
    font-size: 10px;
  }
  .turn-indicator {
    font-size: 9px;
  }
  .rows {
    padding: 8px 14px 10px;
    margin: 0;
  }
  .row {
    display: block;
    min-height: 108px;
    padding: 11px 0 5px;
  }
  .row-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 8px;
    margin: 0 4px 5px;
  }
  .row-label b {
    display: inline;
    font:
      11px "Avenir Next",
      Avenir,
      sans-serif;
    letter-spacing: 0.1em;
  }
  .pebbles {
    gap: 8px;
    min-height: 66px;
  }
  .pebble {
    flex-basis: 34px;
    width: 34px;
    height: 43px;
    box-shadow:
      inset -4px -6px 6px #362b3320,
      inset 2px 2px 2px #fff3,
      0 7px 0 var(--shadow),
      0 10px 8px #0005;
  }
  .pebble.selected {
    outline-offset: 3px;
    transform: translateY(-6px) rotate(var(--angle));
  }
  .move-bar {
    display: block;
    padding: 16px 18px 19px;
    min-height: 136px;
  }
  .move-bar p {
    font-size: 12px;
    line-height: 1.5;
    min-height: 18px;
  }
  .move-bar #selection-note {
    font-size: 10px;
  }
  .primary {
    width: 100%;
    margin-top: 13px;
    padding: 12px 17px;
    display: flex;
    justify-content: space-between;
  }
  .settings {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px 13px;
    padding: 22px 2px 13px;
  }
  .switch {
    display: flex;
  }
  .switch button {
    padding: 8px 10px;
    flex: 1;
    font-size: 11px;
    min-height: 37px;
  }
  .field-label {
    font-size: 8px;
  }
  .restart-setting {
    grid-column: 1/-1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-left: 0;
  }
  .restart-setting .field-label {
    display: none;
  }
  .restart {
    padding: 8px 18px;
    min-height: 38px;
  }
  .below-table {
    gap: 5px;
  }
  .hint-toggle {
    font-size: 11px;
  }
  .keyboard-note {
    font-size: 9px;
  }
  .hint {
    padding: 14px 17px;
    font-size: 12px;
  }
  .rules-copy {
    grid-template-columns: 1fr;
    gap: 0;
  }
  summary span {
    font-size: 9px;
    margin-right: 1px;
  }
  .result {
    margin: 5px 17px 19px;
    padding: 16px;
  }
  .result h2 {
    font-size: 29px;
  }
  .history {
    margin-top: 13px;
    gap: 5px;
  }
  .history span {
    font-size: 9px;
  }
  footer {
    font-size: 7px;
    gap: 15px;
  }
  footer span {
    font-size: 9px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
