/* The board shares the cards' night-sky palette, with quiet reading surfaces. */
:root {
  --night: #0a111e;
  --night-surface: #111d2d;
  --soft-gold: #e5c68b;
  --mist-teal: #75c4bd;
  --mist-violet: #a99ad6;
}

body {
  background:
    radial-gradient(ellipse 65% 650px at 95% 0, #5b448330, transparent 80%),
    radial-gradient(ellipse 55% 900px at 0 25%, #256c7230, transparent 80%),
    var(--night);
}

header { border-bottom-color: #c2b28429; }
.brandmark { color: var(--soft-gold); }
.branddot { color: #b9a4da; }
.nav { color: #b8c6d0; }
.nav.active { background: #28454c; color: #f0e3c9; }
.nav:hover { background: #29394a; color: #f4e9d7; }
.save { color: #bac5c9; }

.board {
  background:
    linear-gradient(110deg, #101a2bdd, #10222be3 50%, #211c32d9),
    url('assets/oracle-silk.webp') center / cover no-repeat;
  border-color: #c9b17b52;
  box-shadow: 0 20px 65px #0004, inset 0 1px 0 #f0cf8b14;
}

.game-actions {
  background: linear-gradient(110deg, #142332eb, #1e2235eb);
  border-color: #c6ad7430;
}
.game-actions #requestBox .eyebrow { color: #dfc695; }
.map-controls {
  background: #091422c9;
  border-color: #9aafb13d;
}
.map-controls button { color: #b5c5cc; }
.map-controls .selected { background: #28434a; color: #f1e3c5; }

.primary {
  background: linear-gradient(110deg, #e4be7f, #efd3a0);
  color: #261e16;
  box-shadow: inset 0 1px 0 #fff4d677, 0 6px 20px #050c142e;
}
.primary:hover { background: #f3d8a8; }
.primary:focus-visible { outline: 2px solid #fff0cc; outline-offset: 4px; }
.secondary { border-color: #9eaaa94d; color: #d6ddd9; }
.secondary:hover { background: #253b48; border-color: #b9b591; }
.action-cube .die-face { background: #fff0d1; }
.die-face .pip { background: #243947; }

/* The transparent gaps carry the artwork; sector text stays on a solid surface. */
.ring-cell > .sector-shape {
  fill: color-mix(in srgb, var(--cell-color) 12%, #111d2c);
  stroke: color-mix(in srgb, var(--cell-color) 43%, #344154);
}
.ring-cell.here > .sector-shape {
  fill: color-mix(in srgb, var(--cell-color) 25%, #111d2c);
  stroke: var(--cell-color);
}
.ring-cell[role=button]:hover > .sector-shape,
.ring-cell[role=button]:focus-visible > .sector-shape {
  fill: color-mix(in srgb, var(--cell-color) 24%, #111d2c);
  stroke: var(--cell-color);
}
.ring-cell.walking > .sector-shape { fill: #43533a; stroke: #efffc1; }
.ring-center {
  fill: #101b2a;
  stroke: color-mix(in srgb, var(--round-color, var(--stage-color, #c9b17b)) 45%, #16263a);
}
.ring-title { fill: #f2e4cb; }
.ring-subtitle { fill: #b9c9d0; }
dialog {
  background: linear-gradient(145deg, #18283b, #121b2a 70%, #222039);
  border-color: #c4ad7759;
}
dialog::backdrop { background: #030914c7; }
.deck-ritual .deck-stack > span {
  background: linear-gradient(145deg, #29364c, #152838);
}
.journal-stage, .rules-grid article, .notice {
  background: linear-gradient(135deg, #172a36, #192237);
  border-color: #a7b4bd33;
}
.journal-stage h2, .page h1 { color: #eee0c5; }
input, textarea, select { background-color: #0d1928; color: #e9eeeb; }
input:focus, textarea:focus, select:focus { border-color: #a2bdbb; }
footer { border-top-color: #c2b28429; color: #abbcc5; }

@media (max-width: 760px) {
  .board {
    background:
      linear-gradient(110deg, #101a2be3, #10222be8 50%, #211c32e0),
      url('assets/oracle-silk.webp') center top / 100% auto repeat-y,
      #101d2b;
  }
  }

@media (forced-colors: active) {
  .overview-round::before, .overview-round::after { display: none; }
  .primary, .nav.active { border: 1px solid ButtonText; }
}

/* A focused intention panel, scaled to the content rather than the full board. */
.game-actions:has(#requestBox:not([hidden])) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: center;
  gap: 40px;
  width: calc(100% - 48px);
  max-width: 1100px;
  margin: 20px auto 30px;
  padding: 30px 32px;
  border: 1px solid #bda67452;
  border-radius: 22px;
  background:
    radial-gradient(ellipse at 0 0, #2b657029, transparent 65%),
    linear-gradient(115deg, #142333f5, #1a2032f5);
  box-shadow: 0 12px 32px #02091126, inset 0 1px 0 #f0d29910;
  position: relative;
}
.game-actions:has(#requestBox:not([hidden]))::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 32px;
  width: min(180px, 40%);
  height: 1px;
  background: linear-gradient(90deg, transparent, #e4c582, transparent);
  pointer-events: none;
}
.game-actions #requestBox:not([hidden]) {
  position: relative;
  border: 0;
  max-width: none;
  min-width: 0;
  margin: 0;
  padding: 2px 0 2px 76px;
}
.game-actions #requestBox:not([hidden])::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  background: url('assets/request-sigil.svg') center / contain no-repeat;
  pointer-events: none;
}
.game-actions #requestBox .eyebrow {
  color: #cbb790;
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 1.4px;
}
.game-actions #requestBox p {
  color: #f0e6d4;
  font: 400 25px/1.45 Georgia, 'Times New Roman', serif;
  letter-spacing: -.2px;
  margin: 10px 0 0;
  text-wrap: pretty;
  overflow-wrap: anywhere;
}
.game-actions:has(#requestBox:not([hidden])) .play-actions {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding-left: 28px;
  border-left: 1px solid #c2ae7b2e;
}
.game-actions:has(#requestBox:not([hidden])) #play {
  min-height: 60px;
  font-size: 16px;
  padding: 16px 20px;
  border-radius: 13px;
}
.play-actions .journey-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 6px;
  margin-top: 12px;
}
.play-actions .journey-tools .text-btn {
  margin: 0;
  padding: 10px 8px;
  color: #b6c2cc;
  font-size: 12px;
  line-height: 1.5;
  min-height: 44px;
  border-radius: 8px;
}
.play-actions .journey-tools .text-btn:hover {
  color: #f1dfb8;
  background: #e1be7410;
}
.play-actions .journey-tools:has(> :not([hidden])) { border-top: 1px solid #c2ae7b22; padding-top: 8px; }
.play-actions .journey-tools:not(:has(> :not([hidden]))) { display: none; }

@media (max-width: 900px) {
  .game-actions:has(#requestBox:not([hidden])) {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 24px;
    padding: 26px 24px;
  }
  .game-actions #requestBox:not([hidden]) { padding-left: 60px; }
  .game-actions #requestBox:not([hidden])::before { width: 44px; height: 44px; }
  .game-actions #requestBox p { font-size: 23px; }
  .game-actions:has(#requestBox:not([hidden])) .play-actions { padding-left: 22px; }
}
@media (max-width: 700px) {
  .game-actions:has(#requestBox:not([hidden])) {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    width: calc(100% - 24px);
    margin: 18px auto 24px;
    padding: 24px 20px 16px;
    border-radius: 18px;
  }
  .game-actions #requestBox:not([hidden]) { padding-left: 56px; }
  .game-actions #requestBox p { font-size: 23px; line-height: 1.45; margin-top: 9px; }
  .game-actions:has(#requestBox:not([hidden])) .play-actions {
    padding: 22px 0 0;
    border-left: 0;
    border-top: 1px solid #c2ae7b2e;
  }
  .game-actions:has(#requestBox:not([hidden])) #play { font-size: 15px; min-height: 56px; padding: 15px 12px; }
  .play-actions .journey-tools { gap: 2px; margin-top: 10px; }
  .play-actions .journey-tools .text-btn { padding: 10px 6px; }
  .play-actions .journey-tools:has(> :not([hidden])) { border-top: 0; padding-top: 0; }
}

/* Supporting pages use texture at their edges and calm surfaces beneath text. */
.rules-grid { align-items: start; gap: 22px; }
.rules-grid .panel, .journal-stage, .mode-option, .result-query, .author-intention {
  position: relative;
  isolation: isolate;
  border-color: #bda6743d;
  background:
    radial-gradient(ellipse at 100% 0, #53417126, transparent 65%),
    linear-gradient(135deg, #142936, #172235);
}
.rules-grid .panel, .journal-stage { padding: 30px; }
.rules-grid .panel h2 { font: 400 28px/1.3 Georgia, serif; color: #eddbb6; margin: 0 0 20px; }
.rules-grid .panel p { font-size: 15px; line-height: 1.85; color: #c0cbd2; }
.rules-grid .panel::before, .journal-stage::before {
  content: '';
  position: absolute;
  top: 0;
  left: 28px;
  width: 90px;
  height: 1px;
  background: linear-gradient(90deg, #e3c78888, transparent);
  pointer-events: none;
}
.rules-grid .rules-intro {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  align-items: center;
  gap: 36px;
  padding: 34px 42px;
  background:
    linear-gradient(100deg, #10202eeb, #152137dd),
    url('assets/oracle-silk.webp') center / cover no-repeat;
  border-color: #c4ab7666;
  box-shadow: 0 10px 30px #02091126;
}
.rules-intro-copy { max-width: 68ch; }
.rules-grid .rules-intro h2 { font-size: 32px; margin-bottom: 15px; }
.rules-grid .rules-intro p { font-size: 18px; line-height: 1.8; margin: 0; color: #d2dadf; }
.rules-intro-mark {
  width: 130px;
  height: 130px;
  justify-self: center;
  background: url('assets/request-sigil.svg') center / contain no-repeat;
}
.mode-option { transition: border-color .2s, background .2s, box-shadow .25s, transform .25s; }
.empty {
  background: radial-gradient(ellipse at 50% 0, #6a4c6d26, transparent 70%), #122131;
  border-color: #bda67452;
}

/* Light follows focus and intent, without permanent pulsing or moving backgrounds. */
.primary, .ritual-save, #authorDialog .btn {
  transition: background .2s, box-shadow .25s, transform .2s, border-color .2s;
}
.nav, .secondary, .text-btn, .map-controls button, .author-entry, .close {
  transition: color .2s, background .2s, box-shadow .25s, border-color .2s;
}
.overview-round .journey-ring { transition: filter .3s; }
.ring-cell > .sector-shape { transition: fill .25s, stroke .25s, filter .25s; }
.primary:focus-visible, .ritual-save:focus-visible, #authorDialog .btn:focus-visible {
  box-shadow: 0 0 24px #edc57e36, 0 0 0 4px #e6c38910;
}
.ring-cell:focus-visible > .sector-shape { filter: drop-shadow(0 0 7px #e7cb7970); }
@media (hover: hover) and (pointer: fine) {
  .primary:not(:disabled):hover, .ritual-save:not(:disabled):hover, #authorDialog .btn:hover {
    box-shadow: 0 0 0 1px #f7d9a288, 0 0 30px #e9bd7547, 0 8px 22px #0003, inset 0 1px 0 #fff5d4aa;
    transform: translateY(-2px);
  }
  .secondary:hover, .nav:hover, .text-btn:hover, .map-controls button:hover, .author-entry:hover, .close:hover {
    box-shadow: 0 0 18px #e4c1811f;
  }
  .overview-round:hover .journey-ring {
    filter: drop-shadow(0 0 15px color-mix(in srgb, var(--round-color) 28%, transparent));
  }
  .ring-cell[role=button]:hover > .sector-shape {
    filter: drop-shadow(0 0 6px color-mix(in srgb, var(--cell-color) 50%, transparent));
  }
  .mode-option:hover { box-shadow: 0 0 24px #b0cce124; transform: translateY(-2px); }
}
.primary:not(:disabled):active, .ritual-save:not(:disabled):active, #authorDialog .btn:active { transform: translateY(0) scale(.99); }
@media (max-width: 760px) {
  .rules-grid .panel, .journal-stage { padding: 24px; }
  .rules-grid .rules-intro { grid-template-columns: minmax(0, 1fr) 90px; gap: 24px; padding: 28px; }
  .rules-intro-mark { width: 85px; height: 85px; }
}
@media (max-width: 480px) {
  .rules-grid .rules-intro { grid-template-columns: minmax(0, 1fr); padding: 26px 24px; gap: 24px; }
  .rules-intro-mark { grid-row: 1; justify-self: start; width: 64px; height: 64px; }
  .rules-grid .rules-intro h2 { font-size: 28px; }
  .rules-grid .rules-intro p { font-size: 17px; }
}
