/* Botões, campo do nome e chip da conta.
 *
 * É a mesma folha do Maze Run e do Pixel Racing: os jogos partilham a
 * linguagem, não o ficheiro. */

button,
input {
    font-family: inherit;
    color: inherit;
}

button { cursor: pointer; }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* ---------- Botões ---------- */

.btn {
    width: 100%;
    padding: 15px 28px;
    font-family: var(--font-display);
    font-size: clamp(15px, 4vw, 17px);
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--on-accent);
    border: none;
    border-radius: var(--radius-pill);
    background: linear-gradient(100deg, var(--accent), var(--accent-2));
    box-shadow: 0 16px 34px -16px var(--glow), inset 0 1px 0 rgba(255, 255, 255, 0.45);
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn:hover { filter: brightness(1.06); box-shadow: 0 20px 40px -16px var(--glow), inset 0 1px 0 rgba(255, 255, 255, 0.45); }
.btn:active { transform: translateY(1px) scale(0.995); }

.btnOutline {
    width: 100%;
    padding: 13px 24px;
    font-family: var(--font-display);
    font-size: clamp(13px, 3.4vw, 15px);
    font-weight: 600;
    border: 1px solid var(--glass-border-strong);
    border-radius: var(--radius-pill);
    background: var(--glass-bg-soft);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.btnOutline:hover { background: var(--glass-bg-hover); border-color: var(--accent); }

/* O "Como jogar" do menu é um link para o guia (guia.html) com cara de botão. */
a.btnOutline {
    display: block;
    text-align: center;
    text-decoration: none;
    color: var(--text);
}

.iconBtn {
    display: grid;
    place-items: center;
    flex: none;
    width: 40px;
    height: 40px;
    font-size: 18px;
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    background: var(--glass-bg-soft);
    transition: background 0.2s ease, transform 0.15s ease;
}

.iconBtn:hover { background: var(--glass-bg-hover); }
.iconBtn:active { transform: scale(0.94); }

/* ---------- Nome do jogador / conta ---------- */

/*
 * O nome só aparece a quem não tem sessão iniciada, e isso só se sabe depois da
 * resposta de /api/account/me. Até lá o espaço fica reservado e o conteúdo
 * invisível (`is-pending`), para não haver salto de layout nem piscar do campo
 * a quem afinal já está autenticado.
 */
.nameSlot {
    width: 100%;
    min-height: 74px;
    display: grid;
    place-items: center;
}

.nameSlot > * {
    grid-area: 1 / 1;
    width: 100%;
    transition: opacity 0.25s ease;
}

.nameSlot.is-pending > * { opacity: 0; }

.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    width: 100%;
    text-align: left;
}

.fieldLabel {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--faint);
}

.nameInput {
    width: 100%;
    padding: 13px 16px;
    font-size: 15px;
    font-weight: 600;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.07);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.nameInput::placeholder { color: var(--faint); font-weight: 400; }

.nameInput:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--ring);
}

.playerChip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px 9px 9px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-pill);
    background: var(--glass-bg-soft);
    text-align: left;
}

.chipAvatar {
    display: grid;
    place-items: center;
    flex: none;
    width: 30px;
    height: 30px;
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
    color: var(--on-accent);
    border-radius: 50%;
    background: linear-gradient(140deg, var(--accent), var(--accent-2));
}

.chipText { font-size: 13px; color: var(--muted); }
.chipText b { color: var(--text); font-weight: 700; }


/* Um botão que apaga alguma coisa (o reino) não pode ter a cor do "jogar". */
.btn--danger {
    color: #2a0c06;
    background: linear-gradient(100deg, #ff9a7a, var(--accent-3));
    box-shadow: 0 16px 34px -16px rgba(232, 113, 90, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.iconBtn--small { width: 30px; height: 30px; font-size: 13px; border-radius: 50%; }

/* O botão principal é dourado a acabar em âmbar, a cor do castelo ao fim da tarde. */
.btn:not(.btn--danger) {
    background: linear-gradient(100deg, #f7d26a, #e59a3a);
}
