@import url("/image-converter/styles.css?v=1");
/* Dice roller */
.dc { --die: 76px; }
.dc .head .intro { margin-bottom: 14px; }
.dc-modes { display: flex; gap: 6px; margin: 0 0 14px; overflow-x: auto; scrollbar-width: none; }
.dc-modes::-webkit-scrollbar { display: none; }
.dc-modes button { flex: 0 0 auto; background: var(--panel-2); border: 1px solid var(--border); color: var(--muted); border-radius: 999px; padding: 9px 16px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; min-height: 42px; }
.dc-modes button[aria-selected="true"] { color: #10130a; background: var(--accent); border-color: var(--accent); }
.dc-modes button:hover { border-color: var(--accent-dim); }

/* table */
.dc-table { padding: 14px; }
.dc-stage { position: relative; min-height: 260px; border-radius: 12px; background: radial-gradient(ellipse 80% 90% at 50% 40%, #1a1d26 0%, #0d0e13 100%); border: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 22px 12px 16px; cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; outline: none; overflow: hidden; }
.dc-stage:focus-visible { box-shadow: 0 0 0 3px var(--accent-dim); }
.dc-dice { --sz: calc(var(--die) * var(--k, 1)); display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: calc(var(--sz) * 0.22); max-width: 100%; }
.dc-3d { width: 100%; height: 300px; display: block; }
.dc-total { font-size: 44px; font-weight: 800; color: var(--accent); line-height: 1.05; min-height: 1em; text-align: center; letter-spacing: -.02em; overflow-wrap: anywhere; }
.dc-total .sub { display: block; font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-top: 4px; }
.dc-callout { min-height: 22px; font-size: 16px; font-weight: 700; text-align: center; color: var(--text); }
.dc-callout.good { color: var(--accent); }
.dc-callout.bad { color: var(--bad); }
.dc-callout.warn { color: var(--warn); }
.dc-callout.nat { font-size: 22px; }
.dc-banner { position: absolute; top: 8px; left: 8px; right: 8px; text-align: center; font-size: 12px; font-weight: 800; letter-spacing: .08em; color: #1a1200; background: repeating-linear-gradient(45deg, #ffb454 0 10px, #ffc979 10px 20px); border-radius: 6px; padding: 3px 6px; }
.dc-exit { position: absolute; top: 10px; right: 10px; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--border); background: rgba(12, 12, 16, .7); color: var(--text); font-size: 20px; cursor: pointer; z-index: 3; }
.dc-rollbar { margin-top: 12px; }
.dc-feel { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.dc-feel .btn.sm[aria-pressed="true"], .dc-quick .btn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }

/* one die: .die holds the shadow and hold ring, .face is the shape */
.die { position: relative; width: var(--sz); height: var(--sz); flex: 0 0 auto; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .55)); transition: transform .12s; }
.die .face { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #f4f4f6; color: #111216; border-radius: 16%;
  font-weight: 800; font-size: calc(var(--sz) * 0.42); line-height: 1; text-align: center; overflow: hidden; padding: 6%; }
.die .face.long { font-size: calc(var(--sz) * 0.26); }
.die .face.vlong { font-size: calc(var(--sz) * 0.17); overflow-wrap: anywhere; }
.die .face img { width: 100%; height: 100%; object-fit: contain; }
.die .tag { position: absolute; left: 0; right: 0; bottom: calc(var(--sz) * -0.26); text-align: center; font-size: 11px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.die.s4 .face { border-radius: 0; clip-path: polygon(50% 4%, 97% 92%, 3% 92%); padding-top: 30%; }
.die.s8 .face { border-radius: 0; clip-path: polygon(50% 2%, 98% 50%, 50% 98%, 2% 50%); }
.die.s10 .face { border-radius: 0; clip-path: polygon(50% 2%, 97% 42%, 50% 98%, 3% 42%); padding-bottom: 14%; }
.die.s12 .face { border-radius: 0; clip-path: polygon(50% 2%, 98% 38%, 80% 96%, 20% 96%, 2% 38%); padding-top: 12%; }
.die.s20 .face { border-radius: 0; clip-path: polygon(50% 1%, 95% 26%, 95% 74%, 50% 99%, 5% 74%, 5% 26%); }
.die.s100 .face, .die.s2 .face { border-radius: 50%; }
.die.held { transform: translateY(calc(var(--sz) * -0.08)); filter: drop-shadow(0 0 0 var(--accent)) drop-shadow(0 0 3px var(--accent)) drop-shadow(0 0 3px var(--accent)); }
.die.held .tag { color: var(--accent); }
.die.dropped { opacity: .32; }
.die.dropped .face { text-decoration: line-through; }
.die.hidden-face .face { background: #2a2d38 !important; color: var(--muted) !important; }
.die.ghost { opacity: .55; }
.die.extra .tag { color: var(--warn); }
.die.rolling .face { animation: dc-wob .09s linear infinite alternate; }
@keyframes dc-wob { from { transform: rotate(-7deg) scale(.96); } to { transform: rotate(7deg) scale(1.02); } }
@media (prefers-reduced-motion: reduce) { .die.rolling .face { animation: none; } .die { transition: none; } }
/* pips for d6 */
.pips { position: absolute; inset: 12%; display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); }
.pips i { align-self: center; justify-self: center; width: 70%; height: 70%; border-radius: 50%; background: currentColor; }
.pips i.x { visibility: hidden; }

/* tray */
.dc-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 8px; }
.dc-add { background: var(--panel-2); border: 1px solid var(--border); color: var(--text); border-radius: 10px; min-height: 48px; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.dc-add:hover { border-color: var(--accent); color: var(--accent); }
.dc-any { margin-top: 12px; }
.dc-any .lbl, .dc-modrow .lbl, .dc-quick .lbl, .dc-pools .lbl, .dc-oddsrow .lbl { margin: 0; }
.dc-paint { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.dc-sw { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--border); cursor: pointer; padding: 0; }
.dc-sw[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.dc-pick input { width: 40px; height: 34px; padding: 0; border: 1px solid var(--border); border-radius: 8px; background: var(--panel-2); cursor: pointer; }
.dc-groups { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.dc-groups li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2); }
.dc-groups .sw { width: 20px; height: 20px; border-radius: 6px; border: 1px solid #3a4150; flex: 0 0 auto; }
.dc-groups .what { flex: 1; font-weight: 700; }
.dc-groups button { min-width: 40px; min-height: 36px; }
.dc-modrow { margin-top: 12px; }
.dc-checks { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; }

/* games */
.dc-game { margin-top: 12px; display: flex; flex-direction: column; gap: 12px; }
.dc-game .row { gap: 8px; }
.dc-sheet { width: 100%; border-collapse: collapse; font-size: 13px; }
.dc-sheet th, .dc-sheet td { border-bottom: 1px solid var(--border); padding: 4px 6px; text-align: right; white-space: nowrap; }
.dc-sheet th:first-child, .dc-sheet td:first-child { text-align: left; }
.dc-sheet thead th { color: var(--muted); font-weight: 600; }
.dc-sheet th.cur { color: var(--accent); }
.dc-sheet tr.sum td { font-weight: 700; color: var(--text); }
.dc-sheet button { min-height: 30px; padding: 3px 8px; font-size: 13px; }
.dc-scroll { overflow-x: auto; }
.dc-players { display: flex; flex-wrap: wrap; gap: 8px; }
.dc-player { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2); font-size: 14px; }
.dc-player.cur { border-color: var(--accent); }
.dc-player.out { opacity: .45; }
.dc-player b { color: var(--accent); }
.dc-names { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.dc-names .in { max-width: 240px; }
.dc-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; }
.dc-tiles button { min-height: 52px; font: inherit; font-size: 18px; font-weight: 800; border-radius: 8px; border: 1px solid var(--border); background: #e9dcc0; color: #2a1d08; cursor: pointer; }
.dc-tiles button[aria-pressed="true"] { background: var(--accent); color: #10130a; }
.dc-tiles button:disabled { background: #2a2d38; color: #555b6a; cursor: default; }
.dc-note { font-size: 13px; color: var(--muted); }
.dc-ship { display: flex; gap: 4px; }
.dc-ship i { width: 18px; height: 10px; border-radius: 3px; background: var(--border); }
.dc-ship i.on { background: var(--warn); }

/* rpg */
.dc-exprrow { display: flex; gap: 8px; }
.dc-exprrow .in { font-size: 16px; }
.dc-err { color: var(--bad); font-size: 13px; min-height: 18px; margin: 6px 0 0; }
.dc-quick, .dc-pools { margin-top: 10px; gap: 8px; }
.dc-quick .in.num, .dc-pools .in.num { width: 76px; }
.dc-death { margin: 10px 0 0; font-size: 14px; }
.dc-saverow { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 10px; align-items: center; margin-top: 10px; }
.dc-saverow .btn { grid-column: 1 / -1; justify-self: start; }
.dc-saved { margin: 10px 0; display: flex; flex-direction: column; gap: 10px; }
.dc-saved h3 { margin: 0 0 4px; font-size: 13px; color: var(--muted); }
.dc-saved ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.dc-saved li { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.dc-saved li button { background: var(--panel-2); color: var(--text); border: 0; font: inherit; font-size: 13px; padding: 6px 10px; cursor: pointer; min-height: 36px; }
.dc-saved li button.x { color: var(--muted); border-left: 1px solid var(--border); }
.dc-saved li code { color: var(--muted); font-size: 12px; margin-left: 6px; }
.dc-import { margin-top: 10px; padding: 10px; border: 1px solid var(--accent-dim); border-radius: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dc-help { font-size: 13px; border-collapse: collapse; margin-top: 8px; }
.dc-help td { padding: 3px 10px 3px 0; color: var(--muted); vertical-align: top; }
.dc-help code { color: var(--text); }

/* custom */
.dc-cdice { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.dc-cdice button { background: var(--panel-2); border: 1px solid var(--border); color: var(--muted); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; min-height: 36px; }
.dc-cdice button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.dc-faces { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.dc-face { display: grid; grid-template-columns: minmax(0, 1fr) 40px auto auto; gap: 6px; align-items: center; }
.dc-face input[type="color"] { width: 40px; height: 36px; padding: 0; border: 1px solid var(--border); border-radius: 8px; background: var(--panel-2); }
.dc-face img { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; }
.dc-face .btn { min-height: 36px; }

/* charts, odds, fairness */
.dc-chart { display: block; width: 100%; height: 200px; margin-top: 8px; }
.dc-oddsrow { margin-top: 10px; gap: 8px; }
.dc-big { font-size: 20px; color: var(--accent); }
.dc-legend { color: var(--muted); margin: 6px 0 0; display: flex; gap: 6px; align-items: center; }
.dc-legend span { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-left: 8px; }
.dc-legend span:first-child { margin-left: 0; }
.dc-legend .k-obs { background: var(--accent); }
.dc-legend .k-exp { background: var(--accent-2); height: 3px; }
.dc-many { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.dc-verdict { font-size: 14px; margin: 8px 0; min-height: 20px; }
.dc-verdict b.fair { color: var(--accent); }
.dc-verdict b.off { color: var(--bad); }
.dc-verdict b.unsure, .dc-verdict b.more { color: var(--warn); }
.dc-luck { font-size: 14px; margin-top: 8px; }
.dc-luck p { margin: 4px 0; }
.dc-luck b.normal { color: var(--accent); }
.dc-luck b.unusual { color: var(--warn); }
.dc-luck b.rare { color: var(--bad); }
.dc-tip { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--border); color: var(--muted); font-size: 13px; font-weight: 700; cursor: help; }
.dc-tiptext { display: none; position: absolute; bottom: 32px; right: -8px; width: min(280px, 80vw); background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 12px; font-weight: 400; color: var(--text); z-index: 5; box-shadow: 0 8px 24px rgba(0, 0, 0, .4); }
.dc-tip:hover .dc-tiptext, .dc-tip:focus .dc-tiptext { display: block; }
.dc-pad { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 6px; margin-top: 10px; }
.dc-pad button { min-height: 48px; font: inherit; font-size: 17px; font-weight: 700; border-radius: 8px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); cursor: pointer; }
.dc-pad button:hover { border-color: var(--accent); }
.dc-pad button:active { background: rgba(149, 214, 0, .15); }

/* history */
.dc-hist { margin: 0 0 10px; padding-left: 0; list-style: none; max-height: 280px; overflow: auto; font-size: 13px; }
.dc-hist li { padding: 4px 0; border-bottom: 1px solid #1c1f27; overflow-wrap: anywhere; }
.dc-hist .t { color: var(--muted); font-size: 11px; margin-right: 8px; }
.dc-hist li.empty { color: var(--muted); border: 0; }

/* table view: the stage fills the screen */
body.dc-tablemode { overflow: hidden; }
body.dc-tablemode .dc-stage { position: fixed; inset: 0; z-index: 60; border-radius: 0; border: 0; min-height: 100vh; min-height: 100dvh; padding: 56px 16px 24px; }
body.dc-tablemode .dc { --die: min(26vw, 30vh, 190px); }
body.dc-tablemode .dc-total { font-size: min(14vw, 16vh); }
body.dc-tablemode .dc-callout { font-size: min(6vw, 5vh); }
body.dc-tablemode .dc-3d { height: 70vh; }
.dc-stage:fullscreen { padding: 56px 16px 24px; }
@media (orientation: landscape) { body.dc-tablemode .dc { --die: min(18vw, 34vh, 190px); } }

@media (max-width: 520px) {
  .dc { --die: 64px; }
  .dc-stage { min-height: 220px; }
  .dc-total { font-size: 36px; }
  .dc-face { grid-template-columns: minmax(0, 1fr) 40px auto auto; }
  .dc-saverow { grid-template-columns: minmax(0, 1fr); }
}
