:root {
    --paper: #efe5d3;
    --petrol: #0d7275;
    --orange: #ef4b28;
    --gold: #d19a36;
    --ink: #11100f;
    --white: #fffdf7;
    --shadow: 6px 6px 0 var(--ink);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-synthesis: none;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    background: var(--paper);
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-width: 320px;
    background:
        linear-gradient(90deg, rgb(17 16 15 / 4%) 1px, transparent 1px),
        linear-gradient(rgb(17 16 15 / 4%) 1px, transparent 1px),
        var(--paper);
    background-size: 28px 28px;
}

a {
    color: inherit;
}

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

button,
a,
select,
input {
    accent-color: var(--orange);
}

:focus-visible {
    outline: 4px solid var(--gold);
    outline-offset: 4px;
}

.skip-link {
    position: fixed;
    z-index: 100;
    top: 1rem;
    left: 1rem;
    padding: 0.8rem 1rem;
    background: var(--white);
    border: 3px solid var(--ink);
    transform: translateY(-200%);
}

.skip-link:focus {
    transform: none;
}

.site-header,
.app-header,
.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    width: min(100% - 2rem, 1180px);
    margin-inline: auto;
}

.site-header,
.app-header {
    padding-block: 1.4rem;
    border-bottom: 3px solid var(--ink);
}

.brand {
    display: inline-flex;
    align-items: baseline;
    gap: 0.7rem;
    text-decoration: none;
    text-transform: uppercase;
    font-weight: 950;
    letter-spacing: -0.04em;
}

.brand > span {
    font-size: clamp(1.15rem, 3vw, 1.8rem);
}

.brand small {
    font-size: 0.68rem;
    letter-spacing: 0.04em;
}

.brand b {
    color: var(--petrol);
    font-size: 1.25em;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    min-height: 3.25rem;
    padding: 0.8rem 1.2rem;
    color: var(--white);
    background: var(--orange);
    border: 3px solid var(--ink);
    border-radius: 0;
    box-shadow: var(--shadow);
    cursor: pointer;
    font-weight: 900;
    text-decoration: none;
    text-transform: uppercase;
    transition: translate 120ms ease, box-shadow 120ms ease;
}

.button:hover {
    translate: 2px 2px;
    box-shadow: 4px 4px 0 var(--ink);
}

.button:active {
    translate: 6px 6px;
    box-shadow: none;
}

.button--small {
    min-height: 2.75rem;
    padding: 0.55rem 0.9rem;
    font-size: 0.82rem;
}

.button--quiet {
    color: var(--ink);
    background: var(--paper);
}

.button--danger {
    color: var(--white);
    background: #9f2d20;
}

.eyebrow {
    margin: 0 0 0.6rem;
    color: var(--petrol);
    font-size: 0.78rem;
    font-weight: 950;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.hero {
    display: grid;
    align-content: center;
    min-height: min(760px, calc(100svh - 90px));
    width: min(100% - 2rem, 1180px);
    margin-inline: auto;
    padding-block: clamp(4rem, 10vw, 8rem);
}

.hero h1,
.app-toolbar h1,
.category-preview h2 {
    margin: 0;
    max-width: 12ch;
    font-size: clamp(3.1rem, 10vw, 8.6rem);
    line-height: 0.87;
    letter-spacing: -0.075em;
    text-transform: uppercase;
}

.hero h1 em {
    color: var(--orange);
    font-style: normal;
}

.hero__copy {
    max-width: 620px;
    margin: 2.2rem 0 0;
    font-size: clamp(1.1rem, 2.4vw, 1.5rem);
    line-height: 1.45;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem;
    margin-top: 2.2rem;
}

.offline-note {
    font-weight: 800;
}

.category-preview {
    padding: clamp(3rem, 7vw, 6rem) max(1rem, calc((100% - 1180px) / 2));
    color: var(--white);
    background: var(--petrol);
    border-block: 3px solid var(--ink);
}

.category-preview h2 {
    max-width: 15ch;
    font-size: clamp(2.2rem, 6vw, 5rem);
}

.category-preview .eyebrow {
    color: var(--gold);
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin: 3rem 0 0;
    padding: 0;
    list-style: none;
}

.preview-grid li {
    min-height: 180px;
    padding: 1rem;
    color: var(--ink);
    background: var(--paper);
    border: 3px solid var(--ink);
    box-shadow: 5px 5px 0 var(--gold);
}

.preview-grid span {
    display: block;
    color: var(--orange);
    font-weight: 950;
}

.preview-grid strong {
    display: block;
    margin-top: 1.8rem;
    font-size: 1.4rem;
    text-transform: uppercase;
}

.preview-grid p {
    margin-bottom: 0;
}

.feature-band {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: min(100% - 2rem, 1180px);
    margin-inline: auto;
    padding-block: clamp(4rem, 8vw, 7rem);
}

.feature-band article {
    padding: 1.5rem;
    border-left: 3px solid var(--ink);
}

.feature-band strong {
    font-size: 1.5rem;
    text-transform: uppercase;
}

.feature-band p {
    line-height: 1.55;
}

.site-footer {
    padding-block: 2rem;
    border-top: 3px solid var(--ink);
    font-weight: 750;
}

.site-footer nav {
    display: flex;
    gap: 1.2rem;
}

.site-footer > p {
    margin: 0;
}

.privacy-note {
    max-width: 440px;
    color: var(--petrol);
    font-size: 0.82rem;
    line-height: 1.45;
    text-align: center;
}

.guide-shell {
    width: min(100% - 2rem, 1000px);
    margin-inline: auto;
    padding-block: clamp(2.5rem, 7vw, 6rem);
}

.guide-intro {
    max-width: 760px;
    margin-bottom: 2rem;
}

.guide-intro h1 {
    margin-block: 0.2rem 1rem;
    font-size: clamp(2.6rem, 7vw, 5.6rem);
    line-height: 0.95;
    text-transform: uppercase;
}

.guide-intro > p:last-child {
    font-size: clamp(1.05rem, 2vw, 1.35rem);
    line-height: 1.55;
}

.guide-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: clamp(2.5rem, 6vw, 5rem);
}

.guide-nav a {
    padding: 0.65rem 0.85rem;
    color: var(--ink);
    background: var(--gold);
    border: 2px solid var(--ink);
    font-weight: 900;
    text-decoration: none;
}

.guide-section {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    gap: clamp(1rem, 4vw, 3rem);
    padding-block: clamp(2.2rem, 5vw, 4rem);
    border-top: 3px solid var(--ink);
    scroll-margin-top: 1rem;
}

.guide-section__number {
    margin: 0;
    color: var(--orange);
    font-size: clamp(2.6rem, 6vw, 4.5rem);
    font-weight: 950;
    line-height: 1;
}

.guide-section h2 {
    margin-top: 0;
    font-size: clamp(1.8rem, 4vw, 3rem);
    text-transform: uppercase;
}

.guide-section h3 {
    text-transform: uppercase;
}

.guide-steps,
.guide-list {
    display: grid;
    gap: 0.75rem;
    padding-left: 1.4rem;
    line-height: 1.55;
}

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

.guide-columns article,
.guide-definitions > div,
.guide-tip {
    padding: 1.2rem;
    background: var(--white);
    border: 3px solid var(--ink);
}

.guide-columns h3 {
    margin-top: 0;
}

.guide-definitions {
    margin: 0 0 2rem;
}

.guide-definitions dt {
    color: var(--petrol);
    font-size: 1.35rem;
    font-weight: 950;
    text-transform: uppercase;
}

.guide-definitions dd {
    margin: 0.5rem 0 0;
    line-height: 1.55;
}

.guide-json {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--ink);
    color: var(--paper);
    border: 3px solid var(--ink);
}

.guide-json summary {
    cursor: pointer;
    font-weight: 900;
}

.guide-json pre {
    max-width: 100%;
    overflow-x: auto;
    padding: 1rem;
    background: #151515;
    font-size: 0.82rem;
    line-height: 1.5;
}

.guide-json p {
    margin-bottom: 0;
    line-height: 1.5;
}

.guide-tip {
    border-left: 10px solid var(--gold);
    line-height: 1.55;
}

.guide-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: 1rem;
}

.connection-state {
    display: inline-flex;
    gap: 0.45rem;
    align-items: center;
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.connection-state::before {
    width: 0.75rem;
    height: 0.75rem;
    background: var(--petrol);
    border: 2px solid var(--ink);
    border-radius: 50%;
    content: "";
}

.connection-state[data-offline="true"]::before {
    background: var(--orange);
}

.connection-state--pending::before {
    background: var(--gold);
}

.connection-state--online::before {
    background: var(--petrol);
}

.connection-state--offline::before {
    background: var(--orange);
}

.app-shell {
    width: min(100% - 2rem, 1380px);
    margin-inline: auto;
    padding-block: 2.5rem 5rem;
}

.app-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 2rem;
}

.app-toolbar h1 {
    font-size: clamp(2.4rem, 6vw, 5rem);
}

.group-panel,
.room-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1.25rem;
    background: #c9dfd8;
    border: 3px solid var(--ink);
    box-shadow: var(--shadow);
}

.group-panel > div:first-child {
    flex: 1;
}

.group-panel__actions {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.group-panel p,
.room-heading p {
    margin-bottom: 0;
}

.group-panel[hidden] {
    display: none;
}

.room-share {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.room-qr {
    display: grid;
    gap: 0.35rem;
    justify-items: center;
    margin: 0;
    padding: 0.55rem;
    background: var(--white);
    border: 3px solid var(--ink);
}

.room-qr img {
    display: block;
    width: 180px;
    height: 180px;
}

.room-qr figcaption {
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.room-share__label {
    display: block;
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.room-code {
    font-size: 1.6rem;
    font-weight: 950;
    letter-spacing: 0.15em;
}

.join-shell {
    display: grid;
    place-items: start center;
    min-height: calc(100svh - 110px);
    width: min(100% - 2rem, 780px);
    margin-inline: auto;
    padding-block: clamp(2.5rem, 8vw, 6rem);
}

.join-card {
    width: 100%;
    padding: clamp(1.2rem, 4vw, 2.5rem);
    background: var(--white);
    border: 3px solid var(--ink);
    box-shadow: var(--shadow);
}

.join-card h1 {
    margin: 0;
    font-size: clamp(2.7rem, 9vw, 6rem);
    line-height: 0.9;
    letter-spacing: -0.06em;
    text-transform: uppercase;
}

.join-card h2 {
    margin-bottom: 0;
    text-transform: uppercase;
}

.join-card > p,
.scanner p {
    line-height: 1.5;
}

.join-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.55rem 1rem;
    align-items: end;
    margin-top: 2rem;
}

.join-form label,
.join-form small {
    grid-column: 1;
    font-weight: 900;
}

.join-form input {
    grid-column: 1;
    min-height: 4.2rem;
    padding: 0.65rem 0.85rem;
    color: var(--ink);
    background: var(--paper);
    border: 3px solid var(--ink);
    border-radius: 0;
    font-size: 2rem;
    font-weight: 950;
    letter-spacing: 0.25em;
    text-transform: uppercase;
}

.join-form .button {
    grid-column: 2;
    grid-row: 2;
}

.join-divider {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0.8rem;
    align-items: center;
    margin-block: 2rem;
    font-size: 0.75rem;
    font-weight: 950;
    text-transform: uppercase;
}

.join-divider::before,
.join-divider::after {
    height: 3px;
    background: var(--ink);
    content: "";
}

.scanner__actions {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.scanner video {
    display: block;
    width: 100%;
    max-height: 55svh;
    margin-top: 1rem;
    background: var(--ink);
    border: 3px solid var(--ink);
    object-fit: cover;
}

.join-status {
    min-height: 1.5em;
    margin: 1.5rem 0 0;
    color: var(--petrol);
    font-weight: 900;
}

.deck-picker,
.timer-controls label,
.deck-editor label,
.deck-import label,
.deck-filters label {
    display: grid;
    gap: 0.4rem;
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.deck-actions {
    display: flex;
    align-items: end;
    gap: 0.8rem;
}

.deck-editor {
    width: min(calc(100% - 2rem), 1180px);
    max-height: calc(100dvh - 2rem);
    padding: 1.5rem;
    color: var(--ink);
    background: var(--paper);
    border: 3px solid var(--ink);
    box-shadow: 10px 10px 0 var(--ink);
}

.deck-editor::backdrop {
    background: rgb(17 16 15 / 72%);
}

.deck-editor__heading,
.deck-editor__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.deck-editor__heading h2 {
    margin: 0;
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 0.9;
    text-transform: uppercase;
}

.deck-editor__meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-block: 1.5rem;
}

.deck-editor label {
    align-content: start;
}

.deck-editor input,
.deck-editor textarea,
.deck-import input,
.deck-filters input {
    width: 100%;
    padding: 0.7rem;
    color: var(--ink);
    background: var(--white);
    border: 3px solid var(--ink);
    border-radius: 0;
    font-weight: 650;
    letter-spacing: normal;
    line-height: 1.35;
    resize: vertical;
    text-transform: none;
}

.deck-editor__categories {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
}

.deck-editor__categories label > span {
    color: var(--orange);
}

.deck-editor__categories label > span[data-complete="true"] {
    color: var(--petrol);
}

.deck-editor small {
    letter-spacing: normal;
    text-transform: none;
}

.deck-editor__footer {
    margin-top: 1.5rem;
}

#custom-deck-status {
    margin: 0;
    font-weight: 850;
}

.publication-notice {
    padding: 1rem;
    background: #f4d9a8;
    border: 3px solid var(--ink);
}

.publication-notice strong {
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.publication-notice p {
    margin: 0.35rem 0 0.8rem;
}

.publication-notice .check-control {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    font-size: 0.82rem;
    letter-spacing: normal;
    line-height: 1.35;
    text-transform: none;
}

.publication-notice .check-control input {
    flex: 0 0 auto;
    width: 1.35rem;
    height: 1.35rem;
    margin-top: 0.05rem;
}

.decks-shell {
    width: min(100% - 2rem, 1400px);
    margin-inline: auto;
    padding-block: clamp(2rem, 6vw, 5rem);
}

.decks-shell,
.decks-intro > *,
.deck-import > *,
.deck-browser,
.deck-library,
.deck-library-card,
.deck-library-card__heading > * {
    min-width: 0;
}

.decks-intro p,
.publication-notice p,
.deck-library-card p,
.deck-library-card .button {
    overflow-wrap: anywhere;
}

.decks-intro,
.deck-import,
.deck-browser__heading,
.deck-library-card__heading,
.deck-import__footer {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
}

.decks-intro {
    margin-bottom: 2rem;
}

.decks-intro h1,
.deck-browser h2,
.deck-import h2 {
    margin: 0;
    text-transform: uppercase;
}

.decks-intro .publication-notice {
    max-width: 500px;
}

.deck-import,
.deck-browser {
    margin-bottom: 2rem;
    padding: clamp(1rem, 3vw, 2rem);
    background: var(--white);
    border: 3px solid var(--ink);
    box-shadow: var(--shadow);
}

.deck-import > div,
.deck-import form {
    flex: 1 1 0;
}

.deck-import form {
    display: grid;
    gap: 1rem;
}

.deck-import input,
.deck-filters input {
    width: 100%;
}

.deck-import__footer {
    align-items: center;
}

#deck-import-status,
#deck-filter-status {
    margin: 0;
    font-weight: 850;
}

.deck-filters {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(180px, auto);
    gap: 0.8rem;
}

.deck-library {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.deck-library-card {
    padding: 1.25rem;
    background: var(--paper);
    border: 3px solid var(--ink);
}

.deck-library-card[hidden] {
    display: none;
}

.deck-pagination,
.deck-pagination__pages {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.deck-pagination {
    margin-top: 1.5rem;
}

.deck-pagination[hidden] {
    display: none;
}

.deck-pagination [aria-current="page"] {
    color: var(--white);
    background: var(--petrol);
}

.deck-library-card h3 {
    margin: 0.2rem 0 0;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
}

.deck-source {
    color: var(--petrol);
    font-size: 0.72rem;
    font-weight: 950;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.deck-tags {
    display: flex;
    gap: 0.45rem;
    margin: 1rem 0;
    padding: 0;
    flex-wrap: wrap;
    list-style: none;
}

.deck-tags li {
    padding: 0.3rem 0.55rem;
    background: #c9dfd8;
    border: 2px solid var(--ink);
    font-size: 0.72rem;
    font-weight: 850;
}

.deck-preview summary {
    cursor: pointer;
    font-weight: 900;
}

.deck-preview__categories {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
    margin-top: 1rem;
}

.deck-preview__categories section {
    padding: 0.75rem;
    background: var(--white);
    border: 2px solid var(--ink);
}

.deck-preview__categories h4 {
    margin: 0 0 0.5rem;
}

.deck-preview__categories h4 small {
    display: block;
    color: var(--petrol);
}

.deck-preview__categories ul {
    margin: 0;
    padding-left: 1.2rem;
}

select {
    min-height: 3rem;
    padding: 0.55rem 2.5rem 0.55rem 0.8rem;
    color: var(--ink);
    background: var(--white);
    border: 3px solid var(--ink);
    border-radius: 0;
    font-weight: 800;
}

.scene-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
}

.scene-card {
    display: grid;
    grid-template-rows: auto 1fr;
    min-height: 260px;
    background: var(--white);
    border: 3px solid var(--ink);
    box-shadow: var(--shadow);
    transition: transform 180ms ease;
}

.scene-card:nth-child(2n) {
    background: #f4d9a8;
}

.scene-card:nth-child(3n) {
    background: #c9dfd8;
}

.scene-card.is-rolling {
    transform: translateY(-8px) rotate(-1deg);
}

.scene-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.7rem;
    border-bottom: 3px solid var(--ink);
}

.scene-card__header h2 {
    margin: 0;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.lock-button {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.45rem;
    color: var(--ink);
    background: transparent;
    border: 2px solid transparent;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.lock-button[aria-pressed="true"] {
    color: var(--white);
    background: var(--petrol);
    border-color: var(--ink);
}

.scene-card__value {
    display: grid;
    place-items: center;
    margin: 0;
    padding: 1.2rem;
    overflow-wrap: anywhere;
    font-size: clamp(1.15rem, 2vw, 1.65rem);
    font-weight: 900;
    line-height: 1.15;
    text-align: center;
}

.scene-card--readonly {
    grid-template-rows: auto 1fr;
}

.scene-card--readonly h2 {
    margin: 0;
    padding: 0.7rem;
    border-bottom: 3px solid var(--ink);
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.roll-panel {
    display: grid;
    place-items: center;
    padding-block: 2.3rem;
}

.roll-button {
    min-width: min(100%, 330px);
    min-height: 4rem;
    font-size: 1.15rem;
}

.timer-panel {
    display: grid;
    grid-template-columns: minmax(150px, 0.5fr) auto minmax(320px, 1fr);
    gap: 2rem;
    align-items: center;
    padding: 1.5rem;
    background: var(--gold);
    border: 3px solid var(--ink);
    box-shadow: var(--shadow);
}

.timer-panel h2 {
    margin: 0;
    font-size: 2rem;
    text-transform: uppercase;
}

.timer-display {
    font-variant-numeric: tabular-nums;
    font-size: clamp(3rem, 7vw, 5.5rem);
    font-weight: 950;
    letter-spacing: -0.08em;
}

.timer-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 0.8rem;
}

.check-control {
    display: flex !important;
    grid-column: 1 / -1;
    align-items: center;
    min-height: 2.75rem;
}

.check-control input {
    width: 1.4rem;
    height: 1.4rem;
}

.timer-progress {
    grid-column: 1 / -1;
    height: 0.8rem;
    background: var(--white);
    border: 2px solid var(--ink);
}

.timer-progress span {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--petrol);
    transform-origin: left;
}

#timer-status {
    grid-column: 1 / -1;
    margin: 0;
    font-weight: 900;
}

.timer-panel.is-finished {
    animation: timer-finished 600ms steps(2, end) 4;
}

.timer-finished .timer-panel {
    animation: timer-finished 600ms steps(2, end) 4;
}

.timer-panel--readonly {
    grid-template-columns: 1fr auto;
}

.room-shell .scene-card {
    min-height: clamp(240px, 28vh, 420px);
}

.room-shell {
    width: min(100% - 2rem, 1600px);
}

.room-shell .scene-card__value {
    font-size: clamp(1.35rem, 2vw, 2rem);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@keyframes timer-finished {
    50% {
        color: var(--white);
        background: var(--orange);
    }
}

@media (max-width: 980px) {
    .preview-grid,
    .scene-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .scene-card:last-child {
        grid-column: 1 / -1;
    }

    .timer-panel {
        grid-template-columns: 1fr auto;
    }

    .timer-controls {
        grid-column: 1 / -1;
    }

    .group-panel {
        align-items: flex-start;
        flex-direction: column;
    }

    .room-share {
        align-items: flex-start;
    }

    .deck-editor__categories {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .decks-intro,
    .deck-import,
    .deck-browser__heading {
        flex-direction: column;
    }

    .decks-intro .publication-notice,
    .deck-import > div,
    .deck-import form {
        width: 100%;
        max-width: none;
    }
}

@media (max-width: 640px) {
    .site-header,
    .app-header,
    .site-footer,
    .app-toolbar {
        align-items: flex-start;
    }

    .app-header {
        flex-direction: column;
    }

    .header-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .brand {
        display: grid;
        gap: 0.05rem;
    }

    .hero {
        min-height: auto;
    }

    .preview-grid,
    .scene-grid,
    .feature-band {
        grid-template-columns: 1fr;
    }

    .preview-grid li {
        min-height: 140px;
    }

    .feature-band article {
        border-top: 3px solid var(--ink);
        border-left: 0;
    }

    .site-footer,
    .app-toolbar,
    .room-heading {
        flex-direction: column;
    }

    .privacy-note {
        text-align: left;
    }

    .scene-card,
    .scene-card:last-child {
        grid-column: auto;
        min-height: 190px;
    }

    .room-shell .scene-grid {
        gap: 1.4rem;
    }

    .room-shell .scene-card {
        min-height: 220px;
    }

    .room-shell .scene-card--readonly h2 {
        padding: 1rem 1.2rem;
    }

    .room-shell .scene-card__value {
        padding: 1.5rem 1.2rem;
        line-height: 1.25;
    }

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

    .timer-display,
    .timer-controls {
        grid-column: 1;
    }

    .timer-controls > * {
        width: 100%;
    }

    .group-panel__actions,
    .room-share,
    .scanner__actions,
    .join-form {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .group-panel__actions > *,
    .room-share > *,
    .scanner__actions > *,
    .join-form > * {
        width: 100%;
    }

    .join-form label,
    .join-form input,
    .join-form small,
    .join-form .button {
        grid-column: 1;
        grid-row: auto;
    }

    .room-qr img {
        width: min(100%, 240px);
        height: auto;
        aspect-ratio: 1;
    }

    .deck-actions,
    .deck-editor__heading,
    .deck-editor__footer {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .deck-actions > *,
    .deck-editor__heading .button,
    .deck-editor__footer .button {
        width: 100%;
    }

    .deck-editor {
        max-height: 100dvh;
        margin: 0;
        padding: 1rem;
    }

    .deck-editor__meta,
    .deck-editor__categories,
    .deck-library,
    .deck-preview__categories,
    .deck-filters {
        grid-template-columns: 1fr;
    }

    .deck-library-card__heading,
    .deck-import__footer {
        flex-direction: column;
    }

    .deck-library-card__heading .button,
    .deck-import__footer .button {
        width: 100%;
        max-width: 100%;
        white-space: normal;
    }

    .decks-shell {
        width: calc(100% - 2rem);
    }

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

    .guide-section__number {
        font-size: 2.5rem;
    }

    .guide-columns,
    .guide-definitions {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
