/* Chatroom. Layout is shared; the loud pink / Comic Sans / neon look is the
   retro version (body.retro-mode). Modernized, it uses the site theme from
   styles.css, including dark mode. */

/* ---------- Layout (both looks) ---------- */

/* Disclaimer: a card under the nav bar until accepted */
#chat-rules {
    display: flex;
    justify-content: center;
    padding: 24px 16px;
    box-sizing: border-box;
}
#chat-rules[hidden] { display: none; }

#rules-card {
    padding: 20px;
    width: 100%;
    max-width: 500px;
    box-sizing: border-box;
    text-align: center;
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink);
    border: 1px solid rgba(127, 127, 127, 0.3);
}

#rules-text {
    height: min(320px, 50vh);
    overflow-y: scroll;
    border: 1px solid rgba(127, 127, 127, 0.35);
    padding: 10px;
    text-align: left;
}

#rules-buttons { margin-top: 10px; }

#rules-exit, #rules-agree {
    padding: 10px 15px;
    font: inherit;
    font-size: 16px;
    margin: 5px;
    cursor: pointer;
    border: none;
    border-radius: 5px;
    color: white;
}
#rules-exit { background: #6c7178; }
#rules-agree { background: var(--accent); }
#rules-agree:disabled { background: gray; cursor: not-allowed; }

#chat-container {
    text-align: center;
    padding: 20px;
}
#chat-container[hidden] { display: none; } /* Hidden until disclaimer is accepted */

/* Heading copy differs by look */
body.retro-mode .modern-only,
body:not(.retro-mode) .retro-only { display: none; }

body:not(.retro-mode) #chatroom-title {
    margin: 8px 0 4px;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
#chat-intro {
    margin: 0 auto 20px;
    max-width: 36em;
    color: var(--muted);
}

#chatroom {
    width: 80%;
    height: 500px;
    max-width: 100%;
    box-sizing: border-box;
    border: 1px solid rgba(127, 127, 127, 0.4);
    border-radius: 8px;
}

/* Small screens: let the chat fill the width */
@media screen and (max-width: 700px) {
    #chat-container { padding: 12px; }
    #chatroom { width: 100%; height: 70vh; }
}

/* ---------- Retro look ---------- */

body.retro-mode {
    background-color: #f1a7b9;
    color: #000;
    font-family: 'Comic Sans MS', cursive, sans-serif;
}

body.retro-mode #rules-card {
    background: white;
    color: #000;
    border: 0;
    box-shadow: 0 0 10px #000;
}
body.retro-mode #rules-text { background: #f9f9f9; border-color: #ccc; }
body.retro-mode #rules-exit { background: red; }
body.retro-mode #rules-agree { background: green; }
body.retro-mode #rules-agree:disabled { background: gray; }

body.retro-mode #chatroom {
    border: 5px solid #00ff00;
    border-radius: 0;
    box-shadow: 0 0 20px #00ff00;
}

@keyframes wiggle {
    0% { transform: rotate(-10deg); }
    25% { transform: rotate(10deg); }
    50% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
    100% { transform: rotate(0deg); }
}

body.retro-mode #wiggle-text {
    font-size: 24px;
    font-weight: bold;
    color: #0325cb;
    animation: wiggle 1s ease-in-out 10; /* 10 iterations of the wiggle animation */
}
