/* The whole look of the game.
 *
 * Kept in one file rather than scattered through the views: a poker table is a
 * handful of shapes -- felt, seats, cards, chips -- and having them together is
 * what keeps them consistent. Colours are named once here and used by name.
 */

:root {
	--felt: #14532d;
	--felt-edge: #0b3a20;
	--rail: #4a2c18;
	--ink: #f5f5f4;
	--ink-dim: #a8a29e;
	--card: #fafaf9;
	--card-ink: #1c1917;
	--red: #b91c1c;
	--chip: #eab308;
	--acting: #facc15;
	--folded: #57534e;
	--surface: #1c1917;
	--surface-raised: #292524;
	--line: #44403c;
	--radius: 10px;
	--gap: 12px;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	background: var(--surface);
	color: var(--ink);
	font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	min-height: 100vh;
}

main {
	max-width: 960px;
	margin: 0 auto;
	padding: var(--gap);
}

h1 {
	font-size: 1.4rem;
	margin: 0 0 var(--gap);
}

/* --- signing in ------------------------------------------------------- */

.entrance {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: var(--gap);
	min-height: 80vh;
	text-align: center;
}

.entrance p {
	color: var(--ink-dim);
	max-width: 32rem;
}

/* Google asks that its button be recognisable, so it is a plain light button
 * with the wordmark rather than something themed to this page. */
.google-sign-in {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: var(--card);
	color: var(--card-ink);
	border: 0;
	border-radius: var(--radius);
	padding: 10px 18px;
	font-size: 1rem;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
}

/* --- the lobby -------------------------------------------------------- */

.lobby {
	display: flex;
	flex-direction: column;
	gap: var(--gap);
	max-width: 30rem;
}

.panel {
	background: var(--surface-raised);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: var(--gap);
}

.panel h2 {
	font-size: 1rem;
	margin: 0 0 8px;
}

label {
	display: block;
	color: var(--ink-dim);
	font-size: 0.85rem;
	margin-bottom: 4px;
}

input {
	width: 100%;
	background: var(--surface);
	color: var(--ink);
	border: 1px solid var(--line);
	border-radius: 6px;
	padding: 8px;
	font: inherit;
	margin-bottom: 8px;
}

/* A table code is read out loud and typed in, so it is spaced and unambiguous. */
input.code {
	text-transform: uppercase;
	letter-spacing: 0.3em;
	font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

button {
	background: var(--felt);
	color: var(--ink);
	border: 1px solid var(--felt-edge);
	border-radius: 6px;
	padding: 8px 14px;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

button:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

button.secondary {
	background: transparent;
	border-color: var(--line);
}

/* --- the table -------------------------------------------------------- */

.table {
	display: flex;
	flex-direction: column;
	gap: var(--gap);
}

.felt {
	background: radial-gradient(ellipse at center, var(--felt), var(--felt-edge));
	border: 10px solid var(--rail);
	border-radius: 140px / 90px;
	padding: 28px var(--gap);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--gap);
	min-height: 240px;
}

.board {
	display: flex;
	gap: 8px;
	min-height: 84px;
	align-items: center;
}

.pot {
	color: var(--chip);
	font-weight: 700;
}

.seats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 8px;
	width: 100%;
}

.seat {
	background: rgba(0, 0, 0, 0.28);
	border: 1px solid transparent;
	border-radius: var(--radius);
	padding: 8px;
	font-size: 0.9rem;
}

.seat.empty {
	color: var(--ink-dim);
	border-style: dashed;
	border-color: var(--line);
}

/* Whose turn it is has to be obvious at a glance from across the room. */
.seat.acting {
	border-color: var(--acting);
	box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.35);
}

.seat.folded {
	color: var(--folded);
}

.seat .name {
	font-weight: 600;
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.seat .stack {
	color: var(--chip);
}

.seat .committed {
	color: var(--ink-dim);
}

/* --- cards ------------------------------------------------------------ */

.card {
	background: var(--card);
	color: var(--card-ink);
	border-radius: 6px;
	width: 44px;
	height: 62px;
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 1.1rem;
	line-height: 1;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* Hearts and diamonds are red; the suit is also spelled out by its glyph, so
 * colour alone never carries the meaning. */
.card.red {
	color: var(--red);
}

.card.back {
	background: repeating-linear-gradient(45deg, #1e3a8a, #1e3a8a 4px, #172554 4px, #172554 8px);
	color: transparent;
}

.card.small {
	width: 32px;
	height: 46px;
	font-size: 0.85rem;
}

.hole {
	display: flex;
	gap: 6px;
	margin-top: 6px;
}

/* --- acting ----------------------------------------------------------- */

.actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

.actions input[type="number"] {
	width: 8rem;
	margin: 0;
}

.log {
	max-height: 12rem;
	overflow-y: auto;
	font-size: 0.85rem;
	color: var(--ink-dim);
	display: flex;
	flex-direction: column-reverse;
}

.banner {
	background: var(--surface-raised);
	border: 1px solid var(--line);
	border-left: 3px solid var(--acting);
	border-radius: 6px;
	padding: 8px var(--gap);
}

.status {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: var(--gap);
	color: var(--ink-dim);
	font-size: 0.9rem;
}

/* One column on a phone: the seats grid already wraps, and the felt's rounding
 * looks wrong when it is narrower than it is tall. */
@media (max-width: 480px) {
	.felt {
		border-radius: var(--radius);
		border-width: 6px;
	}

	.card {
		width: 38px;
		height: 54px;
	}
}
