/* ============================================================
   Poker Clock — modern restyle
   Palette + layout are CSS-driven; the game JS still owns a few
   inline styles (progress-bar fill colour, show/hide toggles,
   body.paused), so all the original IDs/classes are preserved.
   ============================================================ */

:root {
	--bg: #eef1f5;
	--card: #ffffff;
	--ink: #18212f;
	--muted: #64748b;
	--line: #e3e8ef;
	--felt: #15803d;
	--felt-deep: #0c3d22;
	--accent: #16a34a;
	--accent-ink: #0f5a2e;
	--danger: #dc2626;
	--radius: 14px;
	--shadow: 0 1px 2px rgba(16,24,40,.06), 0 8px 24px rgba(16,24,40,.07);
	--font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box }

body {
	margin: 0;
	padding: 32px 20px 64px;
	font-family: var(--font);
	font-size: 16px;
	line-height: 1.45;
	color: var(--ink);
	background: var(--bg);
	-webkit-font-smoothing: antialiased;
}

h1 {
	max-width: 1080px;
	margin: 0 auto 24px;
	font-size: clamp(26px, 4vw, 34px);
	font-weight: 800;
	letter-spacing: -0.02em;
}

a { color: var(--accent-ink); text-decoration: none; font-weight: 600 }
a:hover { text-decoration: underline }

/* ---- Cards (fieldsets) ---- */
fieldset {
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--card);
	box-shadow: var(--shadow);
	padding: 18px 20px 20px;
	margin: 0 0 20px;
}
fieldset fieldset { box-shadow: none; margin: 14px 0 0 }
legend {
	font-size: 17px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--ink);
	padding: 0 6px;
}
.floatNextToLegend { float: right; margin-top: -2px }

/* ---- Form controls ---- */
input, select, button {
	font-family: var(--font);
	font-size: 15px;
	color: var(--ink);
}
input[type=text], input[type=number], select {
	padding: 8px 10px;
	border: 1px solid var(--line);
	border-radius: 9px;
	background: #fff;
	transition: border-color .15s, box-shadow .15s;
}
input[type=text]:focus, input[type=number]:focus, select:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px rgba(22,163,74,.15);
}
label { color: var(--muted); font-weight: 600; font-size: 14px }
form { margin: 0; padding: 0 }

/* Buttons */
input[type=submit], input[type=button], button {
	cursor: pointer;
	border: 1px solid transparent;
	border-radius: 9px;
	padding: 8px 14px;
	font-weight: 600;
	background: var(--accent);
	color: #fff;
	transition: background .15s, transform .05s, box-shadow .15s;
}
input[type=submit]:hover, input[type=button]:hover, button:hover { background: var(--accent-ink) }
input[type=submit]:active, input[type=button]:active, button:active { transform: translateY(1px) }
input:disabled, button:disabled { opacity: .45; cursor: default }

/* Neutral buttons: the per-player row actions (-£ / +£ / out / in) */
td.action button {
	background: #f1f5f9;
	color: var(--ink);
	border: 1px solid var(--line);
	padding: 6px 10px;
}
td.action button:hover { background: #e2e8f0 }
.timeButton { font-weight: 700; min-width: 40px }

/* ---- Layout ---- */
#gameContainer {
	max-width: 1080px;
	margin: 0 auto;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 22px;
	align-items: start;
}
.col { min-width: 0 }
@media (max-width: 820px) {
	#gameContainer { grid-template-columns: 1fr }
}

/* ---- Poker clock ---- */
#pokerClock ul { list-style: none; margin: 16px 0 0; padding: 0 }
#pokerClock ul li { padding: 7px 0; border-bottom: 1px dashed var(--line); color: var(--muted); font-size: 15px }
#pokerClock ul li:last-child { border-bottom: 0 }
#stackContainer { display: contents }

/* Blinds display: a dark felt bar with the level overlaid */
.blindsDisplay { position: relative; height: 92px; margin: 4px 0 14px }
#blindProgressContainer {
	position: absolute; inset: 0;
	border-radius: 12px;
	background: var(--felt-deep);
	overflow: hidden;
	box-shadow: inset 0 1px 3px rgba(0,0,0,.35);
}
#blindProgressBar {
	height: 100%; width: 0;
	background: var(--felt);   /* JS overrides this per blind level */
	transition: width .4s linear;
	opacity: .55;
}
#currentBlinds {
	position: absolute; inset: 0; margin: 0; z-index: 2;
	display: flex; align-items: center; justify-content: center;
	font-size: clamp(34px, 6vw, 52px); font-weight: 800; letter-spacing: -0.01em;
	color: #fff; text-shadow: 0 2px 6px rgba(0,0,0,.45);
	font-variant-numeric: tabular-nums;
}
#currentBlindsShadow { display: none }
.blindControls { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap }
.timeButtons { display: flex; gap: 6px }
#nextBlindsContainer { margin: 0; color: var(--muted); font-size: 15px }
#nextBlinds { color: var(--ink); font-weight: 700 }
#blindChangeTime { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums }
#gameTime { font-variant-numeric: tabular-nums }
.expired { color: var(--danger); font-weight: 700 }

/* "paused" status pill */
#pausedText {
	display: none; margin: 14px 0 0;
	font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
	color: var(--danger);
}
#pausedText i { color: var(--danger) }
body.paused #pausedText { display: block }

/* When paused, the blinds card reddens and pulses subtly. */
body.paused #pokerClock > fieldset:first-of-type {
	border-color: var(--danger);
	animation: blindsPausePulse 1.8s ease-in-out infinite alternate;
}
@keyframes blindsPausePulse {
	from { box-shadow: var(--shadow), 0 0 0 1px rgba(220,38,38,.25); background: #fff; }
	to   { box-shadow: var(--shadow), 0 0 0 4px rgba(220,38,38,.28); background: #fff5f5; }
}

/* ---- Tables (players + prize pool) ---- */
table { border-collapse: collapse; width: 100%; margin-top: 12px }
th {
	text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em;
	color: var(--muted); font-weight: 700; padding: 6px 8px; border-bottom: 2px solid var(--line);
}
td { padding: 8px; border-bottom: 1px solid var(--line); font-size: 15px }
tr:last-child td { border-bottom: 0 }
td.action { text-align: right; white-space: nowrap }
td.action button { padding: 4px 8px; margin-left: 4px; font-size: 13px; min-width: 0 }
.actionImage { cursor: pointer; vertical-align: middle; margin-left: 8px; color: var(--muted) }
.actionImage:hover { color: var(--danger) }

tr.inPlay td { background: #f0fdf4 }
tr.outOfGame td { color: var(--muted) }
tr.unpaid .buyin { font-style: italic }
.unpaid td { color: var(--danger) }
.rebought .buyin { font-weight: 700 }
#prizePoolTable td { color: var(--ink) }

/* ---- Intro page ---- */
#introPage { max-width: 1080px; margin: 0 auto }
#introPage > p { max-width: 46em; color: var(--muted); font-size: 17px }
.featureGrid { display: flex; flex-wrap: wrap; gap: 6px 48px; margin: 0 0 8px }
.featureGrid ul { margin: 0; padding-left: 22px }
.featureGrid li { padding: 3px 0 }
.formRow { display: flex; flex-wrap: wrap; gap: 22px; margin: 22px 0 }
.formRow fieldset { flex: 1 1 320px; margin: 0 }
.field { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0 }
.field label { flex: 0 0 auto }
.field input, .field select { flex: 0 0 auto }
.startBtn { width: 100% }
.startBtn input { width: 100% }
.muted { color: var(--muted) }

/* ---- Loading ---- */
#loading { max-width: 1080px; margin: 0 auto }
.loading { font-size: 20px; color: var(--muted) }
.loading img { width: 22px; height: 22px }

br.spacer { display: none }
