/* Hooley game tools (gethooley.com/game-tools, Nov 24): the hub and the tool
   pages. Loaded after /site.css; colours come from its variables, so the
   pages follow light and dark like the rest of the site. Each tool's own
   look is further down, under its name. */

.gt-crumb { max-width: 1120px; margin: 0 auto; padding: 14px 20px 0; font-size: 14px; color: var(--muted); }
.gt-crumb a { color: inherit; }
.gt-hero { padding: 18px 0 8px; text-align: center; }
.gt-hero h1 { font-size: clamp(30px, 4.6vw, 46px); font-weight: 800; letter-spacing: -.035em; }
.gt-hero .lead { margin: 10px auto 0; font-size: 18px; color: var(--muted); max-width: 600px; }
section.gt-tool { padding: 18px 0 28px; }

/* The stage: the card the tool lives in. */
.gt-stage {
  position: relative; max-width: 760px; margin: 0 auto; border-radius: 28px; padding: 58px 20px 20px;
  background: var(--card); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); overflow: hidden;
}
.gt-stage:fullscreen, .gt-stage.gt-full {
  max-width: none; width: 100%; height: 100%; border-radius: 0; overflow: auto;
  display: flex; flex-direction: column; justify-content: center;
}
.gt-stage.gt-full { position: fixed; inset: 0; z-index: 90; }
.gt-top { position: absolute; top: 12px; right: 12px; display: flex; gap: 6px; z-index: 3; }
.gt-icon {
  width: 40px; height: 40px; border-radius: 12px; border: 0; cursor: pointer; font-size: 18px; line-height: 1;
  background: color-mix(in srgb, var(--text) 7%, transparent); color: var(--text); display: grid; place-items: center;
}
.gt-icon:hover { background: color-mix(in srgb, var(--text) 13%, transparent); }
.gt-icon[aria-pressed="false"] { opacity: .55; }
.gt-icon svg { width: 20px; height: 20px; }

.gt-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }
.gt-row + .gt-row { margin-top: 12px; }
.gt-chip {
  font: inherit; font-weight: 700; font-size: 15px; padding: 9px 15px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--bg-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); min-height: 40px;
}
.gt-chip:hover { box-shadow: inset 0 0 0 1.5px var(--accent); }
.gt-chip[aria-pressed="true"], .gt-chip.on { background: var(--accent-ink); color: var(--accent-text); box-shadow: none; }
.gt-btn {
  font: inherit; font-weight: 800; font-size: 17px; padding: 13px 26px; border-radius: 16px; border: 0; cursor: pointer; min-width: 120px;
  background: var(--accent-ink); color: var(--accent-text); box-shadow: 0 4px 0 color-mix(in srgb, var(--accent-ink) 60%, #000);
  transition: transform .08s ease, box-shadow .08s ease;
}
.gt-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 color-mix(in srgb, var(--accent-ink) 60%, #000); }
.gt-btn.alt { background: var(--bg-2); color: var(--text); box-shadow: 0 4px 0 var(--line), inset 0 0 0 1px var(--line); }
.gt-btn.alt:active { box-shadow: 0 1px 0 var(--line), inset 0 0 0 1px var(--line); }
.gt-btn.small { font-size: 15px; padding: 10px 16px; min-width: 0; border-radius: 13px; }
.gt-btn:focus-visible, .gt-chip:focus-visible, .gt-icon:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.gt-num {
  font: inherit; font-weight: 700; font-size: 16px; width: 68px; padding: 9px 8px; text-align: center; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--bg); color: var(--text);
}
.gt-num:focus-visible, .gt-text:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.gt-label { font-size: 14px; font-weight: 700; color: var(--muted); }
.gt-time { font-variant-numeric: tabular-nums; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.gt-note { text-align: center; color: var(--muted); font-size: 14px; margin: 10px 0 0; min-height: 20px; }
.gt-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Under the tool: how to, also known as, questions, more tools. */
.gt-about { padding: 28px 0 8px; }
.gt-about .wrap { max-width: 800px; }
.gt-about h2 { font-size: 24px; letter-spacing: -.02em; margin: 26px 0 10px; }
.gt-about p, .gt-about li { color: var(--muted); font-size: 16.5px; }
.gt-about ol, .gt-about ul { padding-left: 22px; margin: 0; }
.gt-about li { margin: 6px 0; }
.gt-about .aka { font-size: 15px; }
.gt-about .faq { padding: 0; }
.gt-about .faq .list-q { margin: 0; }
.gt-more { padding: 8px 0 40px; }
.gt-more h2 { font-size: 20px; margin-bottom: 12px; }
.gt-links { display: flex; flex-wrap: wrap; gap: 10px; }
.gt-links a { text-decoration: none; color: var(--text); font-weight: 600; font-size: 15px; padding: 10px 16px; border-radius: 999px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.gt-links a:hover { box-shadow: inset 0 0 0 1.5px var(--accent); }
.gt-links a[aria-current] { background: var(--soft); }

/* The hub. */
.gt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 900px) { .gt-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .gt-grid { grid-template-columns: 1fr; } }
.gt-card {
  display: flex; flex-direction: column; text-decoration: none; color: inherit; background: var(--card); border-radius: 22px; overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--line); transition: transform .2s ease, box-shadow .2s ease;
}
a.gt-card:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 1.5px var(--accent), var(--shadow); }
.gt-card .art { height: 150px; display: grid; place-items: center; }
.gt-card .art svg { height: 112px; width: auto; }
.gt-card .txt { padding: 16px 20px 20px; }
.gt-card h2 { font-size: 20px; letter-spacing: -.02em; }
.gt-card p { margin: 6px 0 0; color: var(--muted); font-size: 15.5px; }
.gt-card .go { display: inline-block; margin-top: 10px; font-weight: 700; color: var(--accent); }
.gt-sub { margin: 44px 0 14px; font-size: 22px; letter-spacing: -.02em; }
.art-sand { background: linear-gradient(160deg, #fde9c4, #f8c98a); }
.art-ring { background: linear-gradient(160deg, #d5f2ec, #a5e0d5); }
.art-wood { background: linear-gradient(160deg, #e9d3b5, #cfa878); }
.art-party { background: linear-gradient(160deg, #ffd9e2, #ffb3c4); }
.art-coin { background: linear-gradient(160deg, #dfe7f5, #b9c8e6); }
.art-felt { background: linear-gradient(160deg, #bfe6cf, #86cba3); }
.art-board { background: linear-gradient(160deg, #e3dcff, #c2b4ff); }

.gt-confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 95; }

@media (prefers-reduced-motion: reduce) {
  .gt-stage *, .gt-stage *::before, .gt-stage *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media print { .gt-top, .ad-row { display: none !important; } }
@media (max-width: 520px) { .gt-row > .gt-label:first-child { flex-basis: 100%; text-align: center; } }
@media (min-width: 1000px) { .gt-grid.four { grid-template-columns: repeat(4, 1fr); } .gt-grid.four .gt-card .art { height: 130px; } .gt-grid.four .gt-card .art svg { height: 96px; } }
/* Very narrow phones: the menu keeps Game tools and Get Hooley. */
@media (max-width: 380px) { .site-head .nav a[href="/games"].nav-keep { display: none; } }

/* ---- Hourglass ---- */
.hg { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 12px 28px; align-items: center; }
@media (max-width: 680px) { .hg { grid-template-columns: 1fr; } }
.hg-glass { background: none; border: 0; padding: 0; cursor: pointer; display: block; width: 100%; max-width: 300px; margin: 0 auto; border-radius: 20px; -webkit-tap-highlight-color: transparent; }
.hg-glass:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.hg-glass svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 14px 18px rgba(60, 35, 10, .22)); max-height: 56vh; }
.gt-stage:fullscreen .hg-glass svg, .gt-full .hg-glass svg { max-height: 70vh; }
#hg-turn { transform-origin: 100px 150px; transform-box: view-box; }
#hg-turn.turning { transition: transform .75s cubic-bezier(.5, -0.25, .3, 1.25); transform: rotate(180deg); }
.hg-glassfill { fill: color-mix(in srgb, #bfe3f5 26%, transparent); }
.hg-glassline { fill: none; stroke: color-mix(in srgb, var(--text) 30%, #9fc4d6); stroke-width: 2.5; }
.hg-stream { stroke: var(--hg-b); stroke-width: 2.6; stroke-dasharray: 3 3; stroke-linecap: round; opacity: 0; }
.hg.running .hg-stream { opacity: 1; animation: hg-fall .22s linear infinite; }
@keyframes hg-fall { to { stroke-dashoffset: -6; } }
.hg-grains circle { fill: var(--hg-b); opacity: 0; }
.hg.running .hg-grains circle { animation: hg-hop .5s ease-out infinite; }
.hg-grains circle:nth-child(2) { animation-delay: .12s !important; --dx: -9px; }
.hg-grains circle:nth-child(3) { animation-delay: .25s !important; --dx: 6px; }
.hg-grains circle:nth-child(4) { animation-delay: .37s !important; --dx: -5px; }
@keyframes hg-hop { 0% { opacity: 1; transform: translate(0, 0); } 100% { opacity: 0; transform: translate(var(--dx, 9px), -9px); } }
.hg { --hg-a: #e9a23b; --hg-b: #f7c873; }
.hg[data-c="rose"] { --hg-a: #e2607c; --hg-b: #f6a0b3; }
.hg[data-c="teal"] { --hg-a: #169c8d; --hg-b: #63d2c4; }
.hg[data-c="blue"] { --hg-a: #4a6fe0; --hg-b: #93acff; }
.hg[data-c="white"] { --hg-a: #cfc8ba; --hg-b: #f4efe4; }
#hg-sand .s1 { stop-color: var(--hg-a); } #hg-sand .s2 { stop-color: var(--hg-b); }
.hg-time { font-size: clamp(56px, 13vw, 92px); text-align: center; }
.hg.done .hg-time { color: var(--rose); animation: hg-pulse .7s ease-in-out infinite alternate; }
@keyframes hg-pulse { to { transform: scale(1.06); } }
.hg-side .gt-row { margin-top: 12px; }
.hg-sw { width: 30px; height: 30px; border-radius: 50%; border: 0; cursor: pointer; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .12); }
.hg-sw[data-c="amber"] { background: #f0b352; } .hg-sw[data-c="rose"] { background: #ec8099; } .hg-sw[data-c="teal"] { background: #3bb7a8; }
.hg-sw[data-c="blue"] { background: #6f8cf0; } .hg-sw[data-c="white"] { background: #ebe5d8; }
.hg-sw[aria-pressed="true"] { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (max-width: 680px) { .hg-glass { max-width: 210px; } .hg-glass svg { max-height: 42vh; } }

/* ---- Countdown timer ---- */
.cd { text-align: center; }
.cd-dial { position: relative; width: min(100%, 340px, 52vh); margin: 0 auto 14px; aspect-ratio: 1; }
.gt-stage:fullscreen .cd-dial, .gt-full .cd-dial { width: min(92vw, 68vh); }
.cd-dial svg { width: 100%; height: 100%; display: block; }
.cd-track { fill: none; stroke: var(--bg-2); stroke-width: 14; }
.cd-ring { fill: none; stroke: var(--accent-2); stroke-width: 14; stroke-linecap: round; transition: stroke .4s; }
.cd-knob { fill: #fff; stroke: var(--accent-2); stroke-width: 5; transform-origin: 120px 120px; transition: stroke .4s; }
.cd-ticks line { stroke: var(--line); stroke-width: 2; stroke-linecap: round; }
.cd-ticks line.big { stroke: var(--muted); stroke-width: 2.5; }
.cd-mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.cd-time { font-size: clamp(44px, 15vw, 76px); container-type: normal; }
.cd-time.long { font-size: clamp(34px, 11vw, 56px); }
.gt-stage:fullscreen .cd-time, .gt-full .cd-time { font-size: min(17vw, 15vh); }
.cd-sub { margin-top: 6px; font-weight: 700; color: var(--muted); font-size: 15px; }
.cd.low .cd-ring, .cd.low .cd-knob { stroke: var(--rose); }
.cd.low .cd-time { color: var(--rose); }
.cd.beat .cd-time { animation: cd-beat .28s ease-out; }
@keyframes cd-beat { 0% { transform: scale(1.09); } 100% { transform: scale(1); } }
.cd.done .cd-dial { animation: cd-ring .5s ease-in-out infinite; }
.cd.done .cd-ring { stroke: var(--rose); }
@keyframes cd-ring { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-5deg); } 40% { transform: rotate(5deg); } 60% { transform: rotate(-3deg); } 80% { transform: rotate(3deg); } }
.cd-own label { display: inline-flex; flex-direction: column; gap: 3px; align-items: center; }

/* ---- Chess clock ---- */
.cc {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: stretch; padding: 14px; border-radius: 22px; margin-top: 18px;
  background: linear-gradient(180deg, #b0763d, #8a5527 55%, #6d3f19); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .25), inset 0 -4px 0 rgba(0, 0, 0, .25), 0 12px 22px rgba(60, 35, 10, .25);
}
.cc-side {
  position: relative; font: inherit; color: #2a1c0f; border: 0; cursor: pointer; padding: 0; border-radius: 16px; background: none; -webkit-tap-highlight-color: transparent;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.cc-side:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.cc-in {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 10px 14px; border-radius: 16px; height: 100%;
  background: #f6ecd9; box-shadow: inset 0 0 0 3px #5b3716, inset 0 0 0 5px rgba(255, 255, 255, .5); transition: background .2s, box-shadow .2s;
}
.cc-plunger {
  position: absolute; left: 50%; top: -26px; width: 64px; height: 22px; margin-left: -32px; border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, #d9dde3, #9ba3ad); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .7), 0 2px 0 rgba(0, 0, 0, .2); transition: transform .12s ease-out;
  transform: translateY(12px);
}
.cc-side.on .cc-plunger { transform: translateY(0); }
.cc-side.on .cc-in { background: #fffbe9; box-shadow: inset 0 0 0 3px #5b3716, inset 0 0 0 5px #fff, 0 0 0 4px #ffd34d; }
.cc-face { width: min(100%, 150px); height: auto; }
.cc-rim { fill: #5b3716; } .cc-dial { fill: #fffdf6; }
.cc-marks line { stroke: #2a1c0f; stroke-width: 1.6; stroke-linecap: round; }
.cc-marks line.big { stroke-width: 3; }
.cc-hand { stroke: #2a1c0f; stroke-width: 3; stroke-linecap: round; transform-origin: 60px 60px; }
.cc-pin { fill: #b3261e; }
.cc-flag { fill: #d6332a; transform-origin: 60px 14px; transition: transform .35s cubic-bezier(.5, 0, .8, .4); }
.cc-side.flagged .cc-flag { transform: rotate(-92deg); }
.cc-read { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.cc-who { font-weight: 700; font-size: 14px; opacity: .7; }
.cc-time { font-size: clamp(38px, 9vw, 60px); }
.cc-moves { font-size: 13px; font-weight: 600; opacity: .65; }
.cc-side.low .cc-time { color: #c0271f; }
.cc-side.low.on .cc-in { animation: cc-low .5s ease-in-out infinite alternate; }
@keyframes cc-low { to { background: #ffe1dc; } }
.cc-side.flagged .cc-in { background: #f7c9c3; }
.cc-side.flagged .cc-time { color: #c0271f; }
.cc-mid { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; width: 110px; }
.cc-msg { color: #fff5e3; font-weight: 700; font-size: 13.5px; text-align: center; text-shadow: 0 1px 0 rgba(0, 0, 0, .35); }
.gt-stage:fullscreen .cc, .gt-full .cc { flex: 1; max-height: 78vh; }
.gt-stage:fullscreen .cc-face, .gt-full .cc-face { width: min(100%, 30vh); }
@media (max-width: 680px) {
  .cc { grid-template-columns: 1fr; margin-top: 0; }
  .cc-in { flex-direction: row; justify-content: center; gap: 18px; padding: 18px 12px; min-height: 24vh; }
  .cc-face { width: 104px; flex: none; }
  .cc-plunger { display: none; }
  #cc-a { transform: rotate(180deg); }
  .cc-mid { flex-direction: row; width: auto; }
  .cc-msg { flex: 1; min-width: 0; }
  .cc-mid .gt-btn { padding: 10px 12px; }
  .cc-time { font-size: clamp(44px, 14vw, 64px); }
}

/* ---- Party round timer ---- */
.rt { text-align: center; }
.rt-turn { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 22px; letter-spacing: -.02em; padding: 8px 18px; border-radius: 999px; background: var(--bg-2); }
.rt-dot { width: 16px; height: 16px; border-radius: 50%; background: var(--rt-c, #ef7f95); }
.rt-round { font-size: 14px; font-weight: 700; color: var(--muted); }
.rt-turn.swap { animation: rt-swap .45s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes rt-swap { 0% { transform: translateX(40px) scale(.9); opacity: 0; } 100% { transform: none; opacity: 1; } }
.rt-scene { max-width: 460px; margin: 6px auto 0; }
.rt-scene svg { width: 100%; height: auto; display: block; overflow: visible; }
.gt-stage:fullscreen .rt-scene, .gt-full .rt-scene { max-width: min(90vw, 80vh); }
.rt-fuse { fill: none; stroke: #8a5a34; stroke-width: 6; stroke-linecap: round; }
.rt-ash { fill: none; stroke: color-mix(in srgb, var(--text) 16%, transparent); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 2 7; }
.rt-rays { animation: rt-spin .5s linear infinite; }
.rt-spark { filter: drop-shadow(0 0 6px #ffb020); }
.rt.idle .rt-rays, .rt.paused .rt-rays { animation-play-state: paused; opacity: .4; }
.rt.done .rt-spark { display: none; }
@keyframes rt-spin { 0% { transform: rotate(0) scale(1); } 50% { transform: rotate(25deg) scale(1.25); } 100% { transform: rotate(45deg) scale(1); } }
.rt-popper { transform-origin: 40px 160px; transform-box: view-box; }
.rt.running.low .rt-popper { animation: rt-shake .25s linear infinite; }
@keyframes rt-shake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-2.5deg); } 75% { transform: rotate(2.5deg); } }
.rt.done .rt-popper { animation: rt-pop .5s cubic-bezier(.2, 1.8, .4, 1); }
@keyframes rt-pop { 0% { transform: scale(1); } 30% { transform: scale(1.28) rotate(-6deg); } 100% { transform: scale(1); } }
.rt-burst { opacity: 0; transform-origin: 84px 126px; transform-box: view-box; transform: scale(.2); }
.rt.done .rt-burst { animation: rt-burst .7s cubic-bezier(.1, .9, .3, 1) forwards; }
@keyframes rt-burst { 0% { opacity: 0; transform: scale(.2); } 30% { opacity: 1; } 100% { opacity: 1; transform: scale(1); } }
.rt-time { font-size: clamp(60px, 16vw, 96px); margin-top: 4px; }
.gt-stage:fullscreen .rt-time, .gt-full .rt-time { font-size: min(22vw, 18vh); }
.rt.low .rt-time { color: var(--rose); }
.rt.beat .rt-time { animation: cd-beat .28s ease-out; }
.rt.done .rt-time { color: var(--rose); animation: hg-pulse .5s ease-in-out infinite alternate; }

/* ---- Coin flip ---- */
.cf { text-align: center; }
.cf-air { position: relative; height: 372px; display: flex; align-items: flex-end; justify-content: center; perspective: 900px; }
.gt-stage:fullscreen .cf-air, .gt-full .cf-air { height: 52vh; }
.cf-coin { position: relative; z-index: 1; width: 190px; height: 190px; margin-bottom: 26px; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 50%; -webkit-tap-highlight-color: transparent; transform-style: preserve-3d; }
.cf-coin:focus-visible { outline: 3px solid var(--accent); outline-offset: 6px; }
.cf-spin { position: absolute; inset: 0; transform-style: preserve-3d; display: block; }
.cf-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 50%; }
.cf-face svg { width: 100%; height: 100%; display: block; }
.cf-heads { transform: translateZ(5px); }
.cf-tails { transform: rotateX(180deg) translateZ(5px); }
/* The coin's thickness: a stack of discs between the two faces. */
.cf-edge, .cf-edge::before, .cf-edge::after { position: absolute; inset: 0; border-radius: 50%; background: repeating-conic-gradient(#8e97a4 0 1.5deg, #c9cfd8 1.5deg 3deg); content: ""; }
.cf-edge { transform: translateZ(0); transform-style: preserve-3d; }
.cf-edge::before { transform: translateZ(3.4px); } .cf-edge::after { transform: translateZ(-3.4px); }
.q-txt { font-family: Georgia, "Times New Roman", serif; font-weight: 700; fill: #6a7381; paint-order: stroke; stroke: rgba(255, 255, 255, .55); stroke-width: .6px; }
.cf-shadow { position: absolute; bottom: 8px; left: 50%; width: 170px; height: 20px; margin-left: -85px; border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 0, 0, .28), transparent); }
.cf-result { font-size: clamp(30px, 8vw, 44px); font-weight: 800; letter-spacing: -.03em; min-height: 54px; }
.cf-result.pop { animation: cf-pop .45s cubic-bezier(.2, 1.7, .4, 1); }
@keyframes cf-pop { 0% { transform: scale(.5); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.cf-tally { display: flex; justify-content: center; gap: 12px; margin-top: 16px; }
.cf-tally div { background: var(--bg-2); border-radius: 14px; padding: 10px 6px; width: 92px; }
.cf-tally b { display: block; font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cf-tally span { font-size: 13px; font-weight: 700; color: var(--muted); }
.cf-last { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; margin: 12px auto 4px; min-height: 30px; max-width: 420px; }
.cf-last i { font-style: normal; font-weight: 800; font-size: 13px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(140deg, #f1f3f6, #b9c0cb); color: #4f5866; }
.cf-last i.t { background: linear-gradient(140deg, #dfe3e9, #9aa3b0); }
.cf-last i:first-child { outline: 2px solid var(--accent); outline-offset: 1px; animation: cf-pop .4s cubic-bezier(.2, 1.7, .4, 1); }

/* ---- Dice roller ---- */
.dr { text-align: center; --die: #fbfbf7; --die-2: #dcdcd3; --pip: #1b2a27; }
.dr[data-c="red"] { --die: #e8414f; --die-2: #b82535; --pip: #fff; }
.dr[data-c="blue"] { --die: #3f6fe6; --die-2: #2a4fb3; --pip: #fff; }
.dr[data-c="black"] { --die: #2c3038; --die-2: #14161b; --pip: #ffd34d; }
.dr[data-c="gold"] { --die: #f3c64e; --die-2: #c9972a; --pip: #3a2a05; }
.dr-tray {
  display: block; width: 100%; border: 0; cursor: pointer; padding: 26px 12px 30px; border-radius: 22px; min-height: 250px; -webkit-tap-highlight-color: transparent;
  background: radial-gradient(120% 90% at 50% 20%, #2f9a6b, #1c6b49 70%, #14523a); box-shadow: inset 0 0 0 8px #7a4a22, inset 0 0 0 10px #a0683a, inset 0 14px 30px rgba(0, 0, 0, .3);
  display: flex; align-items: center; justify-content: center;
}
.dr-tray:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.gt-stage:fullscreen .dr-tray, .gt-full .dr-tray { min-height: 46vh; }
.dr-dice { display: flex; flex-wrap: wrap; gap: 30px 34px; justify-content: center; align-items: center; perspective: 900px; max-width: 420px; }
.dr-slot { position: relative; width: 78px; height: 78px; }
.dr-slot::after { content: ""; position: absolute; left: 4%; right: 4%; bottom: -16px; height: 16px; border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 0, 0, .4), transparent); }
.dr-tilt { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(-22deg) rotateY(-20deg); }
.dr-cube { position: absolute; inset: 0; transform-style: preserve-3d; }
.dr-f {
  position: absolute; inset: 0; border-radius: 14px; background: linear-gradient(145deg, var(--die), var(--die-2)); box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, .12), inset 0 0 14px rgba(0, 0, 0, .08);
  display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 11px; backface-visibility: hidden;
}
.dr-f i { width: 13px; height: 13px; border-radius: 50%; background: var(--pip); place-self: center; box-shadow: inset 0 2px 2px rgba(0, 0, 0, .3); }
.dr-f.f1 { transform: translateZ(39px); } .dr-f.f6 { transform: rotateY(180deg) translateZ(39px); }
.dr-f.f2 { transform: rotateY(90deg) translateZ(39px); } .dr-f.f5 { transform: rotateY(-90deg) translateZ(39px); }
.dr-f.f3 { transform: rotateX(90deg) translateZ(39px); } .dr-f.f4 { transform: rotateX(-90deg) translateZ(39px); }
.dr-f.f1 i { grid-area: 2 / 2; width: 17px; height: 17px; }
/* Many-sided dice: a cut gem with the number on it. */
.dr-poly { position: absolute; inset: -6px; }
.dr-poly svg { width: 100%; height: 100%; display: block; overflow: visible; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .25)); }
.dr-poly .a { fill: var(--die); } .dr-poly .b { fill: var(--die-2); } .dr-poly .l { fill: none; stroke: rgba(0, 0, 0, .18); stroke-width: 1.5; stroke-linejoin: round; }
.dr-poly text { font: 800 30px "Inter", system-ui, sans-serif; fill: var(--pip); text-anchor: middle; dominant-baseline: central; }
.dr-poly text.sm { font-size: 22px; }
.dr-poly.max .a { fill: #ffd34d; } .dr-poly.max text { fill: #3a2a05; } .dr-poly.min .a { fill: #f4a39b; } .dr-poly.min text { fill: #5c120c; }
.dr-total { font-size: clamp(26px, 7vw, 40px); font-weight: 800; letter-spacing: -.03em; margin-top: 14px; min-height: 50px; }
.dr-total small { display: block; font-size: 15px; font-weight: 700; color: var(--muted); letter-spacing: 0; }
.dr-total.pop { animation: cf-pop .4s cubic-bezier(.2, 1.7, .4, 1); }
.dr-sw { width: 30px; height: 30px; border-radius: 9px; border: 0; cursor: pointer; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .15); }
.dr-sw[data-c="white"] { background: #fbfbf7; } .dr-sw[data-c="red"] { background: #e8414f; } .dr-sw[data-c="blue"] { background: #3f6fe6; }
.dr-sw[data-c="black"] { background: #2c3038; } .dr-sw[data-c="gold"] { background: #f3c64e; }
.dr-sw[aria-pressed="true"] { outline: 3px solid var(--accent); outline-offset: 2px; }
.dr-log { list-style: none; padding: 0; margin: 14px auto 0; max-width: 420px; text-align: left; }
.dr-log li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 12px; border-radius: 10px; font-size: 14.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.dr-log li:nth-child(odd) { background: var(--bg-2); }
.dr-log li b { color: var(--text); }
@media (max-width: 420px) { .dr-dice { gap: 28px 26px; } .dr-slot { width: 68px; height: 68px; } .dr-f { padding: 9px; border-radius: 12px; }
  .dr-f.f1 { transform: translateZ(34px); } .dr-f.f6 { transform: rotateY(180deg) translateZ(34px); } .dr-f.f2 { transform: rotateY(90deg) translateZ(34px); }
  .dr-f.f5 { transform: rotateY(-90deg) translateZ(34px); } .dr-f.f3 { transform: rotateX(90deg) translateZ(34px); } .dr-f.f4 { transform: rotateX(-90deg) translateZ(34px); } .dr-f i { width: 11px; height: 11px; } }

/* ---- Score keeper ---- */
.sk-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; }
.sk-p {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 10px; padding: 12px 12px 12px 18px; border-radius: 18px;
  background: var(--bg-2); box-shadow: inset 6px 0 0 var(--c), inset 0 0 0 1px var(--line); transition: transform .35s cubic-bezier(.3, 1.3, .5, 1), box-shadow .25s, background .25s;
}
.sk-p.lead { background: color-mix(in srgb, var(--c) 14%, var(--card)); box-shadow: inset 6px 0 0 var(--c), inset 0 0 0 2px var(--c); }
.sk-name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.sk-crown { font-size: 22px; width: 0; opacity: 0; transform: translateY(-14px) rotate(-30deg) scale(.3); transition: all .4s cubic-bezier(.2, 1.8, .4, 1); }
.sk-p.lead .sk-crown { width: 26px; opacity: 1; transform: none; }
.gt-text { font: inherit; font-weight: 700; font-size: 17px; color: var(--text); background: transparent; border: 0; border-bottom: 1.5px dashed transparent; padding: 4px 2px; width: 100%; min-width: 0; border-radius: 4px; }
.gt-text:hover { border-bottom-color: var(--line); }
.sk-x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 18px; width: 30px; height: 30px; border-radius: 8px; flex: none; }
.sk-x:hover { background: color-mix(in srgb, var(--text) 9%, transparent); }
.sk-ctl { display: flex; align-items: center; gap: 8px; }
.sk-b { font: inherit; font-weight: 800; font-size: 24px; width: 48px; height: 48px; border-radius: 14px; border: 0; cursor: pointer; background: var(--card); color: var(--text); box-shadow: 0 3px 0 var(--line), inset 0 0 0 1px var(--line); touch-action: manipulation; }
.sk-b:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line), inset 0 0 0 1px var(--line); }
.sk-b.plus { background: var(--c); color: #fff; box-shadow: 0 3px 0 color-mix(in srgb, var(--c) 60%, #000); }
.sk-b.plus:active { box-shadow: 0 1px 0 color-mix(in srgb, var(--c) 60%, #000); }
.sk-b:focus-visible, .sk-q:focus-visible, .sk-x:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sk-score { position: relative; min-width: 76px; text-align: center; font-size: 40px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.03em; line-height: 1; }
.sk-score.bump { animation: sk-bump .3s cubic-bezier(.2, 1.9, .4, 1); }
@keyframes sk-bump { 0% { transform: scale(1.35); } 100% { transform: scale(1); } }
.sk-fly { position: absolute; left: 50%; top: -6px; font-size: 17px; font-weight: 800; color: var(--c); pointer-events: none; animation: sk-fly .7s ease-out forwards; white-space: nowrap; }
@keyframes sk-fly { 0% { transform: translate(-50%, 0); opacity: 1; } 100% { transform: translate(-50%, -34px); opacity: 0; } }
.sk-quick { grid-column: 1 / -1; display: flex; gap: 6px; justify-content: flex-end; }
.sk-q { font: inherit; font-weight: 700; font-size: 13.5px; padding: 6px 11px; border-radius: 999px; border: 0; cursor: pointer; background: var(--card); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.sk-banner { margin: 0 0 14px; padding: 16px; border-radius: 18px; text-align: center; font-weight: 800; font-size: clamp(20px, 5vw, 28px); letter-spacing: -.02em; color: #3a2a05; background: linear-gradient(135deg, #ffe58a, #f6b93b); animation: cf-pop .5s cubic-bezier(.2, 1.7, .4, 1); }
.sk-banner small { display: block; font-size: 14px; font-weight: 700; opacity: .75; letter-spacing: 0; }
@media (min-width: 700px) { .sk-list.wide { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) {
  .sk-p { grid-template-columns: 1fr; padding: 10px 12px 12px 18px; }
  .sk-ctl { justify-content: center; gap: 14px; }
  .sk-quick { justify-content: center; }
}
