:root {
	color-scheme: light;

	/* Page surfaces and interface colors. */
	--ink: #000;
	--muted: #000;
	--paper: oklch(97% 0 none);
	--page: oklch(98.5% 0 none);
	--panel: oklch(100% 0 0);
	--line: oklch(60% 0.02 145);
	--control: var(--svg-color-accent);
	--control-hover-mix: #000;
	--control-hover-amount: 20%;
	--button-ink: #fff;
	--disabled-bg: oklch(90% 0.012 145);
	--disabled-ink: #000;
	--grid-line: rgba(255, 255, 255, 0.32);
	--focus: #000;
	--board: oklch(14.7% 0.004 49.25);
	--board-dark: var(--board);

	/* Keep geometry in rem: mahjong.js reads it before scaling the board.
	   Row and column steps are half the face height and width. */
	--tile-width: 3.15rem;
	--tile-height: 4.05rem;
	--tile-depth-x: 0.45rem;
	--tile-depth-y: 0.45rem;
	--tile-radius: 2px;
	--tile-column-step: 1.575rem;
	--tile-row-step: 2.025rem;
	--tile-face-light: #fffef6;
	--tile-face-dark: #eeeadd;
	--tile-face-border: #ebe8dd;
	--tile-selected: #d39320;
	--tile-focus: #1677ff;
	--tile-selected-inner: #fff;
	--tile-shadow-color: rgba(0, 0, 0, 0.3);

	/* Surface effects: complete shadows are static; tile shadows also use
	   scaled depth, so style.css computes their geometry on each tile. */
	--panel-shadow: 0 1.25rem 3.5rem rgba(24, 31, 33, 0.16);
	--board-shadow: inset 0 0 2.5rem rgba(0, 0, 0, 0.28);
	--board-highlight: rgba(255, 255, 255, 0.08);
	--dialog-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.28);
	--dialog-backdrop: rgba(15, 19, 21, 0.68);

	/* Shared typography and theme transition timing. */
	--font-body: Verdana, Arial, ui-sans-serif, system-ui, sans-serif;
	--font-heading: Georgia, "Times New Roman", serif;
	--theme-transition-duration: 350ms;
	--theme-transition-easing: ease-in-out;

	/* SVG colors are replaced in the image tokens by recoloring.js. Every
	   reference in the SVG also carries a fallback for no-JavaScript use. */
	--svg-color-primary: oklch(40% 0.13 25);
	--svg-color-secondary: #006891;
	--svg-color-tertiary: oklch(57.564% 0.16657 44.302);
	--svg-color-accent: oklch(0.469 0.118 144.856);
	--svg-color-neutral: #6f509f;

	--svg-color-tile-outer: #858b7d;
	--svg-color-tile-inner: #d7d5c9;
	--svg-color-tile-stroke: #d7d5c9;
}

/* Both page colors and the SVG tokens change on the same root class. */
:root.dark {
	color-scheme: dark;
	--ink: #fff;
	--muted: #fff;
	--paper: oklch(14% 0.02 145);
	--page: oklch(18% 0.018 145);
	--panel: oklch(23% 0.02 145);
	--line: oklch(52% 0.025 145);
	--control-hover-mix: #fff;
	--control-hover-amount: 40%;
	--button-ink: #000;
	--disabled-bg: oklch(52% 0 0);
	--disabled-ink: #fff;
	--focus: #fff;
	--grid-line: rgba(255, 255, 255, 0.04);
	/* Dark tile faces and neutral edges keep the bright artwork distinct. */
	--tile-face-light: #44403c;
	--tile-face-dark: #292524;
	--tile-face-border: #78716c;
	--tile-selected: #ff9a57;
	--tile-focus: #61c8f5;
	--svg-color-primary: oklch(78.844% 0.12261 20.186);
	--svg-color-secondary: #61c8f5;
	--svg-color-tertiary: oklch(77.861% 0.1462 52.464);
	--svg-color-accent: oklch(82.134% 0.22164 143.226);
	--svg-color-neutral: #c4a5fb;
	--svg-color-tile-outer: #1c1917;
	--svg-color-tile-inner: #57534e;
	--svg-color-tile-stroke: #57534e;
}

/* Shared tile depth planes; face drawings live in decks/<name>.css. */

:root {
	--svg-image-tile-bottom: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2064%2080'%20preserveAspectRatio%3D'none'%3E%3Cg%20id%3D'bottom-depth'%20shape-rendering%3D'geometricPrecision'%3E%3Cpath%20id%3D'bottom-inner-layer'%20d%3D'M55.414%2071.414A2%202%200%200%201%2054%2072H2A2%202%200%200%201%20.586%2071.414L5.586%2076.414A2%202%200%200%200%207%2077H59A2%202%200%200%200%2060.414%2076.414Z'%20fill%3D'var(--svg-color-tile-inner%2C%20%23d7d5c9)'%2F%3E%3Cpath%20id%3D'bottom-inner-stroke'%20d%3D'M60.414%2076.414L55.414%2071.414A2%202%200%200%201%2054%2072H2A2%202%200%200%201%20.586%2071.414L5.586%2076.414'%20fill%3D'none'%20stroke%3D'var(--svg-color-tile-stroke%2C%20%23ebe8dd)'%20stroke-width%3D'1'%20stroke-linecap%3D'butt'%20stroke-linejoin%3D'round'%2F%3E%3Cpath%20id%3D'bottom-outer-strip'%20d%3D'M5.586%2076.414A2%202%200%200%200%207%2077H59A2%202%200%200%200%2060.414%2076.414L63.414%2079.414A2%202%200%200%200%2062%2080H10A2%202%200%200%200%208.586%2079.414Z'%20fill%3D'var(--svg-color-tile-outer%2C%20%23858b7d)'%20stroke%3D'var(--svg-color-tile-outer%2C%20%23858b7d)'%20stroke-width%3D'1'%20stroke-linejoin%3D'round'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");
}

:root {
	--svg-image-tile-right: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2064%2080'%20preserveAspectRatio%3D'none'%3E%3Cg%20id%3D'right-depth'%20shape-rendering%3D'geometricPrecision'%3E%3Cpath%20id%3D'right-inner-layer'%20d%3D'M55.414%20.586A2%202%200%200%201%2056%202V70A2%202%200%200%201%2055.414%2071.414L60.414%2076.414A2%202%200%200%200%2061%2075V7A2%202%200%200%200%2060.414%205.586Z'%20fill%3D'var(--svg-color-tile-inner%2C%20%23d7d5c9)'%2F%3E%3Cpath%20id%3D'right-inner-stroke'%20d%3D'M60.414%205.586L55.414%20.586A2%202%200%200%201%2056%202V70A2%202%200%200%201%2055.414%2071.414L60.414%2076.414'%20fill%3D'none'%20stroke%3D'var(--svg-color-tile-stroke%2C%20%23ebe8dd)'%20stroke-width%3D'1'%20stroke-linecap%3D'butt'%20stroke-linejoin%3D'round'%2F%3E%3Cpath%20id%3D'right-outer-strip'%20d%3D'M60.414%205.586A2%202%200%200%200%2061%207V75A2%202%200%200%200%2060.414%2076.414L63.414%2079.414A2%202%200%200%200%2064%2078V10A2%202%200%200%200%2063.414%208.586Z'%20fill%3D'var(--svg-color-tile-outer%2C%20%23858b7d)'%20stroke%3D'var(--svg-color-tile-outer%2C%20%23858b7d)'%20stroke-width%3D'1'%20stroke-linejoin%3D'round'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");
}
