* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    background: #f7efb3;
    font-family: "Trebuchet MS", Arial, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    color: white;
}

a {
    text-decoration: none;
}

.site-shell {
    width: min(1200px, 100%);
    background: #f59dc8;
    border: 6px solid #f59dc8;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
}

.top-banner {
    background: #f59dc8;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border-bottom: 4px solid #000;
}

.brand {
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    font-weight: 700;
    letter-spacing: 1px;
    color: #000;
    text-transform: uppercase;
}

.nav-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.nav-link {
    background: #000;
    color: #f59dc8;
    border: 2px solid #000;
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 700;
    transition: 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    background: #fff;
    color: #000;
}

.content-wrap {
    background: #000;
    min-height: 620px;
    padding: 32px;
}

.panel {
    min-height: 540px;
    border: 2px solid #f59dc8;
    border-radius: 16px;
    padding: 24px;
    background: rgba(245, 157, 200, 0.06);
}

.hero,
.form-card,
.game-card {
    min-height: 490px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
}

.hero {
    align-items: center;
    text-align: center;
}

.hero h1,
.form-card h1,
.game-card h1,
.split-card h1 {
    font-size: clamp(2rem, 4vw, 3.2rem);
    color: #f59dc8;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.hero p,
.form-card p,
.game-card p {
    max-width: 700px;
    font-size: 1.05rem;
    line-height: 1.6;
    color: #f8f8f8;
}

h2 {
    color: #f59dc8;
}

.button-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.main-button {
    background: #f59dc8;
    color: #000;
    border: none;
    border-radius: 999px;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
    .main-button:hover {
        transform: translateY(-2px);
        opacity: 0.95;
    }
}

button,
.nav-link {
    touch-action: manipulation;
}

.main-button:disabled {
    cursor: wait;
    opacity: 0.65;
}

.main-button:focus-visible,
.nav-link:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

.alt-button {
    background: #fff;
}

.site-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 500px;
}

.site-form label {
    font-weight: 700;
    color: #f59dc8;
}

.site-form input,
.site-form textarea,
.save-box textarea,
.staff-select {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: 2px solid #f59dc8;
    background: #111;
    color: white;
    font-size: 1rem;
    outline: none;
}

.site-form input:focus,
.site-form textarea:focus,
.save-box textarea:focus,
.staff-select:focus {
    border-color: #fff;
}

.flash-box {
    background: rgba(245, 157, 200, 0.15);
    border: 1px solid #f59dc8;
    padding: 14px;
    border-radius: 12px;
    color: #fff;
    max-width: 700px;
}

.small-text {
    font-size: 0.95rem;
    color: #ddd;
}

.small-text a {
    color: #f59dc8;
    font-weight: 700;
}

.save-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 800px;
}

.save-box label {
    font-weight: 700;
    color: #f59dc8;
}

.status-message {
    min-height: 24px;
    font-weight: 700;
    color: #f59dc8;
}

.password-wrap {
    position: relative;
    width: 100%;
}

.password-wrap input {
    width: 100%;
    padding-right: 52px;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #f59dc8;
    font-size: 1.1rem;
    cursor: pointer;
}

/* Feedback layout */

.feedback-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    align-items: start;
}

.split-card {
    background: rgba(245, 157, 200, 0.06);
    border: 2px solid #f59dc8;
    border-radius: 16px;
    padding: 20px;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.panel-subtext {
    color: #f8f8f8;
    line-height: 1.5;
}

.chat-messages {
    min-height: 320px;
    max-height: 320px;
    overflow-y: auto;
    padding: 14px;
    border: 2px solid #f59dc8;
    border-radius: 14px;
    background: #111;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-line {
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(245, 157, 200, 0.12);
    line-height: 1.4;
    word-break: break-word;
}

.chat-line strong {
    color: #f59dc8;
}

.chat-line-top,
.history-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.own-chat {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(245, 157, 200, 0.45);
}

.chat-form {
    max-width: 100%;
}

.past-feedback-panel {
    grid-column: 1 / -1;
}

.past-feedback-list {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 16px;
}

.feedback-card {
    width: calc(50% - 8px);
    min-width: 260px;
    background: rgba(245, 157, 200, 0.12);
    border: 1px solid #f59dc8;
    border-radius: 14px;
    padding: 14px;
    line-height: 1.5;
    animation: feedbackCardEnter 0.45s ease;
    transform-origin: top left;
}

.feedback-card p,
.history-card p,
.report-card p {
    margin-top: 10px;
    color: #f8f8f8;
    white-space: pre-wrap;
    word-break: break-word;
}

.feedback-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.mini-button-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.delete-feedback-button,
.mini-pink-button {
    background: #f59dc8;
    color: #000;
    border: 1px solid #f59dc8;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s ease;
}

.delete-feedback-button:hover,
.mini-pink-button:hover {
    background: #fff;
    color: #000;
}

.feedback-new {
    animation: feedbackSlideLeftDown 0.5s ease;
}

.feedback-removing {
    animation: feedbackRemove 0.3s ease forwards;
}

/* Staff/Admin */

.staff-grid,
.admin-sections {
    margin-top: 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.staff-list,
.staff-history {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.staff-card,
.history-card,
.report-card,
.info-card {
    background: rgba(245, 157, 200, 0.12);
    border: 1px solid #f59dc8;
    border-radius: 14px;
    padding: 16px;
}

.staff-card h3,
.history-card h3,
.report-card h3,
.info-card h3 {
    color: #f59dc8;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.staff-card p,
.info-card p,
.report-card p,
.history-card p,
.history-card li,
.staff-card li {
    color: #f8f8f8;
    line-height: 1.5;
}

.staff-card ul,
.history-card ul {
    margin-top: 10px;
    padding-left: 18px;
}

.staff-actions,
.admin-actions,
.inline-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.staff-pill,
.role-pill,
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #111;
    color: #f59dc8;
    border: 1px solid #f59dc8;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.82rem;
    font-weight: 700;
}

.role-pill.admin {
    background: #fff2a6;
    color: #000;
    border-color: #fff2a6;
}

.role-pill.mod {
    background: #f59dc8;
    color: #000;
    border-color: #f59dc8;
}

.status-pill.banned {
    background: #7a1414;
    color: #fff;
    border-color: #ff9898;
}

.status-pill.muted {
    background: #6c5a00;
    color: #fff;
    border-color: #ffe98a;
}

.status-pill.active {
    background: #1d612c;
    color: #fff;
    border-color: #91f2a7;
}

.user-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.user-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(245, 157, 200, 0.45);
    background: rgba(245, 157, 200, 0.08);
}

.user-row-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-row-name {
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
}

.user-row-meta {
    color: #ddd;
    font-size: 0.92rem;
}

.user-detail-layout {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 22px;
    margin-top: 20px;
}

.user-history-column,
.user-control-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 520px;
    overflow-y: auto;
    padding-right: 4px;
}

.history-card small,
.report-card small,
.info-card small {
    display: block;
    color: #ddd;
    margin-top: 8px;
}

.admin-toolbar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.toolbar-card {
    flex: 1 1 220px;
    background: rgba(245, 157, 200, 0.1);
    border: 1px solid #f59dc8;
    border-radius: 14px;
    padding: 16px;
}

.toolbar-card h3 {
    color: #f59dc8;
    margin-bottom: 8px;
}

.toolbar-card p {
    color: #f8f8f8;
    line-height: 1.5;
}

.admin-table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
}

.admin-table th,
.admin-table td {
    border-bottom: 1px solid rgba(245, 157, 200, 0.3);
    padding: 12px 10px;
    text-align: left;
    vertical-align: top;
    color: #f8f8f8;
}

.admin-table th {
    color: #f59dc8;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.admin-table tr:hover td {
    background: rgba(245, 157, 200, 0.06);
}

.warning-card {
    background: #000;
    border: 2px solid #ffe46a;
    border-radius: 16px;
    padding: 24px;
    text-align: center;
}

.warning-card h1,
.warning-card h2 {
    color: #ffe46a;
}

.warning-card p {
    color: #ffe46a;
    line-height: 1.6;
}

.ban-screen {
    min-height: 100vh;
    width: 100%;
    background: #000;
    color: #ffe46a;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.ban-card {
    width: min(700px, 100%);
    border: 3px solid #ffe46a;
    border-radius: 20px;
    padding: 30px;
    background: #000;
    display: flex;
    flex-direction: column;
    gap: 18px;
    text-align: center;
}

.ban-card h1 {
    color: #ffe46a;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.ban-card p {
    color: #ffe46a;
    line-height: 1.6;
    font-size: 1.05rem;
}

.ban-card .main-button {
    background: #ffe46a;
    color: #000;
}

.mute-notice {
    border: 1px solid #ffe46a;
    background: rgba(255, 228, 106, 0.12);
    color: #ffe46a;
    padding: 12px 14px;
    border-radius: 12px;
    font-weight: 700;
}

.empty-state {
    border: 1px dashed rgba(245, 157, 200, 0.5);
    border-radius: 14px;
    padding: 18px;
    color: #ddd;
    text-align: center;
}

.section-divider {
    height: 1px;
    background: rgba(245, 157, 200, 0.22);
    margin: 8px 0 2px;
}

.meta-line {
    color: #ddd;
    font-size: 0.92rem;
    line-height: 1.4;
}

.badge-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

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

.search-row .site-form,
.search-row form {
    flex: 1 1 260px;
    max-width: none;
}

.side-note {
    color: #ddd;
    font-size: 0.93rem;
    line-height: 1.5;
}

.scroll-box {
    max-height: 420px;
    overflow-y: auto;
    padding-right: 4px;
}

@keyframes feedbackCardEnter {
    0% {
        opacity: 0;
        transform: translateY(12px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes feedbackSlideLeftDown {
    0% {
        opacity: 0;
        transform: translateX(-40px) translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: translateX(0) translateY(0);
    }
}

@keyframes feedbackRemove {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.9);
    }
}

@media (max-width: 1000px) {
    .user-detail-layout,
    .staff-grid,
    .admin-sections {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .feedback-layout {
        grid-template-columns: 1fr;
    }

    .past-feedback-panel {
        grid-column: auto;
    }

    .feedback-card {
        width: 100%;
    }
}

@media (max-width: 700px) {
    .top-banner {
        flex-direction: column;
        align-items: flex-start;
    }

    .content-wrap {
        padding: 18px;
    }

    .panel {
        padding: 18px;
    }

    .user-row,
    .chat-line-top,
    .history-top,
    .feedback-card-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .main-button,
    .delete-feedback-button,
    .mini-pink-button {
        width: 100%;
        text-align: center;
    }

    .admin-table {
        min-width: 560px;
    }
}

.staff-action-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.staff-button-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    gap: 10px;
    width: 100%;
    max-width: 640px;
}

.staff-inline-form {
    width: 100%;
}

.staff-inline-form button,
.uniform-button {
    width: 100%;
    min-height: 58px;
}

.staff-user-link {
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
    font-weight: 700;
}

.grouped-user-list {
    gap: 20px;
}

.group-heading {
    margin-bottom: 10px;
    font-size: 1.15rem;
}

.admins-heading,
.admin-user-link {
    color: #ffd54a;
}

.mods-heading,
.mod-user-link {
    color: #66a8ff;
}

.users-heading,
.normal-user-link {
    color: #ffffff;
}

.disabled-user-link {
    opacity: 0.75;
    cursor: default;
    pointer-events: none;
}

.handled-report {
    background: rgba(170, 220, 170, 0.18);
    border-color: #a8dba8;
}

.handled-pill {
    display: inline-block;
    margin-top: 10px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #cfeecd;
    color: #184d18;
    font-weight: 700;
}

.banned-body {
    min-height: 100vh;
    width: 100%;
    margin: 0;
    background: #000;
    color: #ffe46a;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.banned-shell {
    width: min(700px, 100%);
    border: 3px solid #ffe46a;
    border-radius: 20px;
    padding: 30px;
    background: #000;
    display: flex;
    flex-direction: column;
    gap: 18px;
    text-align: center;
}

.banned-shell h1 {
    color: #ffe46a;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.banned-shell p {
    color: #ffe46a;
    line-height: 1.6;
    font-size: 1.05rem;
}

.appeal-button {
    background: #ffe46a;
    color: #000;
    border: none;
    border-radius: 999px;
    padding: 12px 22px;
    font-weight: 700;
    cursor: not-allowed;
    opacity: 0.8;
}

.report-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.report-tab-button.active {
    background: #fff;
    color: #000;
}

.report-tab-panel {
    display: none;
}

.report-tab-panel.active {
    display: block;
}

.report-link {
    color: #f59dc8;
    font-weight: 700;
    text-decoration: underline;
    word-break: break-word;
}

.report-link:hover {
    color: #fff;
}

.chat-line:target,
.feedback-card:target {
    outline: 3px solid #fff;
    box-shadow: 0 0 0 4px rgba(245, 157, 200, 0.35);
    scroll-margin-top: 24px;
}

.game-card {
    justify-content: flex-start;
}

.game-card h1 {
    width: 100%;
}

.game-card .save-box {
    width: 100%;
    max-width: none;
    margin: 0;
}

#gameText {
    width: 100%;
    min-height: 460px;
    max-height: 460px;
    overflow-y: auto;
    padding: 14px;
    border-radius: 12px;
    border: 2px solid #f59dc8;
    background: #111;
    color: white;
    font-family: Consolas, Monaco, "Courier New", monospace;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

#gameText:empty::before {
    content: attr(data-placeholder);
    color: #777;
}

.game-input-form {
    width: min(950px, 100%);
    max-width: none;
    margin: 0 auto;
}

.game-card .button-row {
    width: 100%;
    justify-content: center;
}

.game-card .status-message {
    width: 100%;
    text-align: center;
}
.role-name.role-admin,
.staff-user-link.admin-user-link,
.staff-user-link.role-admin {
    color: #fff2a6;
}

.role-name.role-mod,
.staff-user-link.mod-user-link,
.staff-user-link.role-mod {
    color: #7ef0ff;
}

.role-name.role-user,
.staff-user-link.normal-user-link,
.staff-user-link.role-user {
    color: #f59dc8;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #f59dc8;
    font-weight: 700;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    min-width: 18px;
    height: 18px;
}

.settings-toggle-form {
    padding: 14px 0;
    border-top: 1px solid rgba(245, 157, 200, 0.25);
    border-bottom: 1px solid rgba(245, 157, 200, 0.25);
}

.achievement-list {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.achievement-category {
    margin-top: 8px;
}

.achievement-category h2 {
    color: #f59dc8;
    border-bottom: 2px solid #f59dc8;
    padding-bottom: 8px;
}

.achievement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.achievement-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid #aaa;
    border-radius: 16px;
    padding: 16px;
    color: #fff;
}

.achievement-card h3 {
    color: inherit;
    margin-bottom: 8px;
}

.achievement-card p {
    color: inherit;
    word-break: break-word;
}

.achievement-unlocked {
    border-color: #4cff88;
    color: #4cff88;
    box-shadow: 0 0 12px rgba(76, 255, 136, 0.25);
}

.achievement-locked {
    border-color: #aaa;
    color: #fff;
}

.achievement-status {
    margin-top: 10px;
    font-weight: 700;
}


.site-footer {
    background: #f59dc8;
    border-top: 4px solid #000;
    padding: 18px 24px;

    display: flex;
    justify-content: center;
    align-items: center;

    position: relative;

    color: #ffe65c;
    font-size: 1.2rem;
    font-weight: bold;
}

.footer-discord {
    position: absolute;
    right: 24px;

    color: #ffe65c;
    font-weight: bold;
    text-decoration: none;
}

.footer-discord:hover {
    text-decoration: underline;
}

.site-footer a {
    color: #ffe65c;
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}


/* Save selection and deletion controls */
.save-slot-picker { display:flex; align-items:center; flex-wrap:wrap; gap:12px; margin:18px 0 22px; }
.save-slot-picker label { margin:0; font-weight:700; color:#f59dc8; }
.save-slot-picker select { min-width:200px; max-width:100%; padding:9px 12px; font:inherit; background:#151015; color:#fff; border:2px solid #f59dc8; border-radius:9px; }
.save-slot-picker .delete-save-button { background:#b83754; color:#fff; padding:10px 20px; border-radius:9px; }
.save-slot-picker .delete-save-button:disabled { opacity:.55; cursor:not-allowed; }


/* Edge-to-edge layout for phones and small tablets. */
@media (max-width: 900px), (max-height: 600px) and (pointer: coarse) {
    html {
        background: #000;
    }

    body:not(.banned-body) {
        display: block;
        min-height: 100vh;
        min-height: 100svh;
        padding: 0;
        background: #000;
    }

    .site-shell {
        display: flex;
        flex-direction: column;
        width: 100%;
        min-height: 100vh;
        min-height: 100svh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        background: #000;
    }

    .top-banner {
        flex-direction: column;
        align-items: center;
        gap: 12px;
        width: 100%;
        padding: 16px 12px;
        padding-top: max(16px, env(safe-area-inset-top));
        padding-right: max(12px, env(safe-area-inset-right));
        padding-left: max(12px, env(safe-area-inset-left));
        border-bottom-width: 2px;
    }

    .brand {
        width: 100%;
        font-size: clamp(1.1rem, 4.6vw, 1.5rem);
        line-height: 1.25;
        text-align: center;
        overflow-wrap: anywhere;
    }

    .nav-buttons {
        width: 100%;
        justify-content: center;
        gap: 8px;
    }

    .nav-link {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        max-width: 100%;
        padding: 8px 12px;
        font-size: 0.875rem;
        text-align: center;
    }

    .content-wrap {
        flex: 1;
        min-width: 0;
        min-height: 0;
        padding: 16px 12px;
        padding-right: max(12px, env(safe-area-inset-right));
        padding-left: max(12px, env(safe-area-inset-left));
    }

    .panel {
        min-width: 0;
        min-height: 0;
        padding: clamp(14px, 4vw, 22px);
        border-radius: 20px;
    }

    .hero,
    .form-card,
    .game-card {
        min-width: 0;
        min-height: 0;
        gap: 16px;
    }

    .hero h1,
    .form-card h1,
    .game-card h1,
    .split-card h1 {
        font-size: clamp(1.7rem, 6.4vw, 2.4rem);
        line-height: 1.15;
        letter-spacing: 1px;
        overflow-wrap: anywhere;
    }

    .hero p,
    .form-card p,
    .game-card p {
        font-size: 0.95rem;
        line-height: 1.5;
    }

    .save-slot-picker {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
        margin: 4px 0 0;
    }

    .save-slot-picker select {
        width: 100%;
        min-width: 0;
        min-height: 44px;
        font-size: 1rem;
    }

    .save-slot-picker .delete-save-button {
        width: 100%;
        min-height: 44px;
    }

    #gameText {
        min-width: 0;
        min-height: 220px;
        height: clamp(220px, 42vh, 380px);
        height: clamp(220px, 42svh, 380px);
        max-height: 380px;
        padding: 12px;
        font-size: 0.875rem;
        line-height: 1.5;
        overflow: auto;
        overflow-wrap: anywhere;
        -webkit-overflow-scrolling: touch;
    }

    .game-input-form {
        min-width: 0;
        gap: 8px;
        scroll-margin-block: 12px;
    }

    .game-input-form input {
        min-width: 0;
        min-height: 48px;
        padding: 12px;
        font-size: 1rem;
    }

    .game-input-form .main-button {
        width: 100%;
        min-height: 48px;
        padding: 12px 16px;
    }

    .game-card .game-actions {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
    }

    .game-actions .main-button {
        width: 100%;
        min-width: 0;
        min-height: 44px;
        padding: 10px 6px;
        font-size: clamp(0.78rem, 3vw, 0.95rem);
        line-height: 1.25;
    }

    .game-card .status-message {
        min-height: 0;
        font-size: 0.875rem;
        overflow-wrap: anywhere;
    }

    .game-card .status-message:empty {
        display: none;
    }

    .site-footer {
        position: static;
        flex-direction: column;
        gap: 4px;
        padding: 14px 12px;
        padding-right: max(12px, env(safe-area-inset-right));
        padding-bottom: max(14px, env(safe-area-inset-bottom));
        padding-left: max(12px, env(safe-area-inset-left));
        border: 0;
        background: #000;
        font-size: 0.8rem;
        line-height: 1.5;
        text-align: center;
        overflow-wrap: anywhere;
    }

    .footer-discord {
        position: static;
        display: inline-flex;
        justify-content: center;
        align-items: center;
        min-height: 44px;
        max-width: 100%;
        font-size: inherit;
    }

    .split-card,
    .feedback-card {
        min-width: 0;
    }

    .split-card {
        padding: 14px;
    }

    .achievement-grid,
    .staff-button-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Changelog navigation and release notes. */
.top-banner {
    flex-wrap: wrap;
}

.nav-buttons {
    min-width: 0;
}

.changelog-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.changelog-badge {
    padding: 2px 6px;
    border-radius: 999px;
    background: #fff2a6;
    color: #000;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.changelog-badge[hidden],
.changelog-update-notice[hidden] {
    display: none;
}

.nav-link.has-unread {
    border-color: #fff2a6;
    box-shadow: 0 0 0 1px #fff2a6, 0 0 12px rgba(255, 242, 166, 0.7);
    animation: changelog-glow 2.5s ease-in-out infinite;
}

@keyframes changelog-glow {
    0%, 100% { box-shadow: 0 0 0 1px #fff2a6, 0 0 6px rgba(255, 242, 166, 0.45); }
    50% { box-shadow: 0 0 0 1px #fff2a6, 0 0 18px rgba(255, 242, 166, 0.9); }
}

.changelog-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.changelog-page h1 {
    color: #f59dc8;
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1.15;
    letter-spacing: 2px;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

.changelog-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.changelog-entry,
.changelog-composer {
    min-width: 0;
    border: 1px solid #f59dc8;
    border-radius: 14px;
    background: #111;
    overflow: hidden;
}

.changelog-entry > summary,
.changelog-composer > summary {
    padding: 18px 20px;
    min-height: 48px;
    cursor: pointer;
    color: #f59dc8;
    font-weight: 700;
    touch-action: manipulation;
    overflow-wrap: anywhere;
}

.changelog-entry > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    list-style: none;
}

.changelog-entry > summary::-webkit-details-marker {
    display: none;
}

.changelog-entry > summary:focus-visible,
.changelog-composer > summary:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -4px;
}

.changelog-entry > summary:hover,
.changelog-composer > summary:hover {
    background: rgba(245, 157, 200, 0.08);
}

.changelog-summary-text {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.changelog-title {
    font-size: 1.2rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.changelog-summary-text time {
    font-size: 0.85rem;
    font-weight: 400;
    line-height: 1.4;
    color: #e0d4dc;
}

.changelog-chevron {
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    margin-right: 3px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
}

.changelog-entry[open] .changelog-chevron {
    transform: rotate(225deg);
}

.changelog-entry[open] > summary {
    border-bottom: 1px solid rgba(245, 157, 200, 0.3);
}

.changelog-body {
    padding: 20px;
    color: #f8f8f8;
    font-size: 1rem;
    line-height: 1.7;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    tab-size: 4;
}

.changelog-form {
    padding: 0 20px 20px;
    max-width: none;
    min-width: 0;
}

.changelog-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 220px);
    gap: 16px;
}

.changelog-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.changelog-form input,
.changelog-form textarea {
    min-width: 0;
    max-width: 100%;
    font-family: inherit;
    color-scheme: dark;
}

.changelog-form textarea {
    min-height: 180px;
    resize: vertical;
}

.changelog-form .main-button {
    align-self: flex-start;
    min-height: 44px;
}

.changelog-help,
.changelog-admin-label {
    color: #e0d4dc;
    font-size: 0.8rem;
    line-height: 1.5;
    font-weight: 400;
}

.changelog-admin-label {
    display: inline-block;
    margin-left: 8px;
}

.changelog-empty {
    padding: 20px;
    border: 1px dashed #f59dc8;
    border-radius: 14px;
    line-height: 1.6;
}

.changelog-update-notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px;
    border: 1px solid #fff2a6;
    border-radius: 12px;
    line-height: 1.5;
}

/* Editing tools appear only inside expanded entries for site administrators. */
.changelog-admin-actions {
    border-top: 1px solid rgba(245, 157, 200, 0.3);
    padding: 16px 20px 20px;
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
}

.changelog-editor {
    flex: 1 1 280px;
    min-width: 0;
    border: 1px solid rgba(245, 157, 200, 0.65);
    border-radius: 12px;
    overflow: hidden;
}

.changelog-editor > summary {
    cursor: pointer;
    padding: 12px 16px;
    color: #f59dc8;
    font-weight: 700;
    touch-action: manipulation;
}

.changelog-editor > summary:focus-visible {
    outline: 2px solid white;
    outline-offset: -3px;
}

.changelog-editor[open] > summary {
    border-bottom: 1px solid rgba(245, 157, 200, 0.3);
}

.changelog-edit-form {
    padding: 16px;
}

.changelog-delete-form {
    margin: 0;
    min-width: 0;
}

.changelog-delete-button {
    min-height: 44px;
    border: 1px solid #d95e73;
    border-radius: 10px;
    background: #9e2f49;
    color: #fff;
    font: inherit;
    font-weight: 700;
    padding: 10px 18px;
    cursor: pointer;
    touch-action: manipulation;
}

.changelog-delete-button:hover,
.changelog-delete-button:focus-visible {
    background: #c24460;
}

@media (max-width: 900px), (max-height: 600px) and (pointer: coarse) {
    .changelog-page {
        gap: 16px;
    }

    .changelog-page h1 {
        font-size: clamp(1.7rem, 6.4vw, 2.4rem);
        letter-spacing: 1px;
    }

    .changelog-entry > summary,
    .changelog-composer > summary {
        padding: 14px;
    }

    .changelog-title {
        font-size: 1.05rem;
    }

    .changelog-body {
        padding: 14px;
        font-size: 0.95rem;
    }

    .changelog-form {
        padding: 0 14px 14px;
    }

    .changelog-fields {
        grid-template-columns: minmax(0, 1fr);
    }

    .changelog-form .main-button {
        width: 100%;
        padding: 12px;
    }

    .changelog-admin-actions {
        padding: 14px;
        flex-direction: column;
        align-items: stretch;
    }

    .changelog-editor {
        flex: 1 1 auto;
        width: 100%;
    }

    .changelog-edit-form {
        padding: 14px;
    }

    .changelog-delete-form,
    .changelog-delete-button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nav-link.has-unread {
        animation: none;
    }
}
