/* ========== ROCK PAPER SCISSORS ========== */

.rps-root {
    display: grid;
    gap: 1rem;
}

.rps-arena {
    padding: 1.1rem;
    border-radius: 1.2rem;
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.97), rgba(249, 239, 230, 0.92));
    border: 1px solid rgba(185, 106, 44, 0.2);
    display: grid;
    gap: 1rem;
}

.rps-scoreboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
}

.rps-player {
    display: grid;
    gap: 0.3rem;
    padding: 0.7rem;
    border-radius: 0.9rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(185, 106, 44, 0.18);
    text-align: center;
}

.rps-name {
    font-size: 0.8rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.rps-score {
    font-size: 1.5rem;
    font-weight: 700;
    color: #7a3d1c;
}

.rps-lock {
    font-size: 0.75rem;
    color: var(--muted);
}

/* Narrow-screen contract: the three moves stay on one row at 320px (3 x 83px + 2 x 0.6rem gap
   = 268px, inside the 288px available) and wrap rather than overflow if the text ever grows.
   This board owns no width of its own and never did -- what broke it on phones was the unscoped
   `.btn { width: 100% }` up at the hero media query, which stacked the three moves into a
   full-width column. That rule is now scoped, so this row is a row again. */
.rps-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: center;
}

.rps-status {
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
}

.rps-round-result {
    padding: 0.6rem 0.9rem;
    border-radius: 0.9rem;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(185, 106, 44, 0.2);
    text-align: center;
}

.chat-panel {
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 1rem;
}

.chat-panel-wrapper {
    display: flex;
    flex-direction: column;
    height: 320px;
}

.chat-panel-header {
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--line);
}

.chat-panel-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--ink);
}

.chat-messages-area {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-right: 0.5rem;
    margin-bottom: 0.75rem;
}

.chat-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 0.85rem;
}

.chat-messages {
    display: grid;
    gap: 0.35rem;
    max-height: 260px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.chat-message {
    display: flex;
    gap: 0.35rem;
    padding: 0.5rem 0.65rem;
    border-radius: 0.6rem;
    background: rgb(from var(--mud-palette-primary) r g b / 0.04);
    font-size: 0.85rem;
    line-height: 1.4;
}

.chat-message-me {
    background: rgb(from var(--mud-palette-primary) r g b / 0.12);
    border-color: rgb(from var(--mud-palette-primary) r g b / 0.22);
}

.chat-name {
    font-weight: 600;
    color: var(--accent-strong);
    white-space: nowrap;
}

/* The colon lives in GetSenderLabel, not here: a ::after is invisible to innerText and to some
   screen readers, and having both append one rendered "You::". */

.chat-body {
    color: var(--ink);
    word-break: break-word;
}

.chat-time {
    font-size: 0.65rem;
    color: var(--muted);
}

.chat-new {
    margin-top: 0.35rem;
    justify-self: start;
    text-transform: none;
}

.chat-input-area {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.chat-input {
    flex: 1;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: 0.5rem;
    font-size: 1rem;
    background: var(--surface);
    color: var(--ink);
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.chat-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgb(from var(--mud-palette-primary) r g b / 0.1);
}

.chat-input::placeholder {
    color: var(--muted);
}

.chat-send-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--accent);
    color: #fff;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 150ms ease, transform 150ms ease;
}

.chat-send-btn:hover:not(:disabled) {
    background: var(--accent-strong);
    transform: scale(1.02);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.lg-settings-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    padding: 0.65rem 0.8rem;
    border-radius: 0.9rem;
    border: 1px dashed var(--mud-palette-lines-default);
    background: var(--mud-palette-surface);
}

.lg-reduce-motion .lg-c4-win,
.lg-reduce-motion .lg-c4-last,
.lg-reduce-motion .lg-typing-text-error,
.lg-reduce-motion .speedmath-task {
    animation: none;
}

.lg-reduce-motion .lg-c4-clickable:hover {
    transform: none;
}
