/* Ball Connect Hub */

:root {
    color-scheme: light;

    --background: #d6dfd5;
    --shell: #dce5d8;
    --surface: #e5ebe1;
    --card: #eef2e9;
    --input: #f5f7f0;

    --text: #17251c;
    --muted: #46564b;
    --green: #214d35;
    --green-dark: #163824;
    --hover: #ceddca;

    --border: #71866f;
    --line: #b5c4b0;
    --error: #8b1717;
    --white: #ffffff;

    --radius: 12px;
    --shadow: 0 6px 24px rgb(25 53 35 / 8%);
}

/* Basics */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    overflow-y: scroll;
    scrollbar-gutter: stable;
    scrollbar-color: var(--green) var(--background);
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 10px;
    background: var(--background);
    color: var(--text);
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.5;
}

h1,
h2,
h3,
h4,
p,
a,
span,
label,
button,
summary,
strong,
small {
    overflow-wrap: anywhere;
}

a {
    color: var(--green);
    text-underline-offset: 4px;
}

img {
    display: block;
    max-width: 100%;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    color: inherit;
    cursor: pointer;
}

button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

[hidden] {
    display: none !important;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* Page */

.site-shell {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1480px;
    min-height: calc(100vh - 20px);
    min-height: calc(100dvh - 20px);
    margin: 0 auto;
    background: var(--shell);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

/* Header */

.site-header {
    position: relative;
    z-index: 5;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 8px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    border-radius: 16px 16px 0 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 1 auto;
    min-width: 0;
    color: var(--text);
    font-size: 1.0625rem;
    font-weight: 800;
    line-height: 1.3;
    text-decoration: none;
}

.brand > span {
    flex-shrink: 0;
    font-size: 1.75rem;
}

.header-navigation {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
}

.category-menu,
.language-menu,
.account-menu {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    min-width: 0;
}

.category-menu {
    flex: 1;
    justify-content: center;
}

.language-menu {
    margin-left: auto;
}

.category-link,
.language-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    max-width: 100%;
    padding: 8px;
    border-radius: 7px;
    color: var(--text);
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
}

.category-link:hover,
.language-link:hover {
    background: var(--hover);
}

.category-link[aria-current="true"],
.category-link[aria-current="page"],
.language-link[aria-current="true"],
.language-link[aria-current="page"] {
    color: var(--green);
    font-weight: 800;
}

.category-link[aria-current="true"]::after,
.category-link[aria-current="page"]::after,
.language-link[aria-current="true"]::after,
.language-link[aria-current="page"]::after {
    position: absolute;
    right: 8px;
    bottom: 3px;
    left: 8px;
    height: 3px;
    background: var(--green);
    border-radius: 3px;
    content: "";
}

.menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 44px;
    min-height: 44px;
    margin-left: auto;
    padding: 6px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1.5rem;
}

.menu-toggle:hover {
    background: var(--hover);
}

/* Account */

.account-menu {
    gap: 6px;
}

.account-menu form {
    margin: 0;
}

.account-link,
.account-button,
.back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    max-width: 100%;
    padding: 8px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
}

.account-link:hover,
.account-button:hover,
.back-link:hover {
    background: var(--hover);
}

.account-register {
    background: var(--green);
    border-color: var(--green);
    color: var(--white);
}

.account-register:hover {
    background: var(--green-dark);
    border-color: var(--green-dark);
    color: var(--white);
}

.account-dropdown {
    position: relative;
}

.account-dropdown > summary {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 44px;
    padding: 3px 6px;
    border-radius: 8px;
    list-style: none;
    cursor: pointer;
}

.account-dropdown > summary::-webkit-details-marker {
    display: none;
}

.account-dropdown > summary::after {
    content: "⌄";
}

.account-dropdown > summary:hover {
    background: var(--hover);
}

.account-name {
    max-width: 120px;
    font-size: 0.9375rem;
    font-weight: 700;
}

.account-dropdown-content {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 10;
    min-width: 170px;
    max-width: min(280px, 85vw);
    padding: 10px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.account-dropdown-content > .account-link,
.account-dropdown-content .account-button {
    width: 100%;
}

.account-dropdown-content > .account-link {
    margin-bottom: 8px;
}

.account-notice {
    margin: 0 0 14px;
    padding: 12px 14px;
    background: var(--card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--green);
    border-radius: 10px;
}

/* Main content */

.debate-main {
    flex: 1;
    min-width: 0;
    padding: 12px 14px 18px;
}

/* Topic buttons */

.debate-topic-menu {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 14px;
}

.debate-topic-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    max-width: 100%;
    padding: 8px 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 24px;
    color: var(--text);
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
}

.debate-topic-link:hover {
    background: var(--hover);
}

.debate-topic-link[aria-current="page"] {
    background: var(--green);
    border-color: var(--green);
    color: var(--white);
}

/* Topic heading */

.topic-heading {
    min-width: 0;
    max-width: 1000px;
    margin: 0 auto 16px;
    text-align: center;
}

.topic-heading h1 {
    margin: 0 0 6px;
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.topic-heading > p {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1rem;
    line-height: 1.5;
}

.back-link {
    margin-bottom: 6px;
}

/* Online fans */

.topic-heading > .online-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 7px;
    margin: 8px auto 0;
    color: var(--green);
    font-size: 0.875rem;
    font-weight: 700;
}

.online-dot {
    display: inline-block;
    flex: 0 0 8px;
    width: 8px;
    height: 8px;
    background: #28753d;
    border-radius: 50%;
}

/* Topic and image banners */

.debate-top {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        minmax(0, 2fr)
        minmax(0, 1fr);
    grid-template-areas: "left topic right";
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.debate-top > .topic-heading {
    grid-area: topic;
    margin: 0;
}

.topic-banner {
    min-width: 0;
    overflow: hidden;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.topic-banner-left {
    grid-area: left;
}

.topic-banner-right {
    grid-area: right;
}

.banner-viewport {
    position: relative;
    height: 120px;
    overflow: hidden;
}

.banner-slide {
    position: absolute;
    inset: 0;
    margin: 0;
}

.banner-slide > a {
    display: block;
    width: 100%;
    height: 100%;
}

.banner-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.banner-label {
    position: absolute;
    bottom: 6px;
    left: 6px;
    max-width: calc(100% - 12px);
    padding: 3px 7px;
    background: var(--text);
    border-radius: 5px;
    color: var(--white);
    font-size: 0.75rem;
    pointer-events: none;
}

.banner-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 3px;
    padding: 3px;
}

.banner-controls button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 5px 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--text);
    font-size: 0.875rem;
}

.banner-controls button:hover {
    background: var(--hover);
}

.banner-position {
    padding: 0 4px;
    color: var(--text);
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
}

/* Left side | Center | Right side */

.debate-columns {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        minmax(0, 0.9fr)
        minmax(0, 1fr);
    grid-template-areas: "left center right";
    align-items: start;
    gap: 14px;
}

.debate-side-left {
    grid-area: left;
}

.debate-side-right {
    grid-area: right;
}

.debate-side {
    min-width: 0;
    padding: 10px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    scroll-margin-top: 16px;
}

.side-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 2px 4px 10px;
}

.side-heading > div {
    min-width: 0;
}

.side-heading h2 {
    margin: 0;
    color: var(--text);
    font-size: clamp(1.125rem, 1.8vw, 1.5rem);
    font-weight: 800;
    line-height: 1.3;
}

.side-heading p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.9375rem;
}

.side-image,
.side-symbol {
    flex: 0 0 84px;
    width: 84px;
    height: 84px;
    border-radius: 10px;
}

.side-image {
    background: var(--surface);
    object-fit: contain;
}

.side-symbol {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--hover);
    font-size: 2rem;
}

.side-heading .side-like-total {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 4px 0 0;
    color: var(--green);
    font-size: 0.9375rem;
    font-weight: 700;
}

.side-like-total > span {
    color: #b52e43;
    font-size: 1.125rem;
}

/* Center story */

.center-panel {
    grid-area: center;
    display: grid;
    gap: 12px;
    min-width: 0;
}

.center-story {
    min-width: 0;
    padding: 14px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.center-story > h2 {
    margin: 0 0 10px;
    color: var(--text);
    font-size: clamp(1.125rem, 1.8vw, 1.5rem);
    font-weight: 800;
    line-height: 1.3;
}

.center-image {
    width: 100%;
    height: auto;
    max-height: 240px;
    background: var(--surface);
    border-radius: 10px;
    object-fit: contain;
}

.center-text {
    margin-top: 4px;
    font-size: 1rem;
    line-height: 1.5;
}

.center-text p {
    margin: 0 0 10px;
}

.center-text p:last-child {
    margin-bottom: 0;
}

.story-details > summary {
    min-height: 44px;
    padding: 10px 2px;
    color: var(--green);
    font-size: 0.9375rem;
    font-weight: 700;
    cursor: pointer;
}

.center-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    max-width: 100%;
    margin-top: 8px;
    padding: 8px 14px;
    background: var(--green);
    border-radius: 8px;
    color: var(--white);
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
}

.center-link:hover {
    background: var(--green-dark);
    color: var(--white);
    text-decoration: underline;
}

.advertisement-label {
    display: inline-block;
    margin: 0 0 8px;
    padding: 3px 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--text);
    font-size: 0.8125rem;
    font-weight: 700;
}

.center-placeholder {
    padding: 24px 14px;
    text-align: center;
}

.center-placeholder > p {
    margin-bottom: 0;
}

.center-symbol,
.center-football {
    display: block;
    margin-bottom: 10px;
    font-size: 2.5rem;
}

/* Side buttons on phones */

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

.side-switch button {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px 8px;
    min-width: 0;
    min-height: 48px;
    padding: 8px 10px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 9px;
    color: var(--text);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
}

.side-switch button:hover {
    background: var(--hover);
}

.side-switch button[aria-pressed="true"] {
    background: var(--green);
    border-color: var(--green);
    color: var(--white);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.side-switch-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.875rem;
    font-weight: 700;
}

/* Comments */

.comments {
    display: grid;
    gap: 0;
}

.comment-card,
.reply-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    align-items: start;
    column-gap: 8px;
    min-width: 0;
    scroll-margin-top: 16px;
}

.comment-card {
    margin: 0;
    padding: 12px 6px;
    background: transparent;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
}

.comment-card:target,
.reply-card:target {
    outline: 2px solid var(--green);
    outline-offset: 2px;
    border-radius: 6px;
}

.comment-card > .fan-heading,
.reply-card > .fan-heading {
    grid-column: 1;
    grid-row: 1;
}

.comment-card > .comment-message,
.reply-card > .comment-message {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
}

.fan-heading {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.fan-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    background: #b8cbb3;
    border-radius: 50%;
    color: #193f2a;
    font-size: 0.875rem;
    font-weight: 800;
}

img.fan-avatar {
    display: block;
    object-fit: cover;
}

.account-avatar {
    background: var(--green);
    color: var(--white);
}

.fan-meta {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 1px 6px;
    min-width: 0;
}

.fan-meta h3,
.fan-meta h4 {
    margin: 0;
    color: var(--text);
    font-size: 0.9375rem;
    font-weight: 800;
    line-height: 1.4;
}

.fan-meta time {
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.5;
}

.comment-message {
    margin: 5px 0 0;
    color: var(--text);
    font-size: 1rem;
    line-height: 1.5;
}

.comment-message p {
    margin: 0 0 6px;
}

.comment-message p:last-child {
    margin-bottom: 0;
}

.empty-message {
    margin: 0;
    padding: 16px 6px;
    color: var(--muted);
    font-size: 1rem;
}

/* Action buttons beside comments */

.comment-actions {
    grid-column: 2;
    grid-row: 1 / span 2;
    display: grid;
    grid-template-columns: repeat(2, minmax(44px, auto));
    align-content: start;
    gap: 0 2px;
    min-width: 0;
    max-width: 126px;
    margin: 0;
    padding-left: 6px;
    border-left: 1px solid var(--line);
}

.comment-actions > :first-child {
    grid-column: 1 / -1;
}

.comment-actions > :nth-child(2):last-child {
    grid-column: 1 / -1;
}

.comment-actions form {
    min-width: 0;
    margin: 0;
}

.comment-actions > form,
.comment-actions > a,
.comment-actions button {
    width: 100%;
}

.like-button,
.reply-link,
.edit-link,
.delete-button,
.like-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
    min-height: 44px;
    max-width: 100%;
    padding: 5px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 7px;
    color: var(--text);
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
}

.comment-actions a > span[aria-hidden],
.like-button > span[aria-hidden] {
    font-size: 1.125rem;
    line-height: 1;
}

.like-button {
    font-variant-numeric: tabular-nums;
}

.like-button:hover,
.reply-link:hover,
.edit-link:hover {
    background: var(--hover);
    border-color: var(--line);
}

.like-button[aria-pressed="true"] {
    color: var(--green);
    font-weight: 800;
}

.like-button[aria-pressed="true"] > span[aria-hidden] {
    color: #b52e43;
}

.delete-button {
    color: var(--error);
}

.delete-button:hover {
    background: #f0dfd9;
    border-color: var(--error);
}

/* Replies */

.comment-card > .replies,
.comment-card > .reply-box,
.comment-card > .edit-box,
.reply-card > .edit-box {
    grid-column: 1 / -1;
    min-width: 0;
}

.replies {
    min-width: 0;
    margin-top: 4px;
}

.replies > summary {
    min-height: 44px;
    padding: 10px 2px;
    color: var(--green);
    font-size: 0.9375rem;
    font-weight: 700;
    cursor: pointer;
}

.reply-card {
    margin-top: 8px;
    padding: 8px 0 0 8px;
    border-left: 3px solid var(--line);
}

.reply-avatar {
    flex-basis: 28px;
    width: 28px;
    height: 28px;
    font-size: 0.8125rem;
}

.reply-card .comment-message {
    font-size: 1rem;
}

.reply-card .comment-actions > :first-child,
.reply-card .comment-actions > :nth-child(2):last-child {
    grid-column: auto;
}

/* Reply and edit forms */

.reply-box,
.edit-box {
    margin: 0;
    scroll-margin-top: 16px;
}

.reply-box[open],
.edit-box[open] {
    margin-top: 8px;
}

.reply-box > summary,
.edit-box > summary {
    min-height: 44px;
    padding: 9px 3px;
    color: var(--green);
    font-size: 0.9375rem;
    font-weight: 700;
    cursor: pointer;
}

.reply-box > form,
.edit-box > form {
    margin-top: 6px;
    padding: 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 9px;
}

.reply-box form > p,
.edit-box form > p {
    margin: 0 0 10px;
}

/* Fields */

label {
    display: block;
    margin-bottom: 5px;
    color: var(--text);
    font-size: 0.9375rem;
    font-weight: 700;
}

input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
textarea,
select {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 10px 12px;
    background: var(--input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font: inherit;
    line-height: 1.5;
}

input[type="checkbox"],
input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: var(--green);
}

input[type="file"] {
    max-width: 100%;
    font-size: 1rem;
}

input[type="file"]::file-selector-button {
    margin-right: 8px;
    padding: 8px 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font: inherit;
    cursor: pointer;
}

textarea {
    min-height: 80px;
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: var(--muted);
    opacity: 1;
}

small,
.helptext {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Comment box */

.comment-form {
    margin: 8px 0 0;
    padding: 10px 2px 2px;
    border-top: 1px solid var(--line);
    scroll-margin-top: 16px;
}

.comment-composer {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.composer-fields {
    flex: 1;
    min-width: 0;
}

.form-field {
    margin-bottom: 10px;
}

.comment-composer .form-field:last-child {
    margin-bottom: 0;
}

.comment-composer textarea {
    min-height: 48px;
    height: 48px;
}

.comment-composer > .send-button {
    flex-shrink: 0;
    min-height: 48px;
    padding: 10px 14px;
}

/* Form buttons */

.form-actions,
.participation-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.participation-links {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.send-button,
.cancel-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    max-width: 100%;
    padding: 10px 16px;
    border: 1px solid var(--green);
    border-radius: 8px;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
}

.send-button {
    background: var(--green);
    color: var(--white);
}

.send-button:hover {
    background: var(--green-dark);
    border-color: var(--green-dark);
    color: var(--white);
}

.cancel-button {
    background: var(--input);
    border-color: var(--border);
    color: var(--text);
}

.cancel-button:hover {
    background: var(--hover);
}

/* Form errors */

.form-error,
.errorlist {
    color: var(--error);
    font-size: 0.9375rem;
    font-weight: 700;
}

.form-error {
    margin: 6px 0;
}

.errorlist {
    margin: 6px 0;
    padding-left: 22px;
}

/* Footer */

.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin-top: auto;
    padding: 8px 16px;
    background: var(--surface);
    border-top: 1px solid var(--line);
    border-radius: 0 0 16px 16px;
}

.site-footer p {
    margin: 0;
    font-size: 0.8125rem;
}

.site-footer .footer-brand {
    font-size: 0.875rem;
    font-weight: 800;
}

.site-footer nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 16px;
}

.site-footer a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--text);
    font-size: 0.875rem;
    text-decoration: underline;
}

.site-footer a:hover {
    color: var(--green);
}

/* Keyboard controls */

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
    outline: 3px solid #17251c;
    outline-offset: 3px;
}

/* Scrollbar */

html::-webkit-scrollbar {
    width: 12px;
}

html::-webkit-scrollbar-track {
    background: var(--background);
}

html::-webkit-scrollbar-thumb {
    background: var(--green);
    border: 3px solid var(--background);
    border-radius: 10px;
}

html::-webkit-scrollbar-thumb:hover {
    background: var(--green-dark);
}

/* Desktop header */

@media (min-width: 1101px) {
    .site-header,
    .header-navigation {
        flex-wrap: nowrap;
    }

    .brand {
        flex-shrink: 0;
        font-size: 1rem;
    }

    .header-navigation {
        flex: 1 1 auto;
        gap: 6px;
    }

    .category-menu,
    .language-menu,
    .account-menu {
        flex-wrap: nowrap;
    }

    .category-link,
    .language-link {
        padding: 8px 6px;
        font-size: 0.875rem;
    }

    .account-link,
    .account-button {
        padding: 8px;
        font-size: 0.875rem;
    }

    .account-name {
        max-width: 90px;
        font-size: 0.875rem;
    }
}

/* Menu on smaller screens */

@media (max-width: 1100px) {
    .header-navigation {
        flex-basis: 100%;
        width: 100%;
        padding-top: 10px;
        border-top: 1px solid var(--line);
    }

    .category-menu {
        flex-basis: 100%;
        justify-content: flex-start;
    }

    .language-menu {
        margin-left: 0;
    }

    .account-menu {
        margin-left: auto;
    }
}

/* Tablet */

@media (min-width: 751px) and (max-width: 1000px) {
    .debate-columns {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-areas:
            "center center"
            "left right";
    }

    .center-panel {
        width: 100%;
        max-width: 640px;
        justify-self: center;
    }

    .center-image {
        max-height: 200px;
    }
}

/* Phone */

@media (max-width: 750px) {
    body {
        padding: 0;
    }

    .site-shell {
        min-height: 100vh;
        min-height: 100dvh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .site-header {
        gap: 8px;
        padding: 8px 12px;
        border-radius: 0;
    }

    .brand {
        flex: 1;
        font-size: 1rem;
    }

    .brand > span {
        font-size: 1.5rem;
    }

    .debate-main {
        padding: 10px 10px 16px;
    }

    .debate-topic-menu {
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 6px;
        margin-bottom: 10px;
        padding: 3px 3px 7px;
        scroll-padding-inline: 3px;
    }

    .debate-topic-link {
        flex: 0 0 auto;
        max-width: 85vw;
        padding: 8px 12px;
    }

    .debate-top {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-areas:
            "topic topic"
            "left right";
        gap: 8px;
        margin-bottom: 10px;
    }

    .topic-heading h1 {
        font-size: clamp(1.5rem, 6vw, 2rem);
    }

    .topic-heading > p {
        font-size: 1rem;
    }

    .banner-viewport {
        height: 80px;
    }

    .banner-controls {
        gap: 2px;
        padding: 2px;
    }

    .banner-position {
        flex-basis: 100%;
        text-align: center;
    }

    .debate-columns {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "center"
            "switch"
            "left"
            "right";
        gap: 10px;
    }

    .center-story {
        padding: 10px;
    }

    .center-story > h2 {
        margin-bottom: 8px;
        font-size: 1.125rem;
    }

    .center-image {
        max-height: 160px;
    }

    .center-text {
        font-size: 1rem;
    }

    .center-link {
        margin-top: 6px;
    }

    .debate-side {
        padding: 10px;
    }

    .side-heading {
        gap: 10px;
        padding: 0 2px 8px;
    }

    .side-heading h2 {
        font-size: 1.25rem;
    }

    .side-image,
    .side-symbol {
        flex-basis: 58px;
        width: 58px;
        height: 58px;
    }

    .comment-card {
        padding: 10px 3px;
    }

    .side-switch button {
        padding: 8px;
    }

    .site-footer {
        justify-content: center;
        padding: 8px 12px;
        border-radius: 0;
        text-align: center;
    }

    .site-footer .footer-brand {
        flex-basis: 100%;
    }

    .site-footer nav {
        justify-content: center;
        gap: 4px 16px;
    }
}

/* Narrow phones */

@media (max-width: 400px) {
    .comment-card,
    .reply-card {
        column-gap: 6px;
    }

    .fan-heading {
        gap: 6px;
    }

    .fan-avatar {
        flex-basis: 28px;
        width: 28px;
        height: 28px;
    }

    .reply-avatar {
        flex-basis: 24px;
        width: 24px;
        height: 24px;
    }

    .comment-actions {
        grid-template-columns: repeat(2, minmax(36px, auto));
        gap: 0;
        max-width: 108px;
        padding-left: 3px;
    }

    .like-button,
    .reply-link,
    .edit-link,
    .delete-button,
    .like-count {
        padding: 5px 2px;
    }
}

@media (max-width: 360px) {
    .brand {
        font-size: 0.9375rem;
    }

    .comment-composer {
        flex-wrap: wrap;
    }

    .composer-fields {
        flex-basis: 100%;
    }

    .comment-composer > .send-button {
        width: 100%;
        min-height: 48px;
    }

    .language-menu,
    .account-menu {
        flex-basis: 100%;
        margin-left: 0;
    }

    .account-dropdown-content {
        position: static;
        min-width: 0;
        margin-top: 8px;
    }
}

/* Less movement */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .banner-slide {
        animation: none !important;
        transition: none !important;
    }
}

/* High-contrast screens */

@media (forced-colors: active) {
    .site-shell,
    .center-story,
    .debate-side,
    .comment-card,
    .account-dropdown-content,
    .account-notice,
    .topic-banner,
    .debate-topic-link,
    .center-link,
    input:not([type="hidden"]),
    textarea,
    select,
    button,
    .account-link,
    .back-link,
    .fan-avatar,
    .side-symbol {
        border: 1px solid CanvasText;
    }

    .category-link[aria-current="true"],
    .category-link[aria-current="page"],
    .language-link[aria-current="true"],
    .language-link[aria-current="page"],
    .side-switch button[aria-pressed="true"],
    .like-button[aria-pressed="true"] {
        outline: 2px solid Highlight;
        outline-offset: 2px;
    }

    a:focus-visible,
    button:focus-visible,
    input:focus-visible,
    textarea:focus-visible,
    select:focus-visible,
    summary:focus-visible {
        outline-color: Highlight;
    }

    .online-dot {
        background: CanvasText;
        border: 1px solid CanvasText;
    }
}
/* Side names and center headline: normal size, bold */

.debate-page .debate-side .side-heading h2,
.debate-page .center-panel .center-story > h2 {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.5;
}