:root {
    --page-shadow: 0 24px 70px rgba(15, 23, 42, 0.18);
}

* {
    box-sizing: border-box;
}

.site-header-inner,
.site-brand {
    display: flex;
    align-items: center;
}

.site-header-inner {
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem 1.5rem;
}

.site-brand-logo {
    flex-shrink: 0;
}

.site-header-nav {
    justify-content: flex-start;
}

:where(button, a, input, select, textarea, summary, [contenteditable]):focus-visible,
.tool-button:focus-within {
    outline: 2px solid #047857;
    outline-offset: 2px;
}

.nav-link,
.nav-link-active {
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    transition: background-color 160ms ease, color 160ms ease;
}

.nav-link {
    color: #475569;
}

.nav-link:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.nav-link-active {
    background: #0f172a;
    color: #ffffff;
}

.mobile-screen-warning {
    display: none;
}

.creator-shell {
    display: grid;
    gap: 1.25rem;
    width: min(100% - 2rem, 1680px);
    margin: 0 auto;
    padding: 1.5rem 0;
}

.creator-sidebar,
.creator-tools-panel {
    min-width: 0;
}

.creator-sidebar {
    display: grid;
    align-content: start;
    gap: 0.75rem;
}

#stepList {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
    gap: 0.2rem;
}

#stepList button {
    gap: 0.55rem;
    padding: 0.45rem 0.5rem;
}

#stepList button > span:first-child {
    width: 1.7rem;
    height: 1.6rem;
}

.creator-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: 'tools' 'preview';
    gap: 1.25rem;
    min-width: 0;
}

.creator-preview-panel {
    grid-area: preview;
    min-width: 0;
}

.creator-tools-panel {
    grid-area: tools;
}

.creator-step-controls button {
    min-height: 2.5rem;
}

.creator-step-controls button[hidden],
#previewHelperPanel[hidden] {
    display: none;
}

.preview-card,
.creator-tools-panel {
    align-self: start;
}

.preview-scroll {
    display: flex;
    align-items: flex-start;
    min-height: 0;
    max-height: none;
    justify-content: center;
    overflow: visible;
}

#boardPreview {
    display: flex;
    width: 100%;
    justify-content: center;
}

.board-preview-empty {
    display: grid;
    min-height: 640px;
    place-items: center;
    text-align: center;
    color: #64748b;
}

.board-page {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background-color: #ffffff;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: var(--page-shadow);
}

.board-page.portrait {
    aspect-ratio: 210 / 297;
    width: min(100%, 760px);
}

.board-page.pdf-page {
    box-shadow: none;
}

.board-page.pdf-page.portrait {
    width: 1240px;
    height: 1754px;
}

.board-page-layer {
    position: relative;
    z-index: 1;
    display: flex;
    height: 100%;
    flex-direction: column;
    align-items: center;
    padding: 2.4% 2.9% 1.9%;
}

.board-title {
    display: grid;
    flex: 0 0 8.5%;
    min-height: 0;
    height: 8.5%;
    width: 96%;
    place-items: center;
    padding: 0 1rem;
    overflow: hidden;
    text-align: center;
    font-size: 2.65rem;
    font-weight: 800;
    line-height: 1.02;
    letter-spacing: 0;
    color: #0f172a;
    overflow-wrap: normal;
    word-break: normal;
    text-wrap: balance;
}

.board-grid-shell {
    display: grid;
    min-height: 0;
    width: 97%;
    flex: 1;
    place-items: center;
}

.board-grid {
    position: relative;
    display: grid;
    gap: 3px;
    max-width: 100%;
    max-height: 100%;
}

.board-page.portrait .board-grid {
    width: 100%;
    height: auto;
}

.board-footer {
    display: flex;
    min-height: 3.4%;
    width: 100%;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.7rem;
    padding-top: 0.25rem;
}

.board-watermark {
    width: 38%;
}

.board-watermark-image {
    display: block;
    width: 100%;
    height: auto;
}

.board-creator-credit {
    max-width: 36%;
    padding-bottom: 0.04rem;
    text-align: right;
    font-size: 0.76rem;
    font-weight: 800;
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.tile-cell {
    position: relative;
    display: grid;
    min-width: 0;
    min-height: 0;
    overflow: visible;
    border-radius: 7px;
    border: 1.5px solid rgba(15, 23, 42, 0.22);
    background: rgba(255, 255, 255, 0.36);
}

.tile-cell.inactive {
    border-style: dashed;
    border-color: rgba(100, 116, 139, 0.32);
    background: rgba(255, 255, 255, 0.18);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.tile-cell.active {
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.14);
}

.board-page.pdf-page .tile-cell.inactive {
    visibility: hidden;
}

.tile-content {
    position: absolute;
    inset: 5%;
    display: flex;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4%;
    overflow: hidden;
}

.tile-image {
    display: block;
    max-width: 92%;
    min-height: 0;
    object-fit: contain;
    pointer-events: none;
}

.tile-content.has-text.has-image .tile-image {
    flex: 0 1 44%;
    max-height: 44%;
}

.tile-content.has-image:not(.has-text) .tile-image {
    max-height: 88%;
}

.tile-content.has-image:not(.has-text) .tile-text-frame {
    position: absolute;
    inset: 0;
    height: 100%;
    flex: none;
    opacity: 0;
    pointer-events: none;
}

.tile-text-frame {
    display: grid;
    width: 100%;
    min-height: 0;
    flex: 1 1 auto;
    place-items: center;
    overflow: hidden;
}

.tile-content.has-text:not(.has-image) .tile-text-frame {
    height: 100%;
    flex-basis: 100%;
}

.tile-text {
    box-sizing: border-box;
    width: 100%;
    max-height: 100%;
    overflow: hidden;
    border-radius: 4px;
    padding: 1px 2px;
    text-align: center;
    font-weight: 800;
    line-height: 1.08;
    outline: none;
    overflow-wrap: break-word;
    word-break: normal;
    white-space: pre-wrap;
}

.tile-text.is-fixed-label {
    overflow-wrap: normal;
    white-space: nowrap;
    word-break: normal;
}

.tile-text[contenteditable] {
    cursor: text;
}

.tile-text[contenteditable]:focus {
    background: rgba(255, 255, 255, 0.38);
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.2);
}

.tile-image-delete {
    position: absolute;
    right: -7px;
    top: -7px;
    z-index: 4;
    display: grid;
    height: 24px;
    width: 24px;
    place-items: center;
    border-radius: 999px;
    background: #ef4444;
    color: #ffffff;
    font-size: 15px;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.26);
}

.wall-mark,
.wall-handle {
    position: absolute;
    z-index: 6;
    transform: translate(-50%, -50%);
    user-select: none;
}

.wall-mark {
    color: #111827;
    font-weight: 900;
    line-height: 0.9;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
    pointer-events: none;
}

.wall-mark.vertical {
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

.wall-handle {
    display: grid;
    min-height: 22px;
    min-width: 22px;
    place-items: center;
    border: 1px dashed rgba(15, 23, 42, 0.45);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    color: #0f172a;
    font-size: 11px;
    font-weight: 900;
    transition: transform 140ms ease, background-color 140ms ease;
}

.wall-handle:hover {
    background: #ffffff;
    transform: translate(-50%, -50%) scale(1.08);
}

.wall-handle.has-wall {
    border-color: #0f172a;
    background: #fef3c7;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 3.25rem), 1fr));
    gap: 0.5rem;
}

.tool-button {
    display: grid;
    min-height: 42px;
    place-items: center;
    border-radius: 7px;
    border: 2px solid rgba(15, 23, 42, 0.1);
    font-size: 0.78rem;
    font-weight: 800;
    transition: border-color 150ms ease, transform 150ms ease;
}

.tool-button:hover {
    transform: translateY(-1px);
}

.tool-button.is-selected {
    border-color: #0f172a;
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.12);
}

.board-format-options {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.25rem), 1fr));
}

.board-format-guide {
    display: grid;
    gap: 0.55rem;
    border: 1px solid #a7f3d0;
    border-radius: 8px;
    background: #ecfdf5;
    padding: 0.9rem;
    color: #164e3c;
    font-size: 0.875rem;
    line-height: 1.55;
}

.board-format-guide h3 {
    color: #064e3b;
    font-weight: 750;
}

.tool-select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, #475569 50%), linear-gradient(135deg, #475569 50%, transparent 50%);
    background-position: calc(100% - 1.05rem) center, calc(100% - 0.75rem) center;
    background-repeat: no-repeat;
    background-size: 0.3rem 0.3rem;
    padding-right: 2rem;
}

.text-step-actions {
    display: flex;
    justify-content: center;
    margin-bottom: 0.7rem;
}

.tool-action-link {
    border: 1px solid #a7f3d0;
    border-radius: 6px;
    background: #ecfdf5;
    padding: 0.5rem 0.7rem;
    color: #065f46;
    font-size: 0.875rem;
    font-weight: 700;
    text-align: center;
}

.tool-action-link:hover {
    background: #d1fae5;
}

#previewHelperPanel {
    scroll-margin-top: 1rem;
}

.finalize-form,
.finalize-fields,
.finalize-color-settings {
    display: grid;
    gap: 0.9rem;
    min-width: 0;
}

.finalize-colors {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.finalize-colors summary {
    cursor: pointer;
    padding: 0.65rem 0.75rem;
    color: #334155;
    font-size: 0.875rem;
    font-weight: 700;
}

.finalize-color-settings {
    padding: 0.15rem 0.75rem 0.75rem;
}

.finalize-color-settings .tool-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 2rem), 1fr));
    gap: 0.35rem;
}

.finalize-color-settings .tool-button {
    min-height: 2rem;
    border-radius: 5px;
}

.finalize-color-settings label.tool-button {
    grid-column: span 2;
}

.orientation-card,
.background-card {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    padding: 0.85rem;
    text-align: left;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.orientation-card:hover,
.background-card:hover,
.orientation-card.is-selected,
.background-card.is-selected {
    border-color: #0f172a;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
}

.orientation-card.is-locked {
    cursor: not-allowed;
    border-style: dashed;
    background: #f8fafc;
    color: #64748b;
    opacity: 0.78;
}

.orientation-card.is-locked:hover {
    border-color: #cbd5e1;
    box-shadow: none;
}

.image-library {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7rem;
}

.image-library-item {
    display: grid;
    min-height: 84px;
    cursor: grab;
    place-items: center;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    padding: 0.35rem;
}

.image-library-item.is-selected {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.image-library-item img {
    max-height: 72px;
    max-width: 100%;
    object-fit: contain;
}

.suggestion-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    padding: 0.45rem 0.55rem;
}

.suggestion-text {
    font-size: 0.78rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.ai-suggestion-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.55rem;
}

.random-dice-button {
    position: relative;
    display: block;
    width: 2.75rem;
    height: 2.75rem;
    flex: none;
    border: 2px solid #f59e0b;
    border-radius: 8px;
    background: linear-gradient(145deg, #ffffff, #fffbeb);
    box-shadow: 0 7px 14px rgba(146, 64, 14, 0.16);
    transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.random-dice-button:hover {
    transform: translateY(-1px);
    border-color: #d97706;
    box-shadow: 0 10px 18px rgba(146, 64, 14, 0.22);
}

.random-dice-button:focus-visible {
    outline: 3px solid rgba(245, 158, 11, 0.35);
    outline-offset: 2px;
}

.dice-dot {
    position: absolute;
    width: 0.42rem;
    height: 0.42rem;
    border-radius: 999px;
    background: #92400e;
}

.dice-dot-top-left {
    left: 25%;
    top: 25%;
    transform: translate(-50%, -50%);
}

.dice-dot-top-right {
    right: 25%;
    top: 25%;
    transform: translate(50%, -50%);
}

.dice-dot-center {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.dice-dot-bottom-left {
    bottom: 25%;
    left: 25%;
    transform: translate(-50%, 50%);
}

.dice-dot-bottom-right {
    right: 25%;
    bottom: 25%;
    transform: translate(50%, 50%);
}

#pdfRenderHost {
    position: fixed;
    left: -100000px;
    top: 0;
    z-index: -1;
    pointer-events: none;
}

.screen-play-layout {
    display: grid;
    gap: 1.25rem;
}

.explore-body {
    display: flex;
    flex-direction: column;
}

.explore-page {
    flex: 1;
    width: min(100% - 2rem, 1080px);
    min-height: min(34rem, 75vh);
    margin-inline: auto;
    padding-block: clamp(1.65rem, 5vw, 3.85rem);
}

.explore-intro {
    margin-bottom: 1.5rem;
}

.explore-intro h1 {
    font-size: clamp(1.85rem, 4vw, 2.75rem);
    font-weight: 800;
    line-height: 1.15;
}

.explore-intro p,
.explore-game-card p {
    margin-top: 0.5rem;
    color: #475569;
    line-height: 1.55;
}

.explore-empty,
.explore-game-card {
    display: grid;
    align-content: start;
    gap: 1rem;
    border: 1px solid #dbe4ed;
    border-radius: 0.8rem;
    background: #ffffff;
    padding: clamp(1.15rem, 3vw, 1.75rem);
    overflow-wrap: anywhere;
}

.explore-empty {
    border-left: 4px solid #059669;
}

.explore-empty h2,
.explore-game-card h2 {
    font-size: 1.18rem;
    font-weight: 750;
}

.explore-game-card p {
    margin-top: 0;
}

.explore-games {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
    gap: 1rem;
}

.explore-empty[hidden],
.explore-games[hidden] {
    display: none;
}

.explore-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
}

.explore-primary,
.explore-secondary {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0.55rem 0.8rem;
    font-size: 0.9rem;
    font-weight: 700;
}

.explore-primary {
    border-color: #047857;
    background: #047857;
    color: #ffffff;
}

.explore-primary:hover {
    background: #065f46;
}

.explore-secondary:hover {
    background: #f1f5f9;
}

.explore-submission {
    margin-top: 1.5rem;
    border-top: 1px solid #cbd5e1;
    padding-top: 1rem;
    color: #475569;
    line-height: 1.55;
}

.explore-submission h2 {
    margin-bottom: 0.25rem;
    color: #0f172a;
    font-weight: 750;
}

.explore-submission a {
    color: #065f46;
    font-weight: 650;
    overflow-wrap: anywhere;
    text-decoration: underline;
}

.about-page {
    color: #0f172a;
}

.about-intro-band {
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
}

.about-intro-grid,
.about-team-section {
    width: min(100% - 2rem, 1200px);
    margin-inline: auto;
}

.about-intro-grid {
    display: grid;
    gap: 1.25rem;
    padding-block: 2rem;
}

.about-eyebrow,
.about-section-heading p,
.person-label {
    color: #047857;
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.about-copy h1 {
    margin-top: 0.65rem;
    max-width: 760px;
    font-size: clamp(2.35rem, 5vw, 4.4rem);
    font-weight: 950;
    line-height: 0.98;
    letter-spacing: 0;
    color: #020617;
}

.about-copy > p {
    margin-top: 1rem;
    max-width: 820px;
    color: #475569;
    font-size: 1rem;
    line-height: 1.75;
}

.about-project-title {
    margin-top: 1.1rem;
    max-width: 820px;
    border-left: 4px solid #10b981;
    background: #f8fafc;
    padding: 0.85rem 1rem;
}

.about-project-title span,
.about-meta-grid span {
    display: block;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.about-project-title strong {
    display: block;
    margin-top: 0.25rem;
    color: #0f172a;
    font-size: 0.98rem;
    line-height: 1.45;
}

.about-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    max-width: 420px;
    margin-top: 1.1rem;
}

.about-meta-grid div {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    padding: 0.75rem;
}

.about-meta-grid strong {
    display: block;
    margin-top: 0.2rem;
    font-size: 1.05rem;
    font-weight: 950;
    color: #0f172a;
}

.institution-panel {
    align-self: start;
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    background: #f8fafc;
    padding: 1rem;
}

.institution-panel-title {
    color: #334155;
    font-size: 0.86rem;
    font-weight: 900;
}

.institution-logo-list {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.85rem;
}

.institution-logo-item {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 0.8rem;
    align-items: center;
    min-height: 74px;
    border-radius: 8px;
    background: #ffffff;
    padding: 0.75rem;
}

.institution-logo-item img {
    width: 58px;
    height: 58px;
    object-fit: contain;
}

.institution-logo-item figcaption {
    color: #0f172a;
    font-size: 0.86rem;
    font-weight: 900;
    line-height: 1.25;
}

.about-team-section {
    padding-block: 1.75rem 2rem;
}

.about-section-heading {
    margin-bottom: 1rem;
}

.about-section-heading h2 {
    margin-top: 0.4rem;
    max-width: 760px;
    font-size: clamp(1.65rem, 3vw, 2.45rem);
    font-weight: 950;
    line-height: 1.05;
    color: #020617;
}

.project-team-grid {
    display: grid;
    gap: 1.25rem;
}

.advisor-row {
    display: flex;
    justify-content: center;
    margin-top: 1.25rem;
}

.project-person-card {
    display: grid;
    grid-template-columns: minmax(150px, 178px) minmax(0, 1fr);
    min-height: 250px;
    overflow: hidden;
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 18px 46px rgba(15, 23, 42, 0.08);
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.project-person-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 22px 54px rgba(15, 23, 42, 0.11);
    transform: translateY(-1px);
}

.project-person-card:focus-visible {
    outline: 3px solid rgba(16, 185, 129, 0.36);
    outline-offset: 3px;
}

.portrait-frame {
    position: relative;
    display: grid;
    min-height: 100%;
    place-items: center;
    background: #eef3f8;
    padding: 0.9rem;
}

.portrait-stage {
    position: relative;
    width: min(100%, 150px);
    aspect-ratio: 224 / 300;
    overflow: hidden;
    border-radius: 8px;
    background: transparent;
}

.portrait-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 180ms ease, transform 220ms ease;
}

.portrait-real {
    opacity: 0;
}

.project-person-card.is-revealed .portrait-comic {
    opacity: 0;
}

.project-person-card.is-revealed .portrait-real {
    opacity: 1;
}

.person-card-body {
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
    justify-content: center;
    padding: 1.25rem;
}

.person-card-body h3 {
    margin-top: 0.45rem;
    color: #020617;
    font-size: 1.6rem;
    font-weight: 950;
    line-height: 1.05;
}

.person-role {
    margin-top: 0.35rem;
    color: #334155;
    font-size: 0.92rem;
    font-weight: 800;
}

.play-area {
    position: relative;
    display: grid;
    min-height: 720px;
    place-items: center;
    overflow: visible;
    border-radius: 8px;
    background: #e2e8f0;
}

.pdf-canvas {
    display: none;
    max-width: 100%;
    height: auto;
    background: #ffffff;
    box-shadow: var(--page-shadow);
}

.pawn-layer {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 4;
    height: 0;
    width: 0;
}

.empty-play-state {
    position: absolute;
    inset: 1rem;
    display: grid;
    place-items: center;
    border: 2px dashed #94a3b8;
    border-radius: 8px;
    color: #475569;
    text-align: center;
}

.screen-pawn {
    position: absolute;
    display: grid;
    height: 38px;
    width: 38px;
    place-items: center;
    border: 4px solid var(--pawn-color, #2563eb);
    border-radius: 999px;
    background: transparent;
    color: var(--pawn-color, #2563eb);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.24), inset 0 0 0 2px rgba(255, 255, 255, 0.62);
    font-size: 0.82rem;
    font-weight: 900;
    line-height: 1;
    z-index: 8;
    cursor: grab;
    padding: 0;
    touch-action: none;
}

.screen-pawn:active {
    cursor: grabbing;
}

.dice-face {
    display: grid;
    aspect-ratio: 1;
    width: 100%;
    place-items: center;
    border-radius: 8px;
    border: 3px solid #0f172a;
    background: #ffffff;
    font-size: 4rem;
    font-weight: 900;
    line-height: 1;
}

.dice-roll-button {
    margin-top: 1.25rem;
}

.dice-face.is-rolling {
    animation: dice-pop 110ms ease-in-out infinite alternate;
}

@keyframes dice-pop {
    from {
        transform: rotate(-2deg) scale(0.98);
    }
    to {
        transform: rotate(2deg) scale(1.03);
    }
}

@media (max-width: 780px) {
    .preview-scroll {
        padding: 0.75rem;
    }

    .board-page.portrait {
        width: min(100%, 520px);
    }

    .play-area {
        min-height: 520px;
    }
}

@media (max-width: 767.98px) {
    .mobile-screen-warning {
        display: block;
        border-bottom: 1px solid #fde68a;
        background: #fef3c7;
        color: #92400e;
        font-size: 0.78rem;
        font-weight: 800;
        line-height: 1.35;
        text-align: center;
    }

    .mobile-screen-warning span {
        display: inline-block;
        padding: 0.55rem 1rem;
    }

    .site-header-nav {
        gap: 0.2rem;
    }

    .nav-link,
    .nav-link-active {
        padding: 0.42rem 0.55rem;
    }

    .creator-shell {
        gap: 0.9rem;
        padding-block: 1rem;
    }
}

@media (min-width: 850px) {
    .creator-workspace {
        grid-template-columns: minmax(0, 1fr) minmax(280px, 34%);
        grid-template-areas: 'preview tools';
        align-items: start;
    }

    .creator-workspace:is([data-step='orientation'], [data-step='finalize']) .board-page.portrait {
        width: min(100%, 760px, max(230px, calc((100svh - 13rem) * 0.707)));
    }
}

@media (min-width: 700px) and (max-width: 1023.98px) {
    .creator-sidebar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .creator-sidebar > section:nth-child(2) {
        grid-row: 2;
        grid-column: 1 / -1;
    }
}

@media (max-width: 1023.98px) {
    .screen-play-layout {
        grid-template-areas:
            "controls controls"
            "board dice";
        grid-template-columns: minmax(0, 1fr) minmax(124px, 158px);
        align-items: start;
    }

    .screen-controls-panel {
        grid-area: controls;
    }

    .screen-board-panel {
        grid-area: board;
    }

    .screen-dice-panel {
        position: sticky;
        top: 0.75rem;
        grid-area: dice;
        padding: 0.85rem;
    }

    .screen-dice-panel h2 {
        font-size: 0.95rem;
        line-height: 1.2;
    }

    .screen-dice-layout {
        margin-top: 0.75rem;
    }

    .dice-face {
        width: 82px;
        max-width: 100%;
        margin-inline: auto;
        border-width: 2px;
        font-size: 2rem;
    }

    .dice-roll-button {
        margin-top: 0.75rem;
        padding-inline: 0.6rem;
    }

    .image-library-item {
        cursor: pointer;
    }
}

@media (min-width: 1024px) {
    .about-intro-grid {
        grid-template-columns: minmax(0, 1fr) 330px;
        align-items: center;
        padding-block: 2.4rem;
    }

    .project-team-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
    }

    .advisor-card {
        width: calc((100% - 1.25rem) / 2);
    }

    .project-person-card:hover .portrait-comic,
    .project-person-card:focus-within .portrait-comic,
    .project-person-card:focus .portrait-comic {
        opacity: 0;
    }

    .project-person-card:hover .portrait-real,
    .project-person-card:focus-within .portrait-real,
    .project-person-card:focus .portrait-real {
        opacity: 1;
    }

    .screen-play-layout {
        grid-template-columns: 190px minmax(0, 1fr) 220px;
        align-items: start;
    }

    .screen-controls-panel,
    .screen-dice-panel {
        position: sticky;
        top: 1rem;
    }

    .creator-shell {
        grid-template-columns: 200px minmax(0, 1fr);
    }

    .creator-sidebar {
        align-self: start;
    }

    #stepList {
        grid-template-columns: minmax(0, 1fr);
    }

    .preview-scroll {
        min-height: 0;
        max-height: none;
    }
}

@media (min-width: 1024px) and (min-height: 650px) {
    .creator-sidebar {
        position: sticky;
        top: 1rem;
    }
}

@media (max-width: 640px) {
    .project-person-card {
        grid-template-columns: 126px minmax(0, 1fr);
        min-height: 218px;
    }

    .portrait-frame {
        padding: 0.7rem;
    }

    .person-card-body {
        padding: 0.95rem;
    }

    .person-card-body h3 {
        font-size: 1.25rem;
    }

}

@media (min-width: 1440px) {
    .creator-workspace {
        grid-template-columns: minmax(0, 1fr) minmax(320px, 365px);
    }
}

@media (max-width: 699.98px) {
    .screen-play-layout {
        grid-template-areas:
            "controls"
            "dice"
            "board";
        grid-template-columns: minmax(0, 1fr);
    }

    .screen-dice-panel {
        position: static;
    }

    .screen-dice-layout {
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }

    .screen-dice-layout .dice-face {
        width: 64px;
        flex: none;
        font-size: 1.75rem;
    }

    .screen-dice-layout .dice-roll-button {
        margin-top: 0;
    }

    .play-area {
        min-height: 480px;
    }
}
