/* Runes: stone and cold silver. Slate around, pebbles with the runes cut in
   and inlaid with silver, a linen bag they come out of. The shell is in
   base.css; here its colors are switched to slate. */

.o-runes {
  --bg: #0d0f12;
  --ink: #e2e6ea;
  --muted: #a3abb4;
  --faint: #6f7782;
  --gold: #c9d1d9;
  --gold-hi: #eef2f6;
  --line: rgba(201, 209, 217, 0.28);
  --silver: #cfd7de;
  --stone-w: clamp(64px, 19vw, 92px);
  background:
    radial-gradient(120% 55% at 50% -10%, #262c34 0%, #161a1f 50%, rgba(13, 15, 18, 0) 80%),
    var(--bg);
}

.o-runes .lang option {
  background: #1d2228;
}

.rn {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 14px var(--gutter) 0;
  text-align: center;
}

.rn-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(38px, 11vw, 58px);
  line-height: 1.1;
  letter-spacing: 0.08em;
  color: var(--silver);
  background: linear-gradient(180deg, #ffffff 0%, #c9d1d9 55%, #7d8892 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.6));
}

.rn-subtitle {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  color: var(--muted);
}

.rn-h {
  margin: 30px 0 12px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--gold-hi);
}

/* ---------- spreads ---------- */

.rn-spreads {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.rn-spread {
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background-color 0.15s;
}

.rn-spread:hover {
  color: var(--ink);
  border-color: rgba(201, 209, 217, 0.6);
}

.rn-spread[aria-pressed="true"] {
  color: #10141a;
  border-color: var(--silver);
  background: var(--silver);
}

/* ---------- the bag ---------- */

.rn-bag-wrap {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.rn-bag {
  width: 112px;
  height: 112px;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.6));
  transform-origin: 50% 85%;
}

.rn-bag-body {
  fill: url(#rn-cloth);
  stroke: #1a1e23;
  stroke-width: 1.5;
}

.rn-bag-neck {
  fill: #5a636e;
  stroke: #1a1e23;
  stroke-width: 1.5;
}

.rn-bag-cord {
  fill: none;
  stroke: var(--silver);
  stroke-width: 2.4;
  stroke-linecap: round;
}

.rn-bag-fold {
  fill: none;
  stroke: rgba(0, 0, 0, 0.3);
  stroke-width: 1.4;
  stroke-linecap: round;
}

.rn-bag.shake {
  animation: rn-shake 0.6s ease-in-out;
}

@keyframes rn-shake {
  20% {
    transform: rotate(-8deg);
  }
  40% {
    transform: rotate(7deg);
  }
  60% {
    transform: rotate(-5deg);
  }
  80% {
    transform: rotate(3deg);
  }
}

.rn-actions {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

.rn-btn {
  min-width: min(100%, 280px);
  min-height: 52px;
  padding: 14px 32px;
  border: 1px solid #e6ecf1;
  border-radius: 999px;
  color: #10141a;
  background: linear-gradient(180deg, #f3f6f8 0%, #c9d1d9 55%, #9aa5af 100%);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: transform 0.12s, filter 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.rn-btn:hover {
  filter: brightness(1.05);
}

.rn-btn:active {
  transform: translateY(1px);
}

.rn-btn:disabled {
  filter: brightness(0.75);
  cursor: default;
  transform: none;
}

.rn-hint,
.rn-note {
  max-width: 480px;
  margin: 12px auto 0;
  font-size: 14px;
  color: var(--faint);
  text-wrap: balance;
}

.rn-note {
  color: var(--muted);
}

/* ---------- the table of stones ---------- */

.rn-table {
  display: grid;
  grid-template-columns: repeat(var(--cols, 1), var(--stone-w));
  grid-template-rows: repeat(var(--rows, 1), auto);
  justify-content: center;
  gap: 14px 18px;
  margin: 26px auto 0;
}

.rn-table:empty {
  display: none;
}

.rn-day {
  --stone-w: clamp(96px, 30vw, 128px);
}

.rn-cell {
  position: relative;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.rn-stone {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 80 / 110;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.55));
}

.rn-pebble {
  fill: url(#rn-stone);
  stroke: #2b3036;
  stroke-width: 1.2;
}

.rn-pebble-shade {
  fill: url(#rn-shade);
}

.rn-groove,
.rn-inlay,
.rn-glint {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rn-groove {
  stroke: rgba(10, 12, 15, 0.75);
  stroke-width: 9;
}

.rn-inlay {
  stroke: var(--silver);
  stroke-width: 6;
}

.rn-glint {
  stroke: rgba(255, 255, 255, 0.75);
  stroke-width: 1.6;
}

.rn-cell-n {
  position: absolute;
  bottom: -2px;
  inset-inline-end: -4px;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #2a3037;
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

/* ---------- readings ---------- */

.rn-readings {
  display: grid;
  gap: 14px;
  margin-top: 22px;
  text-align: start;
}

.rn-readings:empty {
  display: none;
}

.rn-reading {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  scroll-margin-top: 12px;
}

.rn-reading-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.rn-stone-small {
  flex: none;
  width: 48px;
}

.rn-names {
  min-width: 0;
}

.rn-pos {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

.rn-name {
  margin: 2px 0 0;
  font-family: var(--serif);
  font-size: 23px;
  line-height: 1.2;
  color: var(--gold-hi);
}

.rn-rev {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #e0a35f;
}

.rn-meaning {
  margin: 2px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  color: var(--muted);
}

.rn-text {
  margin: 12px 0 0;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.5;
}

.rn-kw,
.rn-poem {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

.rn-label {
  font-weight: 600;
  color: var(--ink);
}

.o-runes .status {
  margin-top: 18px;
}

.rn-how {
  margin: 40px auto 0;
  text-align: start;
}

.rn-how .rn-h {
  text-align: center;
}

.rn-how p {
  margin: 0 0 12px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
}

.o-runes .noscript {
  color: var(--muted);
}

:is(:lang(ar), :lang(he), :lang(ka), :lang(hy)) :is(.rn-subtitle, .rn-meaning) {
  font-style: normal;
}

:is(:lang(ka), :lang(ar)) .rn-pos {
  text-transform: none;
  letter-spacing: 0;
}
