:root {
	color-scheme: dark;
	font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	--bg-canvas: #080d12;
	--bg-deep: #05090d;
	--surface-1: #0e141a;
	--surface-2: #121920;
	--surface-3: #182028;
	--line-subtle: rgba(255, 255, 255, 0.1);
	--line-strong: rgba(255, 255, 255, 0.18);
	--text-primary: #f7f8fa;
	--text-secondary: #a7afbd;
	--text-muted: #737d8c;
	--success: #49d568;
	--success-hover: #5be178;
	--danger: #ff4757;
	--orange: #ff961f;
	--yellow: #ffd43b;
	--green: #2ed573;
	--blue: #238cff;
	--purple: #a855f7;
}

* { box-sizing: border-box; }

html { min-width: 320px; overflow-x: clip; background: var(--bg-canvas); }

body {
	margin: 0;
	min-height: 100dvh;
	overflow-x: clip;
	color: var(--text-primary);
	background:
		radial-gradient(circle at 68% 34%, rgba(35, 140, 255, 0.045), transparent 31rem),
		linear-gradient(180deg, #0a1016, var(--bg-canvas) 42%, var(--bg-deep));
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	grid-template-rows: 72px auto auto 88px;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible {
	outline: 2px solid #7cb7ff;
	outline-offset: 2px;
}

[hidden] { display: none !important; }
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.topbar {
	padding: 0 38px;
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	border-bottom: 1px solid var(--line-subtle);
	background: rgba(5, 9, 13, 0.84);
	backdrop-filter: blur(18px);
	z-index: 20;
}

.brand-lockup {
	display: inline-flex;
	align-items: center;
	gap: 13px;
	width: max-content;
	font-size: 27px;
	font-weight: 850;
	letter-spacing: -0.035em;
}

.brand-cube { width: 48px; height: 48px; filter: drop-shadow(0 8px 18px rgba(35, 140, 255, 0.18)); }

.language-switch {
	width: 280px;
	height: 44px;
	display: grid;
	grid-template-columns: 1fr 1fr;
	padding: 3px;
	border: 1px solid var(--line-strong);
	border-radius: 14px;
	background: rgba(8, 13, 18, 0.74);
}

.language-switch button {
	border: 0;
	border-radius: 10px;
	background: transparent;
	color: var(--text-secondary);
	font-weight: 700;
	cursor: pointer;
	transition: background 160ms ease, color 160ms ease;
}

.language-switch button.active { color: var(--text-primary); background: var(--surface-3); box-shadow: inset 0 1px rgba(255,255,255,.05); }

.stream-entry {
	justify-self: end;
	min-width: 164px;
	height: 46px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	border: 1px solid var(--line-strong);
	border-radius: 8px;
	background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.015));
	font-size: 16px;
	font-weight: 800;
	cursor: pointer;
}
.stream-entry:hover { background: var(--surface-3); }
.stream-entry svg { width: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.app-shell {
	width: min(100%, 1510px);
	min-height: 0;
	margin: 0 auto;
	display: grid;
	grid-template-columns: minmax(0, 1fr) 452px;
	border-left: 1px solid rgba(255,255,255,.02);
	border-right: 1px solid rgba(255,255,255,.02);
}

.play-column {
	min-width: 0;
	display: grid;
	grid-template-rows: auto minmax(360px, 1fr) auto auto;
	padding-top: 50px;
}

.hero-copy { padding: 0 38px 22px; }
.hero-copy h1 {
	margin: 0;
	font-size: clamp(58px, 5.2vw, 78px);
	line-height: 0.96;
	font-weight: 850;
	letter-spacing: -0.052em;
}
.hero-copy p {
	margin: 12px 0 0;
	color: var(--text-secondary);
	font-size: 18px;
	font-weight: 650;
}

.dice-stage {
	position: relative;
	min-height: 360px;
	overflow: hidden;
	display: grid;
	align-items: center;
	background:
		radial-gradient(ellipse at 50% 58%, rgba(255,255,255,.045), transparent 46%),
		linear-gradient(180deg, rgba(8, 13, 18, .2), rgba(5, 9, 13, .82));
}

.stage-floor {
	position: absolute;
	left: 4%;
	right: 4%;
	bottom: -22%;
	height: 64%;
	border: 1px solid rgba(255,255,255,.08);
	background:
		linear-gradient(90deg, transparent, rgba(255,255,255,.025) 50%, transparent),
		linear-gradient(180deg, rgba(24,32,40,.6), rgba(10,14,19,.88));
	transform: perspective(700px) rotateX(52deg);
	transform-origin: bottom center;
	box-shadow: inset 0 14px 38px rgba(255,255,255,.025), 0 -26px 70px rgba(0,0,0,.32);
}

.dice-grid {
	position: relative;
	z-index: 2;
	width: 100%;
	min-height: 310px;
	padding: 58px 40px 50px;
	display: grid;
	grid-template-columns: repeat(4, minmax(120px, 1fr));
	gap: clamp(14px, 1.55vw, 24px);
	align-items: center;
	align-content: center;
	justify-items: center;
}

.dice-grid::before {
	content: "";
	position: absolute;
	left: 24px;
	right: 24px;
	top: 32px;
	bottom: 30px;
	z-index: -1;
	border: 1px solid rgba(255,255,255,.075);
	border-radius: 24px;
	background:
		linear-gradient(135deg, rgba(255,255,255,.035), transparent 34%),
		linear-gradient(180deg, rgba(18,25,32,.86), rgba(7,11,16,.92));
	box-shadow: inset 0 1px rgba(255,255,255,.035), inset 0 -28px 60px rgba(0,0,0,.3), 0 24px 70px rgba(0,0,0,.22);
}

.die-result {
	--die-size: clamp(42px, 3.6vw, 54px);
	--die-depth: calc(var(--die-size) / 2);
	width: 100%;
	max-width: 190px;
	height: auto;
	aspect-ratio: 1;
	min-width: 0;
	position: relative;
	overflow: hidden;
	z-index: 1;
	border: 1px solid color-mix(in srgb, var(--result-color) 62%, white);
	border-radius: 18px;
	background:
		radial-gradient(circle at 78% 17%, rgba(255,255,255,.25), transparent 23%),
		linear-gradient(145deg, rgba(255,255,255,.19), transparent 40%, rgba(0,0,0,.28)),
		color-mix(in srgb, var(--result-color) 88%, #111923);
	box-shadow:
		inset 0 1px rgba(255,255,255,.34),
		inset 0 -42px 60px rgba(0,0,0,.25),
		0 18px 38px color-mix(in srgb, var(--result-color) 18%, transparent),
		0 14px 24px rgba(0,0,0,.3);
	isolation: isolate;
}

.die-result::before {
	content: "";
	position: absolute;
	inset: 7px;
	border: 1px solid rgba(255,255,255,.2);
	border-radius: 12px;
	pointer-events: none;
}

.die-result::after {
	content: "";
	position: absolute;
	inset: 0;
	background:
		linear-gradient(110deg, transparent 18%, rgba(255,255,255,.08) 42%, transparent 61%),
		radial-gradient(circle at 34% 20%, rgba(255,255,255,.12), transparent 36%);
	pointer-events: none;
}

.tile-index {
	position: absolute;
	left: 18px;
	top: 16px;
	z-index: 2;
	color: rgba(255,255,255,.58);
	font-size: 11px;
	font-weight: 800;
	letter-spacing: .14em;
}

.tile-label {
	position: absolute;
	left: 18px;
	bottom: 16px;
	z-index: 2;
	color: rgba(255,255,255,.92);
	font-size: 13px;
	font-weight: 850;
	letter-spacing: .11em;
	text-transform: uppercase;
	text-shadow: 0 2px 10px rgba(0,0,0,.22);
}

.die-scene {
	width: var(--die-size);
	height: var(--die-size);
	position: absolute;
	top: 21px;
	right: 20px;
	z-index: 2;
	perspective: 820px;
	border-radius: 10px;
	box-shadow: 0 0 0 7px rgba(6,10,14,.18), 0 0 0 8px rgba(255,255,255,.13);
	filter: drop-shadow(0 14px 13px rgba(0,0,0,.42));
}

.die-scene::after {
	content: "";
	position: absolute;
	left: -10%;
	right: -10%;
	bottom: -13px;
	height: 16px;
	background: radial-gradient(ellipse, color-mix(in srgb, var(--result-color) 32%, rgba(0,0,0,.76)), transparent 70%);
	filter: blur(4px);
}

.die-cube {
	position: absolute;
	inset: 0;
	transform-style: preserve-3d;
	transform: rotateX(-23deg) rotateY(38deg) rotateZ(0deg);
	transition: transform 800ms cubic-bezier(.2,.82,.18,1);
}

.die-face {
	position: absolute;
	inset: 0;
	border: 1px solid rgba(255,255,255,.82);
	border-radius: calc(var(--die-size) * .12);
	backface-visibility: hidden;
	box-shadow:
		inset 0 24px 36px rgba(255,255,255,.22),
		inset 0 -34px 44px rgba(0,0,0,.28),
		0 0 20px color-mix(in srgb, var(--face-color) 32%, transparent);
	background:
		radial-gradient(circle at 40% 20%, rgba(255,255,255,.2), transparent 32%),
		var(--face-color);
}
.die-face::after { content: ""; position: absolute; inset: 7%; border: 1px solid rgba(255,255,255,.17); border-radius: inherit; }
.face-front { transform: translateZ(var(--die-depth)); }
.face-back { transform: rotateY(180deg) translateZ(var(--die-depth)); }
.face-right { transform: rotateY(90deg) translateZ(var(--die-depth)); }
.face-left { transform: rotateY(-90deg) translateZ(var(--die-depth)); }
.face-top { transform: rotateX(90deg) translateZ(var(--die-depth)); }
.face-bottom { transform: rotateX(-90deg) translateZ(var(--die-depth)); }

.result-swatch {
	display: none;
}

.dice-stage.rolling .die-result { animation: tile-wait 1.05s ease both; animation-delay: var(--delay); }
.dice-stage.rolling .die-cube { animation: mini-tumble 1.05s cubic-bezier(.3,.8,.16,1) both; animation-delay: var(--delay); }
.dice-stage.revealed .die-result { animation: tile-reveal 520ms cubic-bezier(.2,.9,.2,1) both; animation-delay: var(--delay); }
.dice-stage.loading .die-result {
	animation: card-shuffle 680ms cubic-bezier(.45,.05,.55,.95) infinite alternate;
	animation-delay: var(--delay);
}
.dice-stage.loading .matrix-swatch {
	animation: matrix-loading 760ms ease-in-out infinite alternate;
	animation-delay: var(--delay);
}

@keyframes mini-tumble {
	0% { transform: translateY(-36px) rotateX(-145deg) rotateY(-210deg) rotateZ(30deg) scale(.72); filter: blur(2px); }
	55% { transform: translateY(5px) rotateX(120deg) rotateY(260deg) rotateZ(-10deg) scale(1.06); filter: none; }
	75% { transform: translateY(-5px) rotateX(-32deg) rotateY(52deg) rotateZ(2deg); }
	100% { transform: rotateX(-23deg) rotateY(38deg) rotateZ(0); }
}
@keyframes tile-wait { 0%, 35% { opacity: .55; filter: saturate(.5) brightness(.62); } 100% { opacity: 1; filter: none; } }
@keyframes tile-reveal { from { opacity: .45; transform: translateY(-8px) scale(.96); filter: saturate(.6) brightness(.72); } to { opacity: 1; transform: none; filter: none; } }
@keyframes card-shuffle {
	0% { transform: translateY(0) rotateZ(-.5deg) scale(.98); filter: saturate(.62) brightness(.74); }
	100% { transform: translateY(-12px) rotateZ(.5deg) scale(1.015); filter: saturate(1.1) brightness(1.08); }
}
@keyframes matrix-loading { from { opacity: .35; transform: scale(.82); } to { opacity: 1; transform: scale(1); } }

.dice-grid.compact-tiles { grid-template-columns: repeat(3, minmax(100px, 1fr)); align-content: center; align-items: center; padding-block: 42px; }
.dice-grid.compact-tiles .die-result { max-width: 140px; height: auto; aspect-ratio: 1; }
.dice-grid.compact-tiles .die-scene { top: 14px; right: 14px; }
.dice-grid.compact-tiles .tile-label { bottom: 11px; }

.control-bar {
	min-height: 198px;
	padding: 30px 42px 36px;
	display: grid;
	grid-template-columns: 182px minmax(260px, 1fr) 138px;
	align-items: center;
	gap: clamp(24px, 4vw, 62px);
	border-top: 1px solid var(--line-subtle);
	background: linear-gradient(180deg, rgba(12,18,24,.82), rgba(7,11,15,.96));
}
.control-group { display: grid; gap: 8px; }
.control-label { font-size: 15px; font-weight: 750; }
.stepper {
	height: 64px;
	display: grid;
	grid-template-columns: 1fr 1.25fr 1fr;
	overflow: hidden;
	border: 1px solid var(--line-strong);
	border-radius: 10px;
	background: var(--surface-1);
}
.stepper button, .stepper input {
	min-width: 0;
	border: 0;
	background: transparent;
	color: var(--text-primary);
	text-align: center;
	font-size: 25px;
	font-weight: 800;
}
.stepper button { cursor: pointer; color: var(--text-secondary); }
.stepper button:hover { background: var(--surface-3); color: var(--text-primary); }
.stepper input { width: 100%; border-inline: 1px solid var(--line-subtle); appearance: textfield; }
.stepper input::-webkit-inner-spin-button { appearance: none; }

.roll-button {
	height: 74px;
	position: relative;
	isolation: isolate;
	overflow: visible;
	border: 1px solid rgba(138,255,158,.62);
	border-radius: 10px;
	background: linear-gradient(180deg, #58dc72, #37b953);
	color: #07130a;
	font-size: clamp(18px, 1.55vw, 24px);
	font-weight: 850;
	box-shadow: inset 0 1px rgba(255,255,255,.36), 0 10px 28px rgba(73,213,104,.22);
	cursor: pointer;
	transition: transform 140ms ease, background 140ms ease, box-shadow 140ms ease;
}
.roll-button::before,
.roll-button::after {
	content: "";
	position: absolute;
	inset: -1px;
	z-index: -1;
	pointer-events: none;
	border: 2px solid rgba(157, 255, 176, .62);
	border-radius: inherit;
}
.roll-button::before { filter: blur(3px); opacity: .72; }
.roll-button::after { inset: -7px; border-color: transparent; background: linear-gradient(-24deg, rgba(73,213,104,.46), transparent 36%, transparent 64%, rgba(157,255,176,.42)); filter: blur(18px); opacity: .48; }
.electric-border-canvas {
	position: absolute;
	left: 50%;
	top: 50%;
	z-index: 2;
	display: block;
	max-width: none;
	pointer-events: none;
	transform: translate(-50%, -50%);
	filter: drop-shadow(0 0 3px rgba(157,255,176,.9)) drop-shadow(0 0 8px rgba(73,213,104,.46));
}
.roll-button > span { position: relative; z-index: 3; }
.roll-button:hover { background: linear-gradient(180deg, #68e580, #42c45d); box-shadow: inset 0 1px rgba(255,255,255,.4), 0 13px 34px rgba(73,213,104,.29); }
.roll-button:active { transform: translateY(1px) scale(.995); }
.roll-button:disabled { cursor: wait; opacity: .72; }
.roll-button:disabled .electric-border-canvas { opacity: .5; }
.button-spinner { display: none; width: 21px; height: 21px; margin-left: 10px; vertical-align: -4px; border: 3px solid rgba(7,19,10,.28); border-top-color: #07130a; border-radius: 50%; animation: spin .7s linear infinite; }
.roll-button.loading .button-spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.sound-control { justify-items: start; }
.switch { cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track { width: 74px; height: 40px; display: block; padding: 4px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface-3); transition: background 160ms ease; }
.switch-track span { display: block; width: 30px; height: 30px; border-radius: 50%; background: #f6f7f8; box-shadow: 0 3px 10px rgba(0,0,0,.38); transition: transform 180ms ease; }
.switch input:checked + .switch-track { background: #31b952; }
.switch input:checked + .switch-track span { transform: translateX(34px); }
.switch input:focus-visible + .switch-track { outline: 2px solid #7cb7ff; outline-offset: 2px; }

.status-message { min-height: 0; padding: 0 42px; color: var(--danger); font-size: 14px; }
.status-message:not(:empty) { padding-bottom: 18px; }

.proof-column {
	min-width: 0;
	padding: 26px 38px 24px 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.proof-card, .data-card {
	border: 1px solid var(--line-subtle);
	border-radius: 12px;
	background: linear-gradient(145deg, rgba(21,28,35,.95), rgba(10,15,20,.96));
	box-shadow: inset 0 1px rgba(255,255,255,.025);
}
.proof-card { padding: 20px 16px 16px; }
.verification-heading { display: flex; align-items: center; gap: 16px; padding: 0 4px 16px; }
.shield { width: 48px; flex: 0 0 auto; fill: var(--text-muted); filter: drop-shadow(0 8px 14px rgba(73,213,104,.16)); }
.shield path:last-child { fill: none; stroke: #f8fff9; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.proof-card.verified .shield { fill: var(--success); }
.proof-card.error .shield { fill: var(--danger); }
.eyebrow { margin: 0 0 2px; color: var(--text-muted); font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.verification-heading h2 { margin: 0; color: var(--text-secondary); font-size: 30px; line-height: 1.1; letter-spacing: -.03em; }
.proof-card.verified .verification-heading h2 { color: var(--success); }
.proof-card.error .verification-heading h2 { color: var(--danger); }

.empty-proof { min-height: 256px; padding: 24px; display: grid; place-content: center; gap: 8px; border: 1px dashed var(--line-strong); border-radius: 10px; text-align: center; color: var(--text-secondary); }
.empty-proof p { margin: 0; color: var(--text-primary); font-weight: 750; }
.empty-proof span { font-size: 14px; }
.verify-form {
	width: min(100%, 280px);
	margin: 10px auto 0;
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 8px;
}
.verify-form input {
	min-width: 0;
	height: 42px;
	padding: 0 11px;
	border: 1px solid var(--line-strong);
	border-radius: 8px;
	background: rgba(7,11,15,.72);
	color: var(--text-primary);
	font-weight: 750;
}
.verify-form button {
	height: 42px;
	padding: 0 12px;
	border: 1px solid rgba(138,255,158,.56);
	border-radius: 8px;
	background: linear-gradient(180deg, #58dc72, #37b953);
	color: #07130a;
	font-weight: 850;
	cursor: pointer;
}
.verify-form button:hover { background: linear-gradient(180deg, #68e580, #42c45d); }
.proof-detail {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 142px;
	grid-template-areas:
		"id qr"
		"snapshot qr"
		"actions actions";
	gap: 12px 14px;
	border: 1px solid var(--line-subtle);
	border-radius: 10px;
	padding: 14px;
	background: rgba(5,9,13,.26);
}
.proof-id-row { grid-area: id; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--line-subtle); }
.proof-label { display: block; margin-bottom: 3px; color: var(--text-secondary); font-size: 13px; font-weight: 700; }
.game-id { display: block; overflow: hidden; font-size: 22px; line-height: 1.15; font-weight: 850; font-variant-numeric: tabular-nums; text-overflow: ellipsis; }
.icon-button { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 8px; background: transparent; cursor: pointer; }
.icon-button:hover { border-color: var(--line-strong); background: var(--surface-3); }
.icon-button svg { width: 23px; fill: none; stroke: currentColor; stroke-width: 2; }
.proof-snapshot { grid-area: snapshot; min-width: 0; display: grid; gap: 11px; align-content: start; }
.proof-meta-row { min-width: 0; }
.proof-meta-row time { color: var(--text-primary); font-size: 12px; font-weight: 750; font-variant-numeric: tabular-nums; }
.proof-result-row .result-strip { justify-content: flex-start; gap: 5px; }
.proof-result-row .mini-swatch { width: 22px; height: 22px; border-width: 1px; }
.proof-result-counts { display: flex; flex-wrap: wrap; gap: 4px; }
.qr-block { grid-area: qr; display: grid; align-content: start; justify-items: center; gap: 5px; }
.qr-block .proof-label { justify-self: start; width: 100%; }
.qr { width: 142px; height: 142px; padding: 7px; border-radius: 8px; background: #fff; }
.proof-actions { grid-area: actions; display: grid; grid-template-columns: 1fr 1.35fr; gap: 8px; padding-top: 2px; }
.open-proof, .copy-proof { min-width: 0; height: 46px; display: inline-grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 8px; background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.025)); color: var(--text-primary); font-weight: 800; cursor: pointer; }
.open-proof:hover, .copy-proof:hover { background: var(--surface-3); }
.copy-proof { width: 100%; }

.result-strip { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.mini-swatch { width: 27px; height: 27px; border: 2px solid rgba(255,255,255,.82); border-radius: 4px; box-shadow: inset 0 5px 8px rgba(255,255,255,.13); }
.result-more { min-width: 31px; height: 27px; padding: 0 6px; display: inline-grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--surface-3); color: var(--text-secondary); font-size: 11px; font-weight: 750; }
.result-strip.count-mode { width: 100%; }

.color-counts { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 7px; }
.count-chip { min-width: 70px; height: 32px; padding: 0 9px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-subtle); border-radius: 8px; background: rgba(7,11,15,.56); color: var(--text-secondary); font-size: 11px; font-variant-numeric: tabular-nums; }
.count-chip strong { margin-left: auto; color: var(--text-primary); font-size: 13px; }
.count-swatch { width: 15px; height: 15px; flex: 0 0 auto; border: 1px solid rgba(255,255,255,.7); border-radius: 4px; box-shadow: inset 0 3px 5px rgba(255,255,255,.16); }
.count-name { text-transform: capitalize; }
.count-chip.compact { min-width: 0; height: 24px; padding: 0 6px; gap: 5px; border-radius: 6px; }
.count-chip.compact .count-name { display: none; }
.count-chip.compact .count-swatch { width: 13px; height: 13px; border-radius: 3px; }
.count-chip.compact strong { font-size: 11px; }

.data-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; min-height: 0; }
.data-card { min-width: 0; padding: 13px; }
.data-card h3 { margin: 0 0 9px; font-size: 15px; }
.history-list { display: grid; max-height: 270px; overflow: auto; scrollbar-color: var(--surface-3) transparent; }
.history-row { min-width: 0; display: grid; grid-template-columns: 66px 1fr; align-items: center; gap: 7px; padding: 8px 0; border-top: 1px solid var(--line-subtle); color: var(--text-secondary); font-size: 13px; font-variant-numeric: tabular-nums; }
.history-row .result-strip { flex-wrap: nowrap; overflow: hidden; justify-content: start; gap: 5px; }
.history-row .mini-swatch { width: 23px; height: 23px; flex: 0 0 auto; }
.history-row .result-more { height: 23px; flex: 0 0 auto; }
.history-counts { min-width: 0; display: flex; align-items: center; gap: 4px; overflow: hidden; }
.empty-data { min-height: 80px; display: grid; place-items: center; color: var(--text-muted); text-align: center; font-size: 13px; }
.stats-card { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px 12px; }
.stats-card h3 { margin: 0; }
.stats-list { grid-column: 1 / -1; min-width: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); align-items: center; gap: 6px; }
.stat-row { min-height: 24px; display: inline-grid; grid-template-columns: 18px auto; align-items: center; gap: 5px; font-size: 12px; font-variant-numeric: tabular-nums; }
.stat-row .mini-swatch { width: 18px; height: 18px; border-width: 1px; }
.stat-row strong { color: var(--text-primary); }
.stat-row .stat-percent { display: none; }
.stats-total { grid-column: 2; grid-row: 1; margin: 0; padding: 0; display: flex; gap: 6px; justify-content: flex-end; border-top: 0; color: var(--text-secondary); font-size: 12px; white-space: nowrap; }
.stats-total strong { color: var(--text-primary); }

.footer { display: flex; align-items: center; justify-content: center; gap: 42px; border-top: 1px solid var(--line-subtle); color: var(--text-secondary); font-size: 14px; }
.footer a:hover { color: var(--text-primary); }
.footer span { width: 1px; height: 24px; background: var(--line-strong); }
.seo-content {
	width: min(980px, calc(100% - 36px));
	margin: 0 auto;
	padding: 56px 0 68px;
	color: var(--text-secondary);
}
.seo-content section { scroll-margin-top: 90px; }
.seo-content h2 {
	margin: 46px 0 14px;
	color: var(--text-primary);
	font-size: 30px;
	line-height: 1.15;
}
.seo-content h3 {
	margin: 0 0 8px;
	color: var(--text-primary);
	font-size: 18px;
}
.seo-content p { margin: 0 0 14px; }
.seo-content a { color: #9dccff; text-decoration: underline; text-underline-offset: 3px; }
.content-nav {
	position: sticky;
	top: 0;
	z-index: 10;
	display: flex;
	gap: 8px;
	overflow: auto;
	max-width: 100%;
	padding: 10px 0;
	background: rgba(8, 13, 18, 0.88);
	backdrop-filter: blur(14px);
	scrollbar-width: none;
}
.content-nav::-webkit-scrollbar { display: none; }
.content-nav a {
	flex: 0 0 auto;
	padding: 8px 10px;
	border: 1px solid var(--line-subtle);
	border-radius: 8px;
	color: var(--text-secondary);
	text-decoration: none;
	font-size: 13px;
	font-weight: 750;
}
.content-nav a:hover { color: var(--text-primary); background: var(--surface-2); }
.feature-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
}
.feature-grid section {
	min-width: 0;
	padding: 16px;
	border: 1px solid var(--line-subtle);
	border-radius: 8px;
	background: rgba(18, 25, 32, 0.72);
}
.feature-grid p { margin: 0; }
.steps-list { margin: 0; padding-left: 24px; }
.steps-list li { margin: 10px 0; }
.seo-content table {
	width: 100%;
	margin: 18px 0;
	border-collapse: collapse;
	overflow: hidden;
	border: 1px solid var(--line-subtle);
	border-radius: 8px;
}
.seo-content th, .seo-content td {
	padding: 12px;
	border-bottom: 1px solid var(--line-subtle);
	text-align: left;
	vertical-align: top;
}
.seo-content th { color: var(--text-primary); background: var(--surface-2); }
.seo-content tr:last-child td { border-bottom: 0; }
.public-rolls { margin-top: 16px; }
.public-roll-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 8px;
}
.public-roll-list a {
	display: grid;
	grid-template-columns: 72px 72px minmax(0, 1fr) 160px;
	gap: 12px;
	align-items: center;
	padding: 12px;
	border: 1px solid var(--line-subtle);
	border-radius: 8px;
	background: rgba(18, 25, 32, 0.72);
	color: var(--text-secondary);
	text-decoration: none;
}
.public-roll-list a:hover { background: var(--surface-2); }
.public-roll-list strong { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.public-roll-list time { text-align: right; font-size: 13px; }
.public-roll-swatches { display: flex; gap: 6px; overflow: hidden; }
.public-roll-swatches span {
	width: 24px;
	height: 24px;
	overflow: hidden;
	border: 1px solid rgba(255,255,255,.72);
	border-radius: 5px;
	background: var(--swatch);
	text-indent: -999px;
}
.public-roll-counts { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.public-roll-empty {
	padding: 18px;
	border: 1px dashed var(--line-strong);
	border-radius: 8px;
	text-align: center;
}
.seo-content details {
	border-top: 1px solid var(--line-subtle);
	padding: 12px 0;
}
.seo-content details:last-child { border-bottom: 1px solid var(--line-subtle); }
.seo-content summary { color: var(--text-primary); font-weight: 800; cursor: pointer; }
.seo-content details p { margin: 8px 0 0; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 50; transform: translate(-50%, 20px); padding: 10px 16px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface-3); box-shadow: 0 12px 34px rgba(0,0,0,.45); opacity: 0; pointer-events: none; transition: 180ms ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* More than six results favor a dense square matrix plus aggregate counts. */
.dice-grid.result-matrix { min-height: 310px; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; align-content: center; align-items: center; gap: 14px; }
.matrix-grid { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(54px, 1fr)); align-content: center; justify-items: center; gap: 12px; }
.matrix-swatch { width: 100%; aspect-ratio: 1; max-width: 72px; border: 2px solid rgba(255,255,255,.8); border-radius: 9px; background: var(--result-color); box-shadow: inset 0 12px 16px rgba(255,255,255,.16), inset 0 -16px 20px rgba(0,0,0,.24), 0 8px 18px rgba(0,0,0,.24); animation: matrix-in 440ms cubic-bezier(.2,.9,.2,1) both; animation-delay: var(--delay); }
.matrix-grid.dense { grid-template-columns: repeat(auto-fit, minmax(30px, 1fr)); gap: 7px; }
.matrix-grid.dense .matrix-swatch { border-radius: 5px; border-width: 1px; }
.stage-counts { width: fit-content; max-width: 100%; justify-self: center; padding: 8px; border: 1px solid var(--line-subtle); border-radius: 12px; background: rgba(7,11,15,.76); box-shadow: 0 10px 30px rgba(0,0,0,.22); }
@keyframes matrix-in { from { opacity: 0; transform: translateY(-14px) scale(.75); } to { opacity: 1; transform: none; } }

.exit-stream {
	display: none;
	border: 1px solid var(--line-strong);
	background: rgba(7,11,15,.72);
	color: var(--text-primary);
	backdrop-filter: blur(12px);
}
body.stream-mode .exit-stream {
	position: fixed;
	left: 22px;
	top: 20px;
	z-index: 30;
	height: 44px;
	padding: 0 14px 0 10px;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	border-radius: 9px;
	font-size: 13px;
	font-weight: 750;
	cursor: pointer;
}
body.stream-mode .exit-stream:hover { background: var(--surface-3); }
.exit-stream svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.roll-loading {
	position: absolute;
	left: 50%;
	top: 50%;
	z-index: 12;
	min-width: 230px;
	padding: 14px 18px;
	transform: translate(-50%, -50%);
	display: grid;
	justify-items: center;
	gap: 10px;
	border: 1px solid var(--line-strong);
	border-radius: 14px;
	background: rgba(7,11,15,.88);
	box-shadow: 0 18px 60px rgba(0,0,0,.42);
	backdrop-filter: blur(16px);
	font-size: 13px;
}
.color-loader { height: 24px; display: flex; align-items: center; gap: 6px; }
.color-loader span { width: 12px; height: 12px; border: 1px solid rgba(255,255,255,.72); border-radius: 4px; animation: loader-wave 680ms ease-in-out infinite alternate; }
.color-loader span:nth-child(1) { background: var(--danger); animation-delay: 0ms; }
.color-loader span:nth-child(2) { background: var(--orange); animation-delay: 70ms; }
.color-loader span:nth-child(3) { background: var(--yellow); animation-delay: 140ms; }
.color-loader span:nth-child(4) { background: var(--green); animation-delay: 210ms; }
.color-loader span:nth-child(5) { background: var(--blue); animation-delay: 280ms; }
.color-loader span:nth-child(6) { background: var(--purple); animation-delay: 350ms; }
@keyframes loader-wave { from { transform: translateY(5px) rotate(-5deg); opacity: .45; } to { transform: translateY(-5px) rotate(5deg); opacity: 1; box-shadow: 0 0 12px currentColor; } }

body.stream-mode { grid-template-rows: 1fr; background: transparent; }
body.stream-mode .topbar, body.stream-mode .proof-column, body.stream-mode .footer, body.stream-mode .hero-copy, body.stream-mode .seo-content { display: none; }
body.stream-mode .app-shell { width: 100%; min-height: 100dvh; display: block; border: 0; }
body.stream-mode .play-column { min-height: 100dvh; padding: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto auto; }
body.stream-mode .dice-stage { min-height: 0; background: radial-gradient(ellipse at center, rgba(14,20,26,.82), rgba(5,9,13,.96)); }
body.stream-mode.stream-transparent .dice-stage { background: transparent; }
body.stream-mode.stream-transparent .stage-floor,
body.stream-mode.stream-transparent .dice-grid::before { display: none; }
body.stream-mode .dice-grid { align-self: stretch; min-height: 0; padding: clamp(38px, 6vh, 72px) 5vw; }
body.stream-mode .die-result { --die-size: clamp(54px, 4.6vw, 72px); max-width: clamp(190px, 19vw, 280px); height: auto; aspect-ratio: 1; }
body.stream-mode .die-scene { top: 28px; right: 28px; }
body.stream-mode .tile-label { font-size: clamp(14px, 1.4vw, 22px); }
body.stream-mode .control-bar {
	display: grid;
	min-height: 128px;
	padding: 20px 5vw 26px;
	grid-template-columns: 182px minmax(320px, 680px) 138px;
	justify-content: center;
	gap: clamp(24px, 4vw, 64px);
	background: rgba(7,11,15,.92);
	backdrop-filter: blur(16px);
}
body.stream-mode .status-message { background: rgba(7,11,15,.92); }
.stream-proof { display: none; }
body.stream-mode .stream-proof {
	position: absolute;
	left: 5vw;
	right: 5vw;
	bottom: 18px;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	color: var(--text-primary);
	font-size: clamp(20px, 2.6vw, 42px);
	font-weight: 850;
	font-variant-numeric: tabular-nums;
}
body.stream-mode .stream-proof::before { content: "✓"; width: 1.45em; height: 1.45em; display: grid; place-items: center; border-radius: 50%; background: var(--success); color: #07130a; font-size: .62em; }
body.stream-mode .stream-proof-copy { white-space: nowrap; }
body.stream-mode .stream-qr { width: clamp(64px, 6vw, 92px); height: clamp(64px, 6vw, 92px); margin-left: 8px; padding: 4px; border-radius: 8px; background: #fff; }

@media (min-width: 720px) and (max-height: 860px) {
	body:not(.stream-mode) .play-column { padding-top: 28px; grid-template-rows: auto minmax(330px, 1fr) auto auto; }
	body:not(.stream-mode) .hero-copy { padding-bottom: 16px; }
	body:not(.stream-mode) .hero-copy h1 { font-size: 56px; }
	body:not(.stream-mode) .hero-copy p { margin-top: 8px; font-size: 16px; }
	body:not(.stream-mode) .dice-stage { min-height: 330px; }
	body:not(.stream-mode) .dice-grid { min-height: 300px; padding-block: 36px 32px; }
	body:not(.stream-mode) .control-bar { min-height: 150px; padding-block: 22px; }
	body:not(.stream-mode) .stepper { height: 58px; }
	body:not(.stream-mode) .roll-button { height: 64px; }
	body:not(.stream-mode) .proof-column { padding-top: 18px; padding-bottom: 16px; }
	body:not(.stream-mode) .history-list { max-height: 150px; }
}

@media (max-width: 1279px) {
	.topbar { padding-inline: 24px; }
	.app-shell { grid-template-columns: minmax(0, 1fr) 360px; }
	.play-column { padding-top: 38px; }
	.hero-copy { padding-inline: 28px; }
	.dice-grid { padding-inline: 26px; }
	.control-bar { padding-inline: 28px; grid-template-columns: 158px minmax(220px, 1fr) 110px; gap: 24px; }
	.proof-column { padding-right: 24px; }
	.data-grid { grid-template-columns: 1fr; }
	.history-list { max-height: 190px; }
}

@media (max-width: 959px) {
	body { grid-template-rows: 68px auto 76px; }
	.topbar { grid-template-columns: 1fr auto; }
	.language-switch { width: 230px; }
	.stream-entry { display: none; }
	.app-shell { display: block; }
	.play-column { padding-top: 36px; }
	.proof-column { padding: 20px 24px 28px; }
	.data-grid { grid-template-columns: minmax(0, 1fr); }
	.history-list { max-height: 270px; }
	.feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.public-roll-list a { grid-template-columns: 70px 66px minmax(0, 1fr); }
	.public-roll-list time { grid-column: 1 / -1; text-align: left; }
}

@media (max-width: 719px) {
	body { grid-template-rows: auto auto 70px; }
	.topbar { min-height: 116px; padding: 14px 16px; grid-template-columns: 1fr; gap: 10px; }
	.brand-lockup { font-size: 23px; }
	.brand-cube { width: 40px; height: 40px; }
	.language-switch { width: 100%; }
	.play-column { padding-top: 22px; grid-template-rows: auto minmax(330px, auto) auto auto; }
	.hero-copy { padding: 0 18px 16px; }
	.hero-copy h1 { font-size: 48px; }
	.hero-copy p { font-size: 15px; }
	.dice-stage { min-height: 330px; }
	.stage-floor { left: -20%; right: -20%; bottom: -10%; }
	.dice-grid { min-height: 310px; grid-template-columns: repeat(2, 1fr) !important; align-content: center; gap: 14px 8px; padding: 18px; }
	.dice-grid::before { left: 8px; right: 8px; top: 12px; bottom: 12px; border-radius: 18px; }
	.die-result { --die-size: 40px; max-width: 132px; height: auto; aspect-ratio: 1; border-radius: 14px; }
	.die-scene { top: 14px; right: 14px; }
	.tile-index { left: 13px; top: 12px; }
	.tile-label { left: 13px; bottom: 11px; font-size: 11px; }
	.dice-grid.compact-tiles .die-result { max-width: 106px; height: auto; aspect-ratio: 1; }
	.control-bar { min-height: 0; padding: 18px 16px 20px; grid-template-columns: 1fr auto; gap: 14px; }
	.count-control { order: 1; }
	.sound-control { order: 2; justify-items: end; }
	.roll-button { order: 3; grid-column: 1 / -1; width: 100%; }
	.control-bar .roll-button { height: 64px; }
	.stepper { width: 176px; }
	.status-message { padding-inline: 16px; }
	.proof-column { padding: 18px 16px 24px; }
	.verification-heading h2 { font-size: 25px; }
	.proof-detail { grid-template-columns: minmax(0, 1fr) 132px; }
	.qr { width: 132px; height: 132px; }
	.data-grid { grid-template-columns: 1fr; }
	.stats-card { grid-template-columns: 1fr; gap: 8px; }
	.stats-list { grid-column: 1; grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.stats-total { grid-column: 1; grid-row: auto; justify-content: space-between; }
	.footer { gap: 15px; font-size: 12px; }
	.footer span { height: 18px; }
	.seo-content { width: calc(100% - 32px); padding: 36px 0 48px; }
	.seo-content h2 { font-size: 25px; }
	.content-nav { margin-inline: -16px; padding-inline: 16px; }
	.feature-grid { grid-template-columns: 1fr; }
	.seo-content table { display: block; overflow-x: auto; }
	.public-roll-list a { grid-template-columns: 1fr; gap: 7px; }
	.public-roll-list time { text-align: left; }
	.dice-grid.result-matrix { grid-template-columns: minmax(0, 1fr) !important; min-height: 310px; }
	.matrix-grid { grid-template-columns: repeat(5, 1fr); }
	.matrix-grid.dense { grid-template-columns: repeat(20, 1fr); gap: 3px; }
	.stage-counts { padding: 6px; gap: 5px; }
	.stage-counts .count-chip { min-width: 0; height: 25px; padding: 0 6px; }
	.stage-counts .count-name { display: none; }
	body.stream-mode .exit-stream { left: 12px; top: 12px; height: 40px; padding-right: 10px; }
	body.stream-mode .exit-stream span { display: none; }
	body.stream-mode .dice-grid { min-height: 0; padding: 20px 18px; }
	body.stream-mode .die-result { max-width: 132px; }
	body.stream-mode .control-bar { min-height: 0; padding: 20px 16px 26px; grid-template-columns: 1fr auto; justify-content: stretch; gap: 18px 14px; }
	body.stream-mode .count-control { order: 1; }
	body.stream-mode .sound-control { order: 2; justify-items: end; }
	body.stream-mode .roll-button { order: 3; grid-column: 1 / -1; width: 100%; }
}

@media (max-width: 379px) {
	.proof-detail { grid-template-columns: 1fr; grid-template-areas: "id" "snapshot" "qr" "actions"; }
	.qr-block .proof-label { text-align: center; }
	.proof-actions { grid-template-columns: 1fr; }
}

@media (max-height: 520px) and (orientation: landscape) {
	body:not(.stream-mode) { grid-template-rows: 58px auto; }
	body:not(.stream-mode) .topbar { min-height: 58px; grid-template-columns: 1fr auto 1fr; padding-block: 6px; }
	body:not(.stream-mode) .brand-cube { width: 36px; height: 36px; }
	body:not(.stream-mode) .language-switch { width: 220px; height: 38px; }
	body:not(.stream-mode) .stream-entry { display: inline-flex; height: 38px; min-width: 130px; }
	body:not(.stream-mode) .app-shell { height: calc(100dvh - 58px); overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) 320px; }
	body:not(.stream-mode) .play-column { height: calc(100dvh - 58px); padding: 0; grid-template-rows: minmax(0, 1fr) 76px auto; }
	body:not(.stream-mode) .hero-copy { display: none; }
	body:not(.stream-mode) .dice-stage { min-height: 0; }
	body:not(.stream-mode) .dice-grid { min-height: 0; grid-template-columns: repeat(4, 1fr); padding: 10px 12px 6px; }
	body:not(.stream-mode) .die-result { --die-size: 32px; max-width: 88px; height: auto; aspect-ratio: 1; }
	body:not(.stream-mode) .die-scene { top: 10px; right: 10px; }
	body:not(.stream-mode) .tile-label { bottom: 8px; font-size: 9px; }
	body:not(.stream-mode) .tile-index { top: 8px; left: 10px; font-size: 9px; }
	body:not(.stream-mode) .control-bar { min-height: 76px; padding: 10px 18px; grid-template-columns: 130px 1fr 82px; gap: 12px; }
	body:not(.stream-mode) .control-label { display: none; }
	body:not(.stream-mode) .stepper, body:not(.stream-mode) .roll-button { height: 50px; }
	body:not(.stream-mode) .proof-column { padding: 12px 12px 12px 0; }
	body:not(.stream-mode) .proof-card { padding: 12px; }
	body:not(.stream-mode) .verification-heading { gap: 10px; padding-bottom: 10px; }
	body:not(.stream-mode) .verification-heading .shield { width: 38px; }
	body:not(.stream-mode) .verification-heading h2 { font-size: 24px; }
	body:not(.stream-mode) .proof-detail { grid-template-columns: minmax(0, 1fr) 112px; gap: 8px; padding: 10px; }
	body:not(.stream-mode) .game-id { font-size: 17px; }
	body:not(.stream-mode) .icon-button { display: none; }
	body:not(.stream-mode) .qr { width: 112px; height: 112px; padding: 5px; }
	body:not(.stream-mode) .proof-meta-row time { font-size: 11px; }
	body:not(.stream-mode) .proof-actions { display: none; }
	body:not(.stream-mode) .data-grid, body:not(.stream-mode) .footer { display: none; }
	body:not(.stream-mode) .empty-proof { min-height: 190px; }
	body.stream-mode .play-column { min-height: 100dvh; grid-template-rows: minmax(0, 1fr) 76px auto; }
	body.stream-mode .dice-grid { padding: 14px 4vw; }
	body.stream-mode .die-result { max-width: 112px; }
	body.stream-mode .stream-qr { width: 56px; height: 56px; }
	body.stream-mode .control-bar { min-height: 76px; padding: 10px 18px; grid-template-columns: 130px minmax(220px, 1fr) 82px; gap: 12px; }
	body.stream-mode .control-label { display: none; }
	body.stream-mode .stepper, body.stream-mode .roll-button { height: 50px; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { scroll-behavior: auto !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
	.electric-border-canvas { filter: drop-shadow(0 0 4px rgba(73,213,104,.55)); }
}
