/* The game has its own palette inside Merryturn's shared page shell. */
.ramble-game {
  --ramble-ink: #173c35;
  --ramble-muted: #466359;
  --ramble-line: #cfcebc;
  --ramble-deep: #143d34;
  --ramble-paper: #fffcf4;
  max-width: 896px;
  color: var(--ramble-ink);
}
.ramble-game input { font: inherit; }
.ramble-game button:disabled { opacity: .48; }
.ramble-game :focus-visible { outline: 3px solid #ba691c; outline-offset: 3px; }
.ramble-noscript { margin-top: 1rem; }

.ramble-cover {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, .94fr);
  min-height: 164px;
  overflow: hidden;
  border: 1px solid #254c41;
  border-radius: 18px 18px 0 0;
  background: var(--ramble-deep);
  color: #fcf4da;
}
.ramble-cover-text { padding: 24px 0 25px clamp(18px,4vw,34px); align-self: center; z-index: 1; }
.ramble-edition {
  margin: 0 0 .32rem;
  text-transform: uppercase;
  font-weight: 750;
  font-size: .72rem;
  letter-spacing: .12em;
  color: #f0c989;
}
.ramble-cover h1 { font: normal clamp(2.9rem,6.4vw,4.5rem)/.98 Georgia,serif; letter-spacing: -.06em; margin: 0; }
.ramble-cover-art { min-width: 0; position: relative; align-self: stretch; }
.ramble-cover-art svg {
  display: block;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
}

.ramble-board {
  background: var(--ramble-paper);
  border: 1px solid var(--ramble-line);
  border-top: 0;
  border-radius: 0 0 18px 18px;
  box-shadow: 0 7px 20px #38472a0c;
}

.ramble-toolbar {
  padding: 11px clamp(16px,4vw,32px);
  border-bottom: 1px solid var(--ramble-line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ramble-mode {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: #eae9da;
  border-radius: 9px;
}
.ramble-mode button {
  color: inherit;
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  padding: .45rem .78rem;
  font-size: .85rem;
  font-weight: 750;
}
.ramble-mode [aria-pressed=true] { background: #254c40; color: #fff9e8; box-shadow: 0 1px 2px #183d3622; }
.ramble-help-toggle {
  background: none;
  border: 0;
  min-height: 44px;
  padding: 8px 0 8px 8px;
  font-weight: 700;
  color: #355b50;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: .86rem;
}

.ramble-rules {
  padding: 12px clamp(16px,4vw,32px);
  background: #f1eddc;
  border-bottom: 1px solid var(--ramble-line);
  line-height: 1.5;
  font-size: .95rem;
}
.ramble-rules p { margin: .24em 0; }
.ramble-body-pad { padding: clamp(16px,3.8vw,32px); }

.ramble-clue-card {
  background: #f0eddc;
  border: 1px solid #d9d6be;
  border-left: 4px solid #bc6536;
  border-radius: 7px;
  padding: 13px 16px 15px;
}
.ramble-kicker {
  font-size: .71rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 800;
  color: #83512f;
  margin: 0 0 5px;
}
.ramble-clue-card h2 {
  font: normal clamp(1.38rem,3.1vw,2rem)/1.18 Georgia,serif;
  letter-spacing: -.026em;
  margin: 0;
  color: #263b30;
}
.ramble-instruction {
  margin: .85rem 0 1.15rem;
  color: var(--ramble-muted);
  line-height: 1.4;
  font-size: .95rem;
}

.ramble-play-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); gap: clamp(20px,5vw,48px); }
.ramble-word-panel { min-width: 0; }
.ramble-smallhead {
  display: block;
  font-size: .8rem;
  font-weight: 750;
  color: #355549;
  margin: 0 0 7px;
}

.ramble-position {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.ramble-tiles { display: flex; gap: 4px; }
.ramble-tile {
  display: grid;
  place-items: center;
  width: clamp(36px,5vw,47px);
  height: clamp(43px,5.5vw,52px);
  background: #244e41;
  border: 1px solid #214537;
  border-bottom: 3px solid #15372d;
  border-radius: 5px;
  color: #fffae4;
  font: 700 clamp(1.6rem,3.4vw,2.1rem)/1 Georgia,serif;
}
.ramble-tile.is-changed { background: #466954; }
.ramble-distance { display: grid; gap: 1px; line-height: 1.05; }
.ramble-distance strong { font: 700 1.45rem/1.1 Georgia,serif; color: #204b3c; }
.ramble-distance small { font-size: .73rem; line-height: 1.1; color: var(--ramble-muted); }
.ramble-typebox { display: flex; gap: 6px; max-width: 345px; }
.ramble-typebox input {
  width: 0;
  flex: 1;
  min-width: 80px;
  border: 1px solid #909e8b;
  border-radius: 7px;
  padding: 0 11px;
  min-height: 43px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ramble-ink);
  background: #fffefa;
  font-weight: 700;
  font-size: 16px;
}
.ramble-typebox input::placeholder {
  color: #6a776c;
  font-weight: 500;
  letter-spacing: .01em;
  text-transform: none;
}
.ramble-primary,.ramble-action {
  border: 1px solid #315645;
  border-radius: 7px;
  background: #295240;
  color: #fff9e6;
  padding: .58rem .9rem;
  font-weight: 750;
  min-height: 43px;
}
.ramble-picks { margin-top: 13px; }
.ramble-picks p { font-size: .8rem; margin-bottom: 6px; color: var(--ramble-muted); }
.ramble-choices { display: flex; gap: 5px; flex-wrap: wrap; }
.ramble-choice {
  background: #f7f4e7;
  border: 1px solid #b8c3ad;
  border-radius: 6px;
  color: #355445;
  min-height: 38px;
  padding: .35rem .65rem;
  font-size: .88rem;
  letter-spacing: .04em;
}
.ramble-choice b { color: #733e23; font-weight: 850; }
.ramble-choice:hover,.ramble-plain:hover { background: #eee8d5; }

.ramble-journal { border-left: 1px dashed #bcbfa9; padding-left: clamp(15px,3.5vw,32px); min-width: 0; }
.ramble-journal h3,.ramble-win h3 { font: normal 1.45rem/1.2 Georgia,serif; letter-spacing: -.02em; margin: 0; }
.ramble-trips { font-size: .82rem; color: var(--ramble-muted); margin: .24rem 0 .8rem; }
.ramble-trail {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  font-size: .83rem;
  font-weight: 700;
  letter-spacing: .055em;
  margin: 0;
  padding: 0;
  max-height: 7rem;
  overflow: auto;
}
.ramble-trail li { display: flex; align-items: center; gap: 5px; }
.ramble-trail li+li::before { content: '→'; color: #7c8a78; font-weight: 500; }
.ramble-trail li:last-child span { color: var(--ramble-deep); border-bottom: 2px solid #d3a75e; }
.ramble-trail span { padding: 3px 0; }
.ramble-trail-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: .9rem;
}
.ramble-plain {
  color: inherit;
  background: transparent;
  border: 1px solid #b9c1ac;
  border-radius: 7px;
  padding: .4rem .65rem;
  font-size: .82rem;
  min-height: 36px;
  font-weight: 700;
}
.ramble-feedback {
  font-size: .88rem;
  line-height: 1.35;
  color: #315e48;
  margin: .7rem 0 0;
}
.ramble-feedback:empty { margin: 0; }
.ramble-feedback[data-kind=error] { color: #903c25; }
.ramble-feedback[data-kind=win] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.ramble-win { margin: 0 0 15px; }
.ramble-win p { line-height: 1.45; margin: .4rem 0 .65rem; }
.ramble-win button { min-height: 40px; }
.ramble-save-note { color: #635038; font-size: .83rem; margin: 1rem 0 0; }

@media (max-width:650px) {
  .ramble-cover { min-height: 119px; grid-template-columns: 56% 44%; }
  .ramble-cover-text { padding: 16px 0 16px 16px; }
  .ramble-edition { font-size: .64rem; letter-spacing: .07em; }
  .ramble-cover h1 { font-size: clamp(2.12rem,8.1vw,3.4rem); }
  .ramble-play-grid { grid-template-columns: 1fr; gap: 18px; }
  .ramble-journal { border-left: 0; border-top: 1px dashed #bcbfa9; padding: 13px 0 0; }
  .ramble-journal h3 { font-size: 1.25rem; }
  .ramble-position { margin-bottom: 11px; }
  .ramble-instruction { margin: .7rem 0 1rem; }
  .ramble-toolbar { padding: 8px 14px; }
  .ramble-clue-card { padding: 11px 12px; }
  .ramble-typebox { max-width: none; }
  .ramble-choice { min-height: 43px; }
  .ramble-plain { min-height: 42px; }
  .ramble-trail-actions { margin-top: .65rem; }
  .ramble-body-pad { padding: 15px; }
}

@media (max-width:365px) {
  .ramble-cover { min-height: 97px; grid-template-columns: 59% 41%; }
  .ramble-cover-text { padding-left: 12px; }
  .ramble-edition { font-size: .6rem; letter-spacing: .025em; }
}

@media (prefers-reduced-motion:no-preference) {
  .ramble-choice,.ramble-primary,.ramble-plain { transition: background .12s ease; }
}
