﻿@import url('https://fonts.googleapis.com/css2?family=Bree+Serif&family=Nunito:wght@500;700;800&display=swap');

:root {
    --bg: #f5eee4;
    --bg-2: #e7d5bf;
    --panel: #fffdf8;
    --ink: #2f2418;
    --muted: #6e5a47;
    --line: #d8c2a4;
    --brand: #0e6e5d;
    --brand-2: #0a574a;
    --alt: #dc8b27;
    --alt-2: #b46f1c;
    --danger: #b53131;
    --success: #2f8b4b;
    --shadow: 0 10px 26px rgba(59, 35, 10, 0.14);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    font-family: "Nunito", "Segoe UI", sans-serif;
    background:
        radial-gradient(1200px 600px at -10% -15%, #fff8ef 0%, transparent 60%),
        radial-gradient(900px 500px at 120% 0%, #f7e8d5 0%, transparent 50%),
        linear-gradient(165deg, var(--bg) 0%, var(--bg-2) 100%);
    min-height: 100vh;
}

.container {
    max-width: 980px;
    margin: 0 auto;
    padding: 22px;
}

.hero {
    background: linear-gradient(135deg, #1f7f6d 0%, #106556 100%);
    color: #fff;
    border-radius: 18px;
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

h1, h2 {
    font-family: "Bree Serif", Georgia, serif;
    margin: 0 0 8px;
    letter-spacing: 0.2px;
}

h1 {
    font-size: clamp(1.8rem, 2.8vw, 2.4rem);
}

.subtitle {
    margin: 0;
    color: var(--muted);
    font-weight: 700;
}

.hero .subtitle {
    color: rgba(255, 255, 255, 0.9);
}

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px;
    margin: 14px 0;
    box-shadow: 0 6px 16px rgba(64, 43, 18, 0.08);
}

.card-highlight {
    background: linear-gradient(180deg, #fffefb 0%, #fff6ea 100%);
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.player-card {
    position: relative;
    overflow: hidden;
}

.player-card::after {
    content: "";
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    opacity: 0.08;
    right: -40px;
    top: -40px;
}

.player-card.mine::after {
    background: var(--brand);
}

.player-card.rival::after {
    background: var(--alt);
}

.room-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

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

.actions-row button {
    min-width: 140px;
}

label {
    display: block;
    margin-top: 8px;
    margin-bottom: 4px;
    font-weight: 800;
    color: #5b4838;
}

input,
button {
    font: inherit;
    border-radius: 10px;
}

input {
    width: 100%;
    border: 1px solid var(--line);
    background: #fff;
    padding: 11px 12px;
    color: var(--ink);
}

input:focus {
    outline: 2px solid rgba(14, 110, 93, 0.22);
    border-color: var(--brand);
}

button {
    border: none;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
    color: #fff;
    font-weight: 800;
    padding: 10px 14px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(9, 79, 66, 0.26);
    transition: transform 0.15s ease, filter 0.15s ease;
}

button:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.button-alt {
    background: linear-gradient(135deg, var(--alt) 0%, var(--alt-2) 100%);
    box-shadow: 0 4px 10px rgba(98, 62, 13, 0.24);
}

button.danger {
    background: linear-gradient(135deg, #cb4545 0%, #9e2828 100%);
    box-shadow: 0 4px 10px rgba(114, 20, 20, 0.3);
}

.cards,
.log {
    margin: 10px 0 0;
    padding-left: 18px;
}

.cards li,
.log li {
    margin: 5px 0;
}

.cards li {
    background: #fff7ec;
    border: 1px solid #efd7bb;
    border-radius: 8px;
    padding: 7px 9px;
    list-style-position: inside;
}

.log {
    max-height: 240px;
    overflow: auto;
    border: 1px solid #ecd5b8;
    border-radius: 10px;
    padding: 10px 12px;
    background: #fffbf4;
}

.log li {
    list-style: square;
    color: #4f3c2a;
}

.state-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    background: #eee3d4;
    border: 1px solid #d7bea1;
    font-weight: 800;
}

.link {
    color: var(--brand-2);
    text-decoration: none;
    font-weight: 800;
}

.back-link {
    color: #d8fff6;
}

.btn-link {
    display: inline-block;
    background: #25d366;
    color: #fff;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 9px;
    font-weight: 800;
    box-shadow: 0 4px 10px rgba(16, 118, 59, 0.24);
}

.error {
    color: var(--danger);
    font-weight: 800;
    min-height: 20px;
}

.hidden {
    display: none;
}

@media (max-width: 760px) {
    .container {
        padding: 14px;
    }

    .grid {
        grid-template-columns: 1fr;
    }

    .room-header {
        flex-direction: column;
        align-items: stretch;
    }

    .actions-row button {
        min-width: 100%;
    }
}
