
* { box-sizing: border-box; }

:root {
    color-scheme: dark;
    --background: #0c101c;
    --panel: #171e30;
    --border: #2b3852;
    --accent: #818cf8;
    --correct: #e54858;
    --present: #eab308;
    --absent: #263c59;
}

body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(
        ellipse at top, #20264a, var(--background) 65%
    );
    color: #f1f5f9;
    font-family: system-ui, sans-serif;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 5%;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 12px;
}

.brand {
    font-size: 21px;
    font-weight: 900;
    letter-spacing: 2px;
}

nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

a { color: #a5b4fc; }

main {
    max-width: 650px;
    margin: 32px auto;
    text-align: center;
    padding: 0 12px;
}

h1 {
    font-size: clamp(24px, 5vw, 36px);
    margin: 8px 0;
}

p, footer { color: #94a3b8; }

.subtitle {
    letter-spacing: 5px;
    color: var(--accent);
    font-size: 11px;
    font-weight: bold;
}

button, input {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    font: inherit;
}

button {
    background: #6366f1;
    color: white;
    font-weight: 700;
    cursor: pointer;
    transition: transform .15s, filter .15s;
}

button:hover { filter: brightness(1.2); }
button:active { transform: scale(.96); }
button:disabled { opacity: .5; cursor: default; }

input {
    background: #101827;
    color: white;
    min-width: 0;
}

.modes {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 24px 0;
}

.modes button { background: var(--panel); }

.modes .active {
    background: #6366f1;
    border-color: #a5b4fc;
}

#board {
    display: grid;
    gap: 5px;
    margin: 20px auto;
    width: min(100%, 430px);
}

.tile {
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    background: var(--panel);
    border: 2px solid var(--border);
    border-radius: 7px;
    font-weight: 900;
    font-size: clamp(15px, 5vw, 28px);
}

.correct { background: var(--correct) !important; }
.present { background: var(--present) !important; color: #111827; }
.absent { background: var(--absent) !important; }

#message {
    min-height: 28px;
    color: #c4b5fd;
    margin: 10px;
    font-weight: bold;
}

#guessForm {
    display: flex;
    max-width: 430px;
    gap: 8px;
    margin: 10px auto;
}

#word {
    flex: 1;
    text-transform: uppercase;
}

#keyboard {
    margin: 18px auto;
    max-width: 520px;
}

.keyrow {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-bottom: 5px;
}

.keyrow button {
    background: #303b54;
    padding: 0;
    height: 44px;
    flex: 1;
    font-size: 13px;
    min-width: 0;
}

.secondary {
    background: var(--panel);
    margin: 10px 0;
}

.legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    font-size: 12px;
    color: #94a3b8;
}

.legend i {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

dialog {
    background: var(--panel);
    color: white;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 25px;
    width: min(420px, 92vw);
}

dialog::backdrop {
    background: #000a;
    backdrop-filter: blur(5px);
}

.close {
    float: right;
    padding: 5px 10px;
    background: transparent;
}

.auth {
    display: grid;
    gap: 10px;
}

hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 24px 0;
}

.statrow {
    display: flex;
    justify-content: space-between;
    margin: 12px 0;
}

.bar {
    background: #6366f1;
    height: 22px;
    border-radius: 5px;
    padding-left: 6px;
    min-width: 24px;
}

footer {
    text-align: center;
    padding: 25px;
    font-size: 12px;
}
