:root {
    --bg: #081825;
    --panel: #112a3d;
    --panel-2: #173a52;
    --text: #f2fbff;
    --muted: #a6c4d5;
    --accent: #2ad3b7;
    --danger: #ff6f61;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, sans-serif;
    background: radial-gradient(circle at 20% 0%, #1a4460 0%, var(--bg) 45%, #060f1a 100%);
    color: var(--text);
}

.wrap {
    max-width: 1240px;
    margin: 0 auto;
    padding: 24px;
}

h1 { margin: 0 0 8px; }
h2 { margin-top: 0; }
h3 { margin: 18px 0 8px; color: #d8f5ff; }
.sub { color: var(--muted); margin-top: 0; }

.card {
    background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 14px;
}

.hidden { display: none !important; }

.row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: end;
}

.grid2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.grid3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--muted);
    font-size: 14px;
}

input, select, button {
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: #0c2231;
    color: var(--text);
    padding: 8px 10px;
    min-height: 40px;
}

button {
    background: linear-gradient(90deg, #1db39d, var(--accent));
    color: #03261f;
    font-weight: 700;
    cursor: pointer;
}

button:hover { filter: brightness(1.08); }
button.danger {
    background: linear-gradient(90deg, #cf4a3d, #ff6f61);
    color: #fff;
}

.field { min-width: 170px; }
.spacer { min-height: 40px; }

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    align-items: end;
}

.action-grid button,
.action-grid select,
.action-grid .field input {
    width: 100%;
}

.hint { color: var(--muted); }
code {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 2px 6px;
}

.player {
    padding: 8px 10px;
    margin-bottom: 7px;
    border-left: 4px solid var(--accent);
    background: rgba(255, 255, 255, 0.04);
}

.board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px;
}

.cell {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 122px;
}

.cell span {
    font-size: 12px;
    color: #cde3ef;
}

ul { margin: 0; padding-left: 20px; }
li { margin-bottom: 6px; color: #d7ecf8; }

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: grid;
    place-items: center;
    padding: 16px;
    z-index: 30;
}

.modal-content {
    width: min(480px, 100%);
    background: linear-gradient(180deg, #16344b 0%, #10293d 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 16px;
}

@media (max-width: 640px) {
    .wrap { padding: 14px; }
    .card { padding: 12px; }
}
