/*
   The themes: every colour, line and motion variable, a block per theme
   (Classic, Focus, High contrast). A theme changes only these.
   Loaded first of the app's styles; the rest follow in index.html's order, and a later rule wins. */

/* THEME */

:root {
	--line: 2.6px; /* every border and outline */
	--card-inset: 1.75vmin; /* where a player card's text starts, in from its panel's edge (not scaled with the card: it's the panel's) */
	--m: 1vmin; /* sizes inside the menus: bigger on a phone, upright or sideways (PHONE) */
	--top-drop: 0px; /* how far the top buttons sit below the notch's margin */
	/* Sizes inside the keypad and the darts column: 1vmin, but smaller where
	   those are narrower than usual (landscape squarer than 4:3; see PORTRAIT
	   for the band), so text never outgrows its key. */
	--u: min(1vmin, 0.75vw);
	--radius: 10px;
}

/* THEMES: Classic is these; the others (below) change only colours and motion,
   picked in the menu's Theme (prefs.theme, on <html data-theme>, set before the
   page shows by js/theme-early.js). A theme's preview tile carries data-theme too,
   so each block must also work on any element, not only the page. */
:root,
[data-theme="classic"] {
	--border: var(--line) solid white;
	--border-muted: var(--line) solid #969696;
	--text: white;
	--text-muted: #969696;
	--text-soft: #c8c8c8;
	--value: white; /* the thrower's stats and past visits */
	--value-idle: #c8c8c8; /* everyone else's: lighter than their labels (--text-soft at most) */
	--panel: linear-gradient(#484848, #161616);
	--button: linear-gradient(#808080, #484848);
	--button-disabled: linear-gradient(#484848, #161616);
	--button-pressed: linear-gradient(#484848, #161616);
	--row: #161616;
	--page: linear-gradient(#000000, #161616, #000000); /* behind the game and the start screen: black at the top (the status bar's black runs into it) and the bottom, a dark grey in the middle */
	--field: #161616; /* text fields, and a key that can't be pressed */
	--panel-soft: linear-gradient(#323232, #161616); /* the darts card's hint, menu fields */
	--card-top: #484848; /* a player's card, while not throwing */
	--card-bottom: #161616;
	--card-middle: #323232; /* the same, 1-2 players: where their name and stats meet */
	--key-display: linear-gradient(#484848, #323232); /* where the keypad shows what's typed */
	--checkout: #00c800;
	--checkout-now: #00fa00; /* the thrower's finish */
	--go-top: #328016; /* the main button (Start) and the button that sends a score */
	--go-bottom: #164816;
	--active-top: #64b2ff; /* the player throwing */
	--active-bottom: #3264b2;
	--active-big-middle: #4880c8; /* the same, 1-2 players: where their name and stats meet */
	--active-line: #163248; /* their history and stats lines */
	--dim: brightness(0.5); /* players out of focus while a score is entered or a player edited */
	--edit: #e4b248; /* a player whose menu is open, and the menu */
	--edit-dark: #806416; /* the bottom of its gradient */
	--menu-row: linear-gradient(var(--edit), var(--edit-dark));
	--menu-line: #323216; /* their history and stats lines */
	--menu-panel: linear-gradient(#483216, #161600);
	/* The menus' coloured buttons, one weight each: blue the account (Join a game,
	   Game history, signing in), amber puts aside and is the profile (Pause, Profile),
	   red ends (End, Delete). Green is --go-top and --go-bottom, edged --checkout. */
	--account-line: #64b2ff;
	--account-top: #3264b2;
	--account-bottom: #163248;
	--aside-line: #e4b248;
	--aside-top: #966416;
	--aside-bottom: #483216;
	--end-line: #ff3216;
	--end-top: #801616;
	--end-bottom: #321600;
	--history-muted: #646464; /* zero and bust visits */
	--ton-forty: #ffb248; /* 140+ visits */
	--max: #ff6432; /* 180s */
	--star-game: #ffc848; /* the star on a player's best visit of the game */
	--font: "Roboto Flex", sans-serif;
	--font-condensed: "Roboto Condensed", sans-serif;
	--bust: #ff3216;
	/* Dartboard */
	--board-black: #000000;
	--board-white: #ffffff;
	--board-red: #b23216;
	--board-green: #64b248;
	--board-legend: #000000;
	--board-number: #ffffff;
	--board-seam: rgba(0, 0, 0, 0.6);
	--board-hit: #ffc848;
	/* The heatmap's beds, fewest darts to most (heatLevel in board.js). */
	--heat-1: #3264b2;
	--heat-2: #32b2c8;
	--heat-3: #48c848;
	--heat-4: #e4e432;
	--heat-5: #fa9632;
	--heat-6: #e43232;
	--dart-edit: #ffc848; /* a dart picked up to move: always this yellow, whatever the highlight colour */
	--dart-flight: #3280e4; /* blue for now: one day, your own darts */
	/* The darts card's slots, each in its bed's colour on this theme's board. */
	--slot-black: linear-gradient(#646464, #161616);
	--slot-white: linear-gradient(#c8c8c8, #808080);
	--slot-white-text: white;
	--slot-red: linear-gradient(#ff3216, #961616);
	--slot-green: linear-gradient(#48c832, #328016);
	--ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
	--ease-back: cubic-bezier(0.34, 1.56, 0.64, 1);
	--fast: 120ms;
	--medium: 220ms;
	--slow: 400ms;
}

/* Focus: for serious play. Flat panels, one accent (the green of a finish), a
   matte board, and quicker, quieter movement. */
[data-theme="focus"] {
	--text-soft: #b2b2b2;
	--panel: linear-gradient(#161616, #161616);
	--button: linear-gradient(#323232, #323232);
	--button-disabled: linear-gradient(#161616, #161616);
	--button-pressed: linear-gradient(#161616, #161616);
	--row: #000000;
	--page: linear-gradient(#000000, #000000);
	--field: #000000;
	--panel-soft: linear-gradient(#161616, #161616);
	--card-top: #161616;
	--card-bottom: #161616;
	--card-middle: #161616;
	--key-display: linear-gradient(#161616, #161616);
	--go-top: #326416;
	--go-bottom: #326416;
	--active-top: #164832;
	--active-bottom: #164832;
	--active-big-middle: #164832;
	--active-line: #001616;
	--edit: #c89648;
	--edit-dark: #644816;
	--menu-row: linear-gradient(#644816, #644816); /* as deep as the thrower's green */
	--menu-line: #321600;
	--menu-panel: linear-gradient(#321600, #321600);
	--account-line: #4896e4;
	--account-top: #164896;
	--account-bottom: #164896;
	--aside-line: #c89648;
	--aside-top: #644816;
	--aside-bottom: #644816;
	--end-line: #e43216;
	--end-top: #801616;
	--end-bottom: #801616;
	--board-black: #161616;
	--board-white: #e4e4c8;
	--board-red: #961616;
	--board-green: #328032;
	--board-number: #e4e4c8;
	--slot-black: linear-gradient(#323232, #323232);
	--slot-white: linear-gradient(#969680, #969680);
	--slot-red: linear-gradient(#961616, #961616);
	--slot-green: linear-gradient(#328032, #328032);
	--fast: 80ms;
	--medium: 140ms;
	--slow: 240ms;
}

/* High contrast: for bright rooms and easy reading. Black, white and strong
   colours, with nothing faded. */
[data-theme="contrast"] {
	--border-muted: var(--line) solid #c8c8c8;
	--text-muted: #c8c8c8;
	--text-soft: #e4e4e4;
	--value-idle: #fafafa;
	--panel: linear-gradient(#000000, #000000);
	--button: linear-gradient(#323232, #323232);
	--button-disabled: linear-gradient(#000000, #000000);
	--button-pressed: linear-gradient(#000000, #000000);
	--row: #000000;
	--page: linear-gradient(#000000, #000000);
	--field: #000000;
	--panel-soft: linear-gradient(#000000, #000000);
	--card-top: #000000;
	--card-bottom: #000000;
	--card-middle: #000000;
	--key-display: linear-gradient(#000000, #000000);
	--checkout: #00ff00;
	--checkout-now: #ffff00;
	--go-top: #006400;
	--go-bottom: #006400;
	--active-top: #0032c8;
	--active-bottom: #0032c8;
	--active-big-middle: #0032c8;
	--active-line: #000064;
	--dim: brightness(0.35);
	--edit: #ffc800;
	--edit-dark: #966400;
	--menu-row: linear-gradient(#966400, #966400);
	--menu-line: #321600;
	--menu-panel: linear-gradient(#000000, #000000);
	--account-line: #64b2ff;
	--account-top: #0032c8;
	--account-bottom: #0032c8;
	--aside-line: #ffc800;
	--aside-top: #966400;
	--aside-bottom: #966400;
	--end-line: #ff3216;
	--end-top: #b20000;
	--end-bottom: #b20000;
	--history-muted: #969696;
	--board-black: #000000;
	--board-white: #ffffff;
	--board-red: #e40000;
	--board-green: #00b200;
	--slot-black: linear-gradient(#000000, #000000);
	--slot-white: linear-gradient(#ffffff, #ffffff);
	--slot-white-text: black;
	--slot-red: linear-gradient(#e40000, #e40000);
	--slot-green: linear-gradient(#00b200, #00b200);
}

input,
select,
textarea {
	user-select: text;
	-webkit-user-select: text;
}

[hidden] {
	display: none !important;
}
