396 lines
6.6 KiB
CSS
396 lines
6.6 KiB
CSS
:root {
|
|
color-scheme: dark;
|
|
--bg: #07090d;
|
|
--panel: #0d121a;
|
|
--panel-2: #111923;
|
|
--cell: #0a0f16;
|
|
--line: #26384b;
|
|
--line-bright: #61d6ff;
|
|
--text: #d9f7ff;
|
|
--muted: #7e9aa8;
|
|
--x: #ff5f8f;
|
|
--o: #47e5bc;
|
|
--warn: #ffd166;
|
|
--ok: #7cff6b;
|
|
--bad: #ff6b6b;
|
|
--focus: #f7f052;
|
|
--shadow: 0 0 0 1px rgba(97, 214, 255, 0.18), 0 18px 48px rgba(0, 0, 0, 0.4);
|
|
}
|
|
|
|
* {
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
body {
|
|
margin: 0;
|
|
min-height: 100vh;
|
|
color: var(--text);
|
|
background:
|
|
linear-gradient(rgba(97, 214, 255, 0.04) 1px, transparent 1px),
|
|
linear-gradient(90deg, rgba(97, 214, 255, 0.035) 1px, transparent 1px),
|
|
radial-gradient(circle at 50% 0%, rgba(71, 229, 188, 0.12), transparent 30rem),
|
|
var(--bg);
|
|
background-size: 24px 24px, 24px 24px, auto, auto;
|
|
font-family: "Cascadia Mono", Consolas, "Courier New", monospace;
|
|
}
|
|
|
|
body::before {
|
|
content: "";
|
|
position: fixed;
|
|
inset: 0;
|
|
pointer-events: none;
|
|
background: repeating-linear-gradient(
|
|
to bottom,
|
|
rgba(255, 255, 255, 0.035),
|
|
rgba(255, 255, 255, 0.035) 1px,
|
|
transparent 1px,
|
|
transparent 4px
|
|
);
|
|
opacity: 0.22;
|
|
mix-blend-mode: screen;
|
|
}
|
|
|
|
button {
|
|
font: inherit;
|
|
}
|
|
|
|
.app {
|
|
width: min(920px, calc(100vw - 28px));
|
|
min-height: 100vh;
|
|
margin: 0 auto;
|
|
display: grid;
|
|
grid-template-columns: minmax(0, 1fr) 260px;
|
|
gap: 14px;
|
|
align-items: center;
|
|
padding: 20px 0;
|
|
}
|
|
|
|
.play-area,
|
|
.side-panel {
|
|
background: linear-gradient(180deg, rgba(17, 25, 35, 0.94), rgba(8, 12, 18, 0.98));
|
|
border: 1px solid var(--line);
|
|
box-shadow: var(--shadow);
|
|
}
|
|
|
|
.play-area {
|
|
padding: 16px;
|
|
}
|
|
|
|
.side-panel {
|
|
padding: 12px;
|
|
}
|
|
|
|
.topbar,
|
|
.status-row,
|
|
.score-row {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
gap: 12px;
|
|
}
|
|
|
|
.eyebrow {
|
|
margin: 0 0 4px;
|
|
color: var(--o);
|
|
font-size: 0.68rem;
|
|
font-weight: 700;
|
|
text-transform: uppercase;
|
|
}
|
|
|
|
h1 {
|
|
margin: 0;
|
|
color: var(--text);
|
|
font-size: clamp(1.9rem, 4vw, 3.2rem);
|
|
line-height: 0.95;
|
|
text-transform: uppercase;
|
|
text-shadow: 0 0 12px rgba(97, 214, 255, 0.55);
|
|
}
|
|
|
|
.icon-button {
|
|
width: 46px;
|
|
height: 32px;
|
|
display: inline-grid;
|
|
place-items: center;
|
|
border: 1px solid var(--line-bright);
|
|
border-radius: 2px;
|
|
color: var(--line-bright);
|
|
background: #05080d;
|
|
cursor: pointer;
|
|
font-size: 0.72rem;
|
|
font-weight: 800;
|
|
transition: background 120ms ease, color 120ms ease, box-shadow 120ms ease;
|
|
}
|
|
|
|
.icon-button:disabled {
|
|
opacity: 0.4;
|
|
cursor: not-allowed;
|
|
}
|
|
|
|
.icon-button:hover:not(:disabled) {
|
|
color: #061016;
|
|
background: var(--line-bright);
|
|
box-shadow: 0 0 18px rgba(97, 214, 255, 0.45);
|
|
}
|
|
|
|
.icon-button:focus-visible,
|
|
.cell:focus-visible {
|
|
outline: 2px solid var(--focus);
|
|
outline-offset: 3px;
|
|
}
|
|
|
|
.status-row {
|
|
margin: 14px 0 10px;
|
|
}
|
|
|
|
.turn-badge {
|
|
min-width: 128px;
|
|
padding: 7px 9px;
|
|
border: 1px solid currentColor;
|
|
border-radius: 2px;
|
|
font-size: 0.78rem;
|
|
font-weight: 800;
|
|
text-align: center;
|
|
text-transform: uppercase;
|
|
}
|
|
|
|
.player-x {
|
|
color: var(--x);
|
|
background: rgba(255, 95, 143, 0.08);
|
|
}
|
|
|
|
.player-o {
|
|
color: var(--o);
|
|
background: rgba(71, 229, 188, 0.08);
|
|
}
|
|
|
|
.message {
|
|
color: var(--muted);
|
|
font-size: 0.78rem;
|
|
text-align: right;
|
|
line-height: 1.35;
|
|
}
|
|
|
|
.network-status {
|
|
margin: 0 0 12px;
|
|
padding: 8px 10px;
|
|
border: 1px solid var(--line);
|
|
border-radius: 2px;
|
|
color: var(--muted);
|
|
background: #070b11;
|
|
font-size: 0.74rem;
|
|
font-weight: 800;
|
|
text-transform: uppercase;
|
|
}
|
|
|
|
.network-status::before {
|
|
content: "> ";
|
|
}
|
|
|
|
.network-status.paired {
|
|
color: var(--ok);
|
|
border-color: rgba(124, 255, 107, 0.5);
|
|
}
|
|
|
|
.network-status.waiting,
|
|
.network-status.connecting {
|
|
color: var(--warn);
|
|
border-color: rgba(255, 209, 102, 0.5);
|
|
}
|
|
|
|
.network-status.error {
|
|
color: var(--bad);
|
|
border-color: rgba(255, 107, 107, 0.55);
|
|
}
|
|
|
|
.board {
|
|
aspect-ratio: 1;
|
|
width: min(100%, 520px);
|
|
margin: 0 auto;
|
|
display: grid;
|
|
grid-template-columns: repeat(5, 1fr);
|
|
grid-template-rows: repeat(5, 1fr);
|
|
border: 2px solid var(--line-bright);
|
|
background: var(--line-bright);
|
|
gap: 2px;
|
|
box-shadow: 0 0 24px rgba(97, 214, 255, 0.22);
|
|
}
|
|
|
|
.cell {
|
|
min-width: 0;
|
|
border: 0;
|
|
display: grid;
|
|
place-items: center;
|
|
background: var(--cell);
|
|
color: var(--text);
|
|
cursor: pointer;
|
|
position: relative;
|
|
isolation: isolate;
|
|
}
|
|
|
|
.cell::before {
|
|
content: "+";
|
|
position: absolute;
|
|
color: rgba(126, 154, 168, 0.25);
|
|
font-size: 0.9rem;
|
|
}
|
|
|
|
.cell:hover:not([disabled]) {
|
|
background: #101926;
|
|
}
|
|
|
|
.cell:hover:not([disabled])::before {
|
|
color: var(--line-bright);
|
|
}
|
|
|
|
.cell[disabled] {
|
|
cursor: default;
|
|
}
|
|
|
|
.mark {
|
|
display: grid;
|
|
place-items: center;
|
|
width: 80%;
|
|
height: 80%;
|
|
font-size: clamp(1.75rem, 6vw, 3.25rem);
|
|
font-weight: 900;
|
|
line-height: 1;
|
|
animation: pop 120ms steps(2, end);
|
|
}
|
|
|
|
.mark-x {
|
|
color: var(--x);
|
|
text-shadow: 0 0 12px rgba(255, 95, 143, 0.65);
|
|
}
|
|
|
|
.mark-o {
|
|
color: var(--o);
|
|
text-shadow: 0 0 12px rgba(71, 229, 188, 0.65);
|
|
}
|
|
|
|
.cell.captured {
|
|
animation: capture 300ms steps(3, end);
|
|
}
|
|
|
|
.cell.winning {
|
|
background: #1b2440;
|
|
box-shadow: inset 0 0 0 3px var(--focus);
|
|
}
|
|
|
|
.score-row {
|
|
margin-bottom: 10px;
|
|
}
|
|
|
|
.score-box {
|
|
flex: 1;
|
|
padding: 9px;
|
|
border: 1px solid var(--line);
|
|
border-radius: 2px;
|
|
background: var(--panel-2);
|
|
}
|
|
|
|
.score-label {
|
|
display: block;
|
|
color: var(--muted);
|
|
font-size: 0.62rem;
|
|
font-weight: 800;
|
|
text-transform: uppercase;
|
|
}
|
|
|
|
.score-box strong {
|
|
display: block;
|
|
margin-top: 2px;
|
|
color: var(--text);
|
|
font-size: 1.45rem;
|
|
line-height: 1;
|
|
}
|
|
|
|
.rule-card {
|
|
padding: 10px;
|
|
border: 1px solid var(--line);
|
|
border-radius: 2px;
|
|
background: #070b11;
|
|
}
|
|
|
|
.rule-card h2 {
|
|
margin: 0 0 7px;
|
|
color: var(--line-bright);
|
|
font-size: 0.76rem;
|
|
}
|
|
|
|
.rule-card p {
|
|
margin: 0;
|
|
color: var(--muted);
|
|
font-size: 0.72rem;
|
|
line-height: 1.45;
|
|
}
|
|
|
|
.move-list {
|
|
max-height: 250px;
|
|
margin: 10px 0 0;
|
|
padding: 0;
|
|
overflow: auto;
|
|
color: var(--muted);
|
|
font-size: 0.72rem;
|
|
list-style: none;
|
|
}
|
|
|
|
.move-list li {
|
|
margin-bottom: 5px;
|
|
padding: 5px 7px;
|
|
border-left: 2px solid var(--line);
|
|
background: rgba(97, 214, 255, 0.04);
|
|
}
|
|
|
|
.move-list li::before {
|
|
content: "$ ";
|
|
color: var(--o);
|
|
}
|
|
|
|
@keyframes pop {
|
|
from {
|
|
opacity: 0;
|
|
transform: scale(0.7);
|
|
}
|
|
}
|
|
|
|
@keyframes capture {
|
|
35% {
|
|
background: var(--bad);
|
|
}
|
|
}
|
|
|
|
@media (max-width: 780px) {
|
|
.app {
|
|
min-height: auto;
|
|
grid-template-columns: 1fr;
|
|
align-items: start;
|
|
padding: 14px 0;
|
|
}
|
|
|
|
.play-area,
|
|
.side-panel {
|
|
padding: 12px;
|
|
}
|
|
|
|
.status-row {
|
|
align-items: flex-start;
|
|
flex-direction: column;
|
|
}
|
|
|
|
.message {
|
|
text-align: left;
|
|
}
|
|
|
|
h1 {
|
|
font-size: 2.2rem;
|
|
}
|
|
|
|
.board {
|
|
width: min(100%, 430px);
|
|
}
|
|
|
|
.move-list {
|
|
max-height: 150px;
|
|
}
|
|
}
|