/* Random tools (templates/random_tools/*) */
.rnd-head { padding: 10px 0 18px; }
.rnd-head h1 { margin: 0 0 6px; font-size: clamp(1.4rem, 3.6vw, 2rem); }
.rnd-head p { margin: 0; color: var(--muted); }

/* cards on the hub / category pages */
.rnd-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.rnd-card { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s, box-shadow .15s; }
.rnd-card:hover { border-color: var(--tint-ink, var(--accent)); transform: translateY(-2px); box-shadow: var(--shadow); }
.rnd-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rnd-txt > span { font-size: .85rem; color: var(--muted); }
.rnd-ico, .rnd-h-ico { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px;
  background: var(--tint, var(--accent-soft)); color: var(--tint-ink, var(--accent)); }
.rnd-ico .icon, .rnd-h-ico .icon { width: 24px; height: 24px; }
.rnd-h-ico { display: inline-grid; vertical-align: middle; margin-right: 12px; width: 44px; height: 44px; }
.rnd-cat-ico { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; vertical-align: -6px;
  background: var(--tint); color: var(--tint-ink); margin-right: 4px; }
.rnd-cat-ico .icon { width: 18px; height: 18px; }
.rnd-group .section-title a { color: inherit; text-decoration: none; }
.cat-r-pick { --tint: #fde2e0; --tint-ink: #c2362f; }
.cat-r-generate { --tint: #dbeafe; --tint-ink: #1d4ed8; }
.cat-r-play { --tint: #dcfce7; --tint-ink: #15803d; }
.cat-r-group { --tint: #ede9fe; --tint-ink: #6d28d9; }
.cat-r-fortune { --tint: #fef3c7; --tint-ink: #b45309; }
[data-theme=dark] :is(.cat-r-pick, .cat-r-generate, .cat-r-play, .cat-r-group, .cat-r-fortune) { --tint-ink: #f1eee9; }
[data-theme=dark] .cat-r-pick { --tint: #3a1f1c; } [data-theme=dark] .cat-r-generate { --tint: #1c2840; }
[data-theme=dark] .cat-r-play { --tint: #173123; } [data-theme=dark] .cat-r-group { --tint: #2b2440; }
[data-theme=dark] .cat-r-fortune { --tint: #3a2d12; }

/* page layout: the stage (result / animation) and the controls */
.rnd-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.rnd-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.rnd-stage { display: flex; flex-direction: column; align-items: stretch; gap: 14px; min-height: 260px; }
.rnd-stage:fullscreen { justify-content: center; background: var(--surface); padding: 24px; }
.rnd-stage:fullscreen .wheel-wrap { width: min(90vh, 90vw); }
.rnd-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }
.rnd-controls .field:last-child { margin-bottom: 0; }
.rnd-label { font-weight: 500; font-size: .9rem; margin: 0 0 8px; }
.center { text-align: center; }
.rnd-msg { margin: 10px 0 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2, var(--info-soft)); }
.rnd-msg.ok { background: var(--ok-soft); color: var(--ok); }
.rnd-msg.bad { background: var(--bad-soft); color: var(--bad); }
.rnd-perks { margin: 14px 0 0; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--info-soft); }
.rnd-perks .icon { width: 16px; height: 16px; vertical-align: -3px; }

/* list editor */
.rnd-list textarea { width: 100%; resize: vertical; min-height: 120px; line-height: 1.5; }
.rnd-list-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.rnd-list-head label { font-weight: 500; font-size: .9rem; }
.rnd-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.rnd-tools .icon { width: 14px; height: 14px; }
.rnd-tools label { cursor: pointer; }
.rnd-saved { display: flex; gap: 6px; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.rnd-saved select { flex: 1; min-width: 0; padding: 5px 8px; font-size: .85rem; }

/* results */
.rnd-result { flex: 1; min-height: 140px; }
.rnd-result > p.muted { text-align: center; margin-top: 50px; }
.rnd-big { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; }
.rnd-big > p.muted { margin-top: 0; }
.rnd-emoji { font-size: 3rem; }
.rnd-food { font-size: clamp(1.6rem, 5vw, 2.4rem); line-height: 1.3; }
.rnd-res-h { font-size: 1rem; margin: 0 0 8px; }
.rnd-ol { margin: 0 0 14px; padding-left: 1.6em; line-height: 1.7; }
.rnd-winners li { font-size: 1.25rem; font-weight: 600; }
.rnd-winners li::marker { color: var(--gold); }
.rnd-reserves { color: var(--muted); }
.rnd-flicker { text-align: center; font-size: 1.8rem; font-weight: 600; margin-top: 46px; }
.rnd-proof-link { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--ok-soft); word-break: break-all; margin: 0; }
.rnd-pop { animation: rnd-pop .35s ease-out; }
@keyframes rnd-pop { from { transform: scale(.94); opacity: .3; } to { transform: none; opacity: 1; } }

.rnd-nums { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.rnd-nums span { min-width: 52px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent);
  font-size: 1.4rem; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.rnd-nums.one span { font-size: clamp(3.5rem, 14vw, 6rem); padding: 10px 28px; line-height: 1.1; }
.rnd-date { text-align: center; font-size: clamp(1.3rem, 4vw, 1.8rem); font-weight: 600; margin-top: 46px; }

/* draw: recorded draw box */
.rnd-proof { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.rnd-proof summary { cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rnd-proof summary .icon { width: 18px; height: 18px; color: var(--gold); }
.rnd-proof .field { margin: 10px 0; }

/* wheel */
.wheel-wrap { position: relative; width: min(100%, 520px); aspect-ratio: 1; margin: 0 auto; }
.wheel-wrap canvas { width: 100%; height: 100%; display: block; cursor: pointer; border-radius: 50%;
  box-shadow: 0 6px 24px rgb(0 0 0 / .15); }
.wheel-hub { position: absolute; left: 50%; top: 50%; width: 19%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%;
  border: 5px solid #fff; background: var(--text); color: var(--surface); font: inherit; font-weight: 700; font-size: clamp(.8rem, 2.6vw, 1.1rem);
  cursor: pointer; box-shadow: 0 2px 10px rgb(0 0 0 / .3); }
.wheel-pointer { position: absolute; right: -6px; top: 50%; width: 0; height: 0; transform: translateY(-50%);
  border-top: 16px solid transparent; border-bottom: 16px solid transparent; border-right: 34px solid var(--text);
  filter: drop-shadow(0 2px 3px rgb(0 0 0 / .3)); }
.rnd-dialog { border: 0; border-radius: var(--radius); padding: 24px 28px; text-align: center; min-width: min(90vw, 360px);
  background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgb(0 0 0 / .35); }
.rnd-dialog::backdrop { background: rgb(0 0 0 / .45); }
.rnd-dialog p { margin: 0 0 8px; }
.rnd-win-name { font-size: clamp(1.8rem, 7vw, 2.8rem); font-weight: 700; color: var(--accent); word-break: break-word; margin-bottom: 18px !important; }

/* food chips */
.rnd-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rnd-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px;
  font-size: .88rem; cursor: pointer; user-select: none; }
.rnd-chip:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.rnd-chip input { accent-color: var(--accent); margin: 0; }

/* colours */
.rnd-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.rnd-swatch { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; display: flex; flex-direction: column; }
.rnd-swatch .chip { height: 90px; background: var(--c); }
.rnd-swatches.one .rnd-swatch .chip { height: 220px; }
.rnd-swatch button { font: inherit; font-size: .85rem; padding: 6px 10px; border: 0; background: none; color: var(--text); text-align: left;
  cursor: pointer; font-variant-numeric: tabular-nums; }
.rnd-swatch button:hover { background: var(--line); }
.rnd-palette { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); height: 300px; border-radius: var(--radius-sm); overflow: hidden; }
.rnd-pal { background: var(--c); color: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 4px; }
.rnd-pal button { font: inherit; border: 0; background: none; color: inherit; cursor: pointer; }
.rnd-pal .hex { font-weight: 700; font-size: .95rem; letter-spacing: .02em; }
.rnd-pal .lock { font-size: 1.2rem; opacity: .85; }
@media (max-width: 560px) {
  .rnd-palette { grid-template-columns: 1fr; height: auto; }
  .rnd-pal { flex-direction: row; justify-content: space-between; padding: 18px 16px; }
}

/* passwords */
.rnd-pw { display: flex; flex-direction: column; gap: 6px; }
.rnd-pw-item { font: 600 1.15rem/1.4 ui-monospace, "Cascadia Mono", Consolas, monospace; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--bg); color: var(--text); text-align: left; word-break: break-all; cursor: copy; }
.rnd-meter { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.rnd-meter i { display: block; height: 100%; width: 0; background: var(--bad); transition: width .2s; }
.rnd-meter.warn i { background: var(--gold); } .rnd-meter.ok i { background: var(--ok); }
#meter-text { margin: -6px 0 0; }

/* dice */
.rnd-dice { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; padding: 20px 0; border: 0; background: none; cursor: pointer; min-height: 130px; }
.die { width: 72px; height: 72px; border-radius: 14px; background: #fff; border: 2px solid #d6d1ca; box-shadow: inset 0 -4px 0 rgb(0 0 0 / .08), 0 4px 10px rgb(0 0 0 / .12); }
.die.d6 { display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 10px; }
.die.d6 i { width: 13px; height: 13px; margin: auto; border-radius: 50%; }
.die.d6 i.on { background: #1d1b19; }
.die.dn { display: grid; place-items: center; font-size: 1.7rem; font-weight: 700; color: #1d1b19; }
.rnd-dice.rolling .die { animation: rnd-roll .35s ease-in-out; }
@keyframes rnd-roll { 0% { transform: rotate(0) scale(1); } 50% { transform: rotate(200deg) scale(.8); } 100% { transform: rotate(360deg) scale(1); } }
.rnd-total { text-align: center; font-size: 1.8rem; font-weight: 700; margin: 0; min-height: 1.4em; }

/* coin */
.rnd-coin { position: relative; width: 160px; height: 160px; margin: 20px auto 0; border: 0; padding: 0; background: none; cursor: pointer;
  transform-style: preserve-3d; transition: transform 1.2s cubic-bezier(.2, .7, .3, 1); }
.rnd-coin .face { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 50%; backface-visibility: hidden;
  font-size: 1.6rem; font-weight: 700; color: #6b4a0b; border: 6px solid #d8a73c;
  background: radial-gradient(circle at 35% 30%, #fff3c4, #f2c75c 55%, #c9952a); box-shadow: inset 0 0 0 4px rgb(255 255 255 / .35); }
.rnd-coin .tails { transform: rotateY(180deg); background: radial-gradient(circle at 35% 30%, #f5f5f5, #c9cdd3 55%, #9aa0a8); color: #3f4650; border-color: #a9afb7; }

/* rock paper scissors */
.rnd-rps-arena { display: flex; justify-content: center; align-items: center; gap: 24px; padding: 18px 0 0; }
.rnd-rps-arena div { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.rnd-rps-arena b { font-size: 4.5rem; line-height: 1; }
.rnd-rps-arena .vs { font-weight: 700; color: var(--muted); }
.rnd-rps-pick { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.rnd-rps-pick .btn { font-size: 1.05rem; padding: 12px 18px; }

/* groups / pairs / gift */
.rnd-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.rnd-group-card { border: 1px solid var(--line); border-top: 5px solid var(--g); border-radius: var(--radius-sm); padding: 10px 12px; }
.rnd-group-card h3 { font-size: 1rem; margin: 0 0 6px; color: var(--g); }
.rnd-group-card h3 small { color: var(--muted); font-weight: 400; }
.rnd-group-card .rnd-ol { margin: 0; }
.rnd-pairs li { padding: 3px 0; }
.rnd-more { margin-top: 4px; }
.rnd-more summary { cursor: pointer; font-size: .9rem; font-weight: 500; margin-bottom: 8px; }
.rnd-more textarea { width: 100%; }
.rnd-reveal { display: flex; flex-wrap: wrap; gap: 8px; }
.rnd-reveal .seen { opacity: .5; text-decoration: line-through; }
.rnd-secret { margin-top: 16px; padding: 18px; text-align: center; border-radius: var(--radius-sm); background: var(--gold-soft); }
.rnd-secret b { display: block; font-size: 2rem; margin: 4px 0 12px; }

/* fortune: answer ball, sticks, cookie, tarot */
.rnd-question { width: 100%; }
.rnd-ball { width: 220px; height: 220px; margin: 6px auto; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #555, #111 60%); box-shadow: 0 10px 30px rgb(0 0 0 / .35); }
.rnd-ball span { display: grid; place-items: center; width: 116px; height: 116px; padding: 10px; border-radius: 50%; background: #1e3a8a;
  color: #e0e7ff; font: 600 .95rem/1.25 var(--font); text-align: center; box-shadow: inset 0 0 12px rgb(0 0 0 / .6); }
.rnd-ball[data-tone="yes"] span { background: #14532d; } .rnd-ball[data-tone="no"] span { background: #7f1d1d; }
.rnd-ball.shake { animation: rnd-shake .9s ease-in-out; }
@keyframes rnd-shake { 0%, 100% { transform: none; } 20% { transform: translate(-10px, 4px) rotate(-8deg); } 40% { transform: translate(10px, -4px) rotate(8deg); }
  60% { transform: translate(-8px, 2px) rotate(-5deg); } 80% { transform: translate(6px, -2px) rotate(4deg); } }
.rnd-cup { position: relative; width: 140px; height: 210px; margin: 14px auto 0; border: 0; background: none; cursor: pointer; }
.rnd-cup .cup { position: absolute; left: 10px; right: 10px; bottom: 0; height: 130px; border-radius: 10px 10px 18px 18px;
  background: linear-gradient(90deg, #8b1c1c, #c0392b 45%, #8b1c1c); box-shadow: inset 0 6px 0 #e3b341; }
.rnd-cup .sticks { position: absolute; left: 24px; right: 24px; bottom: 100px; height: 80px;
  background: repeating-linear-gradient(90deg, #d9b26a 0 5px, transparent 5px 9px); border-radius: 3px 3px 0 0; }
.rnd-cup.shaking { animation: rnd-shake 0.4s ease-in-out 4; }
.rnd-cup .stick-out { position: absolute; left: 50%; bottom: 150px; width: 14px; height: 0; margin-left: -7px; background: #e9c47d;
  border-radius: 3px; color: #7a1414; font-size: .7rem; font-weight: 700; display: flex; justify-content: center; padding-top: 4px; transition: height .4s, bottom .4s; overflow: hidden; }
.rnd-cup.out .stick-out { height: 70px; bottom: 140px; }
.rnd-slip { max-width: 520px; margin: 0 auto; padding: 18px 20px; border-radius: var(--radius-sm); background: #fff8e7; color: #4a3410;
  border: 2px solid #e3b341; line-height: 1.7; }
.rnd-slip p { margin: 0 0 6px; }
.rnd-slip-no { font-size: 1.4rem; font-weight: 700; color: #8b1c1c; }
.rnd-slip-lvl { font-weight: 600; }
.lvl-3 { color: #15803d; } .lvl-2 { color: #1d4ed8; } .lvl-1 { color: #a16207; } .lvl-0 { color: #b91c1c; }
.rnd-cookie { font-size: 6rem; border: 0; background: none; cursor: pointer; margin: 10px auto 0; display: block; line-height: 1.2; }
.rnd-cookie.crack { animation: rnd-crack .5s ease-out; }
@keyframes rnd-crack { 30% { transform: scale(1.15) rotate(-10deg); } 60% { transform: scale(.9) rotate(8deg); } }
.rnd-paper { text-align: center; font-size: 1.1rem; background: #fff; border-color: #e4e0da; color: #1d1b19; }
.rnd-tarot { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; min-height: 240px; }
.rnd-tcard { width: 200px; display: flex; flex-direction: column; gap: 6px; }
.rnd-tcard .pos { text-align: center; font-weight: 600; margin: 0; color: var(--muted); font-size: .85rem; }
.rnd-tcard .face, .rnd-tcard.back { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; height: 260px;
  border-radius: 12px; border: 3px solid #c9a227; background: linear-gradient(160deg, #1e1b4b, #3b0764); color: #fde68a; text-align: center; padding: 10px; }
.rnd-tcard.back { width: 160px; height: 240px; font-size: 3rem; background: repeating-linear-gradient(45deg, #312e81 0 10px, #3b0764 10px 20px); }
.rnd-tcard .num { font-size: .9rem; letter-spacing: .1em; }
.rnd-tcard .sym { font-size: 3.4rem; }
.rnd-tcard.rev .face .sym { transform: rotate(180deg); }
.rnd-tcard .face small { opacity: .8; }
.rnd-tcard > .small { margin: 0; }

/* proof page */
.rnd-proof-h { font-size: 1.1rem; margin: 0 0 10px; }
.rnd-checks { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 6px; }
.rnd-checks .icon { width: 16px; height: 16px; vertical-align: -3px; color: var(--ok); }
.rnd-hash { display: block; padding: 8px 10px; border-radius: 8px; background: var(--bg); font-size: .78rem; word-break: break-all; }
.rnd-entrants { margin-top: 16px; }
.rnd-entrants summary { cursor: pointer; font-weight: 600; }
.rnd-entrants ol { max-height: 420px; overflow: auto; columns: 3 200px; }

@media (max-width: 860px) {
  .rnd-layout { grid-template-columns: minmax(0, 1fr); }
  .rnd-stage { min-height: 0; }
  .rnd-result { min-height: 70px; }
  .rnd-result > p.muted, .rnd-flicker, .rnd-date { margin-top: 16px; }
  .rnd-proof-grid { grid-template-columns: minmax(0, 1fr); }
}

/* generators: names, usernames, topics, drawing prompts (WIDGETS.gen) */
.rnd-gen-opts { display: flex; flex-wrap: wrap; gap: 10px 14px; justify-content: center; align-items: flex-end; }
.rnd-gen-opts label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); }
.rnd-gen-opts label.check { flex-direction: row; align-items: center; padding-bottom: 8px; color: var(--text); }
.rnd-gen-out { width: 100%; }
.rnd-big-text { margin: 10px 0; font-size: clamp(1.3rem, 4vw, 1.9rem); font-weight: 700; text-align: center; line-height: 1.4; }
.rnd-prompt { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; }
.rnd-slot { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 2px solid var(--line); border-radius: var(--radius); background: var(--surface);
  color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.rnd-slot small { color: var(--muted); font-size: .78rem; }
.rnd-slot b { font-size: 1.15rem; }
.rnd-slot.locked { border-color: var(--accent); background: var(--accent-soft); }
@media (max-width: 560px) { .rnd-prompt { grid-template-columns: minmax(0, 1fr); } }
