/* Roman Road: play online. The deep blue of the decks and the orange and gold of the card backs, as on the product page.
   The four verses keep their own colours everywhere: red 3:23, orange 6:23, blue 5:8, green 10:13. */
.rr { --ink: #1b2238; --navy: #131f3d; --navy2: #1f3a6e; --gold: #f7be50; --pick: #f7be50; max-width: 1180px; margin: 0 auto; }
.rr-name { font: 800 1.6rem/1 Georgia, serif; color: var(--navy2); text-decoration: none; }
[hidden] { display: none !important; }
.rr-steps { padding-left: 1.1rem; }
.rr-steps li { margin-bottom: .35rem; }

/* the deck chooser */
.rr-decks { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.rr-deck { border: 3px solid #dee2e6; border-radius: .6rem; background: #fff; padding: .35rem .2rem .3rem; text-align: center; font-size: .8rem; font-weight: 700; cursor: pointer; line-height: 1.2; }
.rr-deck img { display: block; width: 64%; max-width: 70px; margin: 0 auto .2rem; }
.rr-deck small { display: block; font-weight: 500; color: #5c636a; }
.rr-deck[aria-checked="true"] { border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 30%, transparent); }

/* ---------- the game ---------- */
#game { background: linear-gradient(170deg, #0e1733 0%, var(--navy) 40%, #1a3160 100%); border-radius: .9rem; padding: .5rem; color: #eef1fb; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
@media (min-width: 768px) { #game { padding: .8rem; } }

/* the players and the controls */
.rr-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; margin-bottom: .5rem; }
.rr-chips { display: flex; flex-wrap: wrap; gap: .35rem; flex: 1 1 auto; }
.rr-chip { display: flex; align-items: center; gap: .4rem; padding: .2rem .55rem .2rem .25rem; border: 2px solid color-mix(in srgb, var(--c) 70%, #fff 0%); border-radius: .6rem; background: rgba(255,255,255,.07); font-size: .78rem; line-height: 1.15; min-width: 0; }
.rr-chip img { width: 1.35rem; height: auto; flex: none; }
.rr-chip b { display: block; font-size: .85rem; }
.rr-chip .sub { color: #b9c3e6; white-space: nowrap; }
.rr-chip .pts { margin-left: .15rem; font: 800 1.15rem/1 Georgia, serif; color: #fff; }
.rr-chip.me { background: rgba(247,190,80,.16); }
.rr-chip.flash { animation: rr-flash .9s ease-out; }
.rr-chip.amen { box-shadow: 0 0 0 3px var(--gold); }
@keyframes rr-flash { 0% { background: color-mix(in srgb, var(--c) 55%, transparent); } 100% { background: rgba(255,255,255,.07); } }
.rr-ctl { display: flex; align-items: center; gap: .3rem; margin-left: auto; font-size: .8rem; color: #b9c3e6; }
.rr-ctl button { border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.08); color: #fff; border-radius: .5rem; padding: .25rem .55rem; font-size: .8rem; cursor: pointer; }
.rr-ctl button:hover, .rr-ctl button:focus-visible { background: rgba(255,255,255,.2); }

/* the table: the reading panel and the middle */
.rr-table { position: relative; display: grid; gap: .5rem; }
@media (min-width: 992px) { .rr-table { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); } }

/* the Road: the gospel as it is played */
.rr-road { position: relative; overflow: hidden; border-radius: .7rem; background: radial-gradient(120% 140% at 50% 0%, #1a2a5a 0%, #0c1330 75%); border: 1px solid rgba(255,255,255,.12); padding: .3rem .7rem .6rem; }
.rr-stream { position: relative; height: 5.6rem; }
.rr-sw { position: absolute; top: 0; left: 50%; white-space: nowrap; font: 700 clamp(1.3rem, 5vw, 1.9rem)/1.05 Georgia, serif; color: var(--g); text-shadow: 0 0 .55em color-mix(in srgb, var(--g) 70%, transparent), 0 0 1.4em color-mix(in srgb, var(--g) 40%, transparent); animation: rr-rise 4.6s ease-out forwards; pointer-events: none; }
.rr-sw small { display: block; text-align: center; font: 600 .62rem/1.3 system-ui, sans-serif; letter-spacing: .04em; color: #cfd8f8; opacity: .85; text-shadow: none; }
.rr-sw.mine { font-size: clamp(1.5rem, 5.6vw, 2.2rem); }
@keyframes rr-rise {
  0% { opacity: 0; transform: translateY(.9rem) scale(.88); filter: blur(3px); }
  10% { opacity: 1; transform: translateY(0) scale(1.06); filter: blur(0); }
  22% { transform: translateY(0) scale(1); }
  68% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-1.6rem) scale(1); }
}
.rr-verses { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.rr-v { display: flex; align-items: baseline; gap: .55rem; font: 600 .86rem/1.55 Georgia, serif; }
@media (min-width: 768px) { .rr-v { font-size: 1rem; } }
.rr-ref { flex: none; width: 4.7rem; text-align: center; border: 0; border-radius: 1rem; padding: .05rem .3rem; background: var(--g); color: #0e1530; font: 800 .68rem/1.5 system-ui, sans-serif; cursor: pointer; }
.rr-ref:hover, .rr-ref:focus-visible { filter: brightness(1.12); outline: 2px solid #fff; }
.rr-vw { min-width: 0; }
.rr-vw .w { display: inline-block; margin-right: .22em; color: transparent; background: rgba(255,255,255,.1); border-radius: .3em; user-select: none; }
.rr-vw .w.on { color: var(--g); background: none; }
.rr-vw .w.lit { animation: rr-lit 4.2s ease-out; }
@keyframes rr-lit {
  0% { color: #fff; background: none; transform: scale(1.18); text-shadow: 0 0 .5em var(--g), 0 0 1.2em var(--g); }
  100% { color: var(--g); transform: none; text-shadow: 0 0 0 transparent; }
}
.rr-v.done .rr-ref::after { content: " \2713"; }
.rr-v.done .w.on { text-shadow: 0 0 .7em color-mix(in srgb, var(--g) 55%, transparent); }
.rr-pop { position: absolute; inset: 0; display: grid; place-items: center; padding: .6rem; pointer-events: none; }
.rr-pop > div { max-width: 34rem; text-align: center; padding: .7rem 1rem; border-radius: .8rem; background: rgba(8,12,32,.93); border: 2px solid var(--g); box-shadow: 0 0 2rem color-mix(in srgb, var(--g) 45%, transparent); animation: rr-pop 7s ease-out forwards; }
.rr-pop .t { font: 700 clamp(1.05rem, 3.6vw, 1.5rem)/1.35 Georgia, serif; color: var(--g); }
.rr-pop .r { font: 800 .75rem/1.6 system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; color: #fff; }
@keyframes rr-pop { 0% { opacity: 0; transform: scale(.92); } 6% { opacity: 1; transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }

/* the middle: the verses being built, 1 to 8 */
.rr-found { display: grid; gap: .3rem; align-content: start; }
.rr-frow { display: flex; align-items: center; gap: .5rem; padding: .3rem .5rem; border-radius: .55rem; background: rgba(255,255,255,.06); border-left: 5px solid var(--c); }
.rr-flabel { flex: none; width: 4.7rem; font: 800 .74rem/1.2 system-ui, sans-serif; color: var(--g); }
.rr-flabel small { display: block; font-weight: 600; color: #b9c3e6; }
.rr-fpiles { display: flex; flex-wrap: wrap; gap: .35rem; }
.rr-tile { position: relative; width: 2.35rem; height: 2.9rem; border-radius: .4rem; background: #fff; border: 3px solid var(--c); color: var(--c); display: grid; place-items: center; font: 800 1.35rem/1 Georgia, serif; }
.rr-tile::after { content: ""; position: absolute; right: -.25rem; bottom: -.25rem; width: .7rem; height: .7rem; border-radius: 50%; background: var(--o, #888); border: 2px solid #0e1733; }
.rr-tile.empty { background: transparent; border: 2px dashed rgba(255,255,255,.22); }
.rr-tile.empty::after { display: none; }
.rr-tile.new { animation: rr-pulse .8s ease-out; }
@keyframes rr-pulse { 0% { transform: scale(1.35); box-shadow: 0 0 1.2rem var(--c); } 100% { transform: none; box-shadow: none; } }
@media (min-width: 768px) { .rr-tile { width: 3rem; height: 3.6rem; font-size: 1.7rem; } .rr-flabel { width: 5.4rem; } }

/* the veil: get ready, Amen, paused */
.rr-veil { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; background: rgba(8,12,32,.72); border-radius: .7rem; text-align: center; }
.rr-veil-in .big { font: 800 clamp(2.2rem, 10vw, 4.4rem)/1.1 Georgia, serif; color: var(--gold); text-shadow: 0 0 1rem rgba(247,190,80,.55); }
.rr-veil-in .small { font-size: 1rem; color: #dbe2ff; }
.rr-veil-in button { margin-top: .7rem; }
.rr-veil.go { animation: rr-go .6s ease-out forwards; }
@keyframes rr-go { to { opacity: 0; } }

/* ---------- my cards ---------- */
.rr-me { --gap: .45rem; --cw: calc((100vw - 1rem - 1rem - 2 * var(--gap)) / 3); --ch: calc(var(--cw) * .71); --step: calc(var(--cw) * .215);
  display: grid; grid-template-columns: repeat(3, var(--cw)); gap: .5rem var(--gap); justify-content: center; margin-top: .6rem; padding: .5rem 0 .3rem; }
@media (min-width: 768px) { .rr-me { --cw: clamp(92px, 11vw, 132px); --gap: .7rem; grid-template-columns: repeat(6, var(--cw)); } .rr-store { order: -1; } }
.rr-cap { display: block; font: 700 .68rem/1.2 system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; color: #aeb9e0; margin-bottom: .2rem; }
.rr-cap i { font-style: normal; color: #fff; }

.rc { position: relative; display: block; width: var(--cw); aspect-ratio: 320 / 227; padding: 0; border: 0; border-radius: calc(var(--cw) * .065) calc(var(--cw) * .065) 0 0; background: #fff; overflow: hidden; cursor: pointer; box-shadow: 0 2px 5px rgba(0,0,0,.45); -webkit-tap-highlight-color: transparent; }
.rc img { display: block; width: 100%; height: 100%; pointer-events: none; }
.rc:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.rc.can { box-shadow: 0 0 0 3px var(--pick), 0 0 .9rem 2px rgba(247,190,80,.75); }
.rc.sel { box-shadow: 0 0 0 4px #fff, 0 0 1.1rem 3px rgba(255,255,255,.85); transform: translateY(-3px); }
.rr-work { position: relative; width: var(--cw); height: calc(var(--ch) + (var(--len, 1) - 1) * var(--step)); }
.rr-work .rc { position: absolute; left: 0; top: calc(var(--j) * var(--step)); }
.rr-work .rc.sel { transform: translateY(-3px); }
.rr-slot { display: block; width: var(--cw); height: var(--ch); border: 2px dashed rgba(255,255,255,.28); border-radius: calc(var(--cw) * .065); background: transparent; color: rgba(255,255,255,.5); font-size: .8rem; padding: 0; cursor: pointer; }
.rr-slot.drop { border-color: var(--pick); background: rgba(247,190,80,.14); box-shadow: 0 0 .9rem rgba(247,190,80,.5); }
.rr-work.drop .rc:last-child { box-shadow: 0 0 0 3px var(--pick), 0 0 .9rem 2px rgba(247,190,80,.75); }
.rr-stack { position: relative; width: var(--cw); }
.rr-stack.deep::before, .rr-stack.deep::after { content: ""; position: absolute; left: 0; width: var(--cw); height: var(--ch); border-radius: calc(var(--cw) * .065); background: #cfd6ea; z-index: 0; }
.rr-stack.deep::before { top: 4px; left: 3px; } .rr-stack.deep::after { top: 8px; left: 6px; background: #aab4d2; }
.rr-stack.deep.few::after { display: none; }
.rr-stack .rc { z-index: 1; }
.rr-badge { position: absolute; z-index: 2; right: .25rem; bottom: .2rem; min-width: 1.5rem; padding: 0 .3rem; border-radius: 1rem; background: rgba(14,23,51,.88); color: #fff; font: 800 .8rem/1.5 system-ui, sans-serif; text-align: center; pointer-events: none; }
.rr-deckbtn { position: relative; display: block; width: var(--cw); height: var(--ch); padding: 0; border: 0; background: transparent; cursor: pointer; }
.rr-deckbtn img { position: absolute; left: 50%; top: 0; height: calc(var(--ch) * 1.18); width: auto; transform: translateX(-50%); object-fit: cover; object-position: top; clip-path: inset(0 0 15% 0 round 8px); filter: drop-shadow(0 2px 4px rgba(0,0,0,.5)); }
.rr-deckbtn.empty img { opacity: .18; }
.rr-deckbtn .again { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.8rem; color: #fff; text-shadow: 0 0 .5rem #000; }
.rr-deckbtn:focus-visible { outline: 3px solid #fff; border-radius: 8px; }
.rr-done { width: var(--cw); height: var(--ch); display: grid; place-items: center; border-radius: calc(var(--cw) * .065); border: 2px solid var(--gold); color: var(--gold); font: 800 1.1rem/1.2 Georgia, serif; text-align: center; background: rgba(247,190,80,.1); }

.rr-msg { min-height: 1.4rem; margin: .3rem 0 0; text-align: center; font-size: .88rem; color: #dbe2ff; }

/* the end of a hand */
.rr-dialog { border: 0; border-radius: .8rem; max-width: min(94vw, 36rem); width: 100%; padding: 1rem 1.2rem; box-shadow: 0 10px 40px rgba(0,0,0,.4); }
.rr-dialog { max-height: 92vh; overflow-y: auto; position: relative; }
.rr-x { position: absolute; top: .4rem; right: .6rem; border: 0; background: none; font-size: 1.8rem; line-height: 1; color: #5c636a; cursor: pointer; }
.rr-dialog::backdrop { background: rgba(0,0,0,.55); }
.rr-score { width: 100%; font-size: .9rem; border-collapse: collapse; }
.rr-score th, .rr-score td { padding: .25rem .4rem; text-align: right; border-bottom: 1px solid #e3e6ec; }
.rr-score th:first-child, .rr-score td:first-child { text-align: left; }
.rr-score tr.win td { background: #fff7e0; font-weight: 700; }
.rr-told { list-style: none; padding: 0; margin: .7rem 0 0; font: 600 .86rem/1.45 Georgia, serif; background: #0e1733; border-radius: .6rem; padding: .6rem .8rem; }
.rr-told li { color: var(--g); margin-bottom: .15rem; }
.rr-told .w { color: transparent; background: rgba(255,255,255,.12); border-radius: .3em; margin-right: .2em; display: inline-block; }
.rr-told .w.on { color: var(--g); background: none; }
.rr-told small { font: 700 .68rem system-ui, sans-serif; color: #fff; margin-left: .3rem; }

@media (prefers-reduced-motion: reduce) {
  .rr-sw { animation-duration: 5s; animation-name: rr-fade; }
  .rr-vw .w.lit, .rr-tile.new, .rr-chip.flash { animation: none; }
  @keyframes rr-fade { 0% { opacity: 0; } 12% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; } }
}
