/* Kit visual dos jogos simples do GamesToPlay (/play/kit/kit.css): as cores da marca Pixel G, a barra de opções, os
   botões, a área do jogo e o placar. Cabe no iframe da página do portal (computador, celular em pé e deitado) e em tela
   cheia. Cada jogo só acrescenta o próprio tabuleiro (games/<slug>/game.css). */
:root {
	--bg: #0f0e13;
	--panel: #18171d;
	--line: #2a2931;
	--text: #ecebf1;
	--muted: #9a98a6;
	--red: #ff1e2d;
	--magenta: #ff2e88;
	--play: #ff2662;
	--radius: 10px;
	color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
	background: var(--bg);
	color: var(--text);
	font: 500 15px/1.4 Rubik, system-ui, -apple-system, 'Segoe UI', sans-serif;
	-webkit-tap-highlight-color: transparent;
	overflow: hidden;
}
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--magenta); outline-offset: 2px; }
[hidden] { display: none !important; }

/* os filhos da grade com min-width 0: sem isso um tabuleiro largo (de antes de girar a tela) segura o palco largo e o
   jogo mede o espaço errado */
.gk-app { display: grid; grid-template-rows: auto 1fr; grid-template-columns: minmax(0, 1fr); height: 100%; min-height: 0; }
.gk-app > * { min-width: 0; }

/* barra de opções */
.gk-bar {
	display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
	padding: 10px 12px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.gk-group { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.gk-group button {
	border: 0; background: transparent; padding: 7px 12px; cursor: pointer; color: var(--muted);
	font-size: 13px; font-weight: 700; letter-spacing: .02em; white-space: nowrap;
}
.gk-group button + button { border-left: 1px solid var(--line); }
.gk-group button[aria-pressed='true'] { background: var(--red); color: #fff; }
.gk-group button:not([aria-pressed='true']):hover { color: var(--text); background: #222129; }
.gk-tools { margin-left: auto; display: inline-flex; gap: 6px; }
.gk-icon {
	width: 36px; height: 36px; display: grid; place-items: center; cursor: pointer;
	border: 1px solid var(--line); border-radius: var(--radius); background: transparent; color: var(--muted);
}
.gk-icon:hover { color: var(--text); }
.gk-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.gk-icon[aria-pressed='false'] .gk-on, .gk-icon[aria-pressed='true'] .gk-off { display: none; }

/* área do jogo */
.gk-stage {
	--board: min(calc(100vw - 32px), calc(100svh - var(--chrome, 236px)), 520px);
	min-height: 0; display: grid; align-content: center; justify-items: center; gap: 12px; padding: 12px 16px 16px;
}
.gk-status { margin: 0; min-height: 1.4em; font-weight: 900; font-size: 17px; text-transform: uppercase; letter-spacing: .04em; text-align: center; }
.gk-status.gk-good { color: #4ade80; }
.gk-status.gk-bad { color: var(--red); }
.gk-side { display: grid; justify-items: center; gap: 12px; }
.gk-score { display: flex; gap: 8px; margin: 0; padding: 0; list-style: none; }
.gk-score li {
	min-width: 84px; padding: 6px 10px; text-align: center; background: var(--panel);
	border: 1px solid var(--line); border-radius: var(--radius);
}
.gk-score b { display: block; font-size: 20px; font-weight: 900; }
.gk-score span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.gk-actions { display: flex; gap: 8px; align-items: center; }
.gk-btn {
	border: 0; cursor: pointer; background: var(--red); color: #fff; font-weight: 900; text-transform: uppercase;
	letter-spacing: .06em; font-size: 13px; padding: 11px 22px;
	clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}
.gk-btn:hover { background: var(--play); }
.gk-link { border: 0; background: none; color: var(--muted); font-size: 12px; text-decoration: underline; cursor: pointer; padding: 4px; }
.gk-hint { margin: 0; color: var(--muted); font-size: 12px; text-align: center; max-width: 36em; }

/* celular deitado (ou janela baixa): o tabuleiro à esquerda e o resto à direita */
@media (orientation: landscape) and (max-height: 540px) {
	.gk-bar { padding: 6px 10px; gap: 6px 8px; }
	.gk-group button { padding: 6px 9px; }
	.gk-icon { width: 32px; height: 32px; }
	.gk-stage {
		--board: min(calc(100svh - var(--chrome, 72px)), calc(60vw - 32px));
		grid-template-columns: auto auto; justify-content: center; align-items: center; column-gap: 28px;
	}
	.gk-stage > .gk-status { grid-column: 2; grid-row: 1; align-self: end; }
	.gk-stage > .gk-board-wrap { grid-column: 1; grid-row: 1 / span 2; }
	.gk-stage > .gk-side { grid-column: 2; grid-row: 2; align-self: start; }
	.gk-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
