/* ===== NAVIGATION ===== */

:root {
    --mud-appbar-height: 86px;
    --nav-ink: #f0e6dc;
    --nav-ember: #ff4500;
    --nav-night: #080708;
    --nav-violet: #170917;
}

@media (max-width: 959px) {
    :root {
        --mud-appbar-height: 68px;
    }
}

.game-topbar {
    background: linear-gradient(180deg, rgba(7,7,8,0.98) 0%, rgba(18,8,18,0.94) 100%) !important;
    border-bottom: 1px solid rgba(255,69,0,0.34);
    box-sizing: border-box;
    box-shadow: 0 18px 44px rgba(0,0,0,0.5);
    height: var(--mud-appbar-height);
    overflow: visible;
    padding: 10px 18px;
}

.game-topbar .mud-toolbar {
    height: 100%;
    min-height: 0;
    padding: 0;
}

.game-topbar::before {
    content: '';
    position: absolute;
    inset: auto 0 -20px 0;
    height: 20px;
    background: linear-gradient(180deg, rgba(0,0,0,0.26), transparent);
    pointer-events: none;
}

.game-topbar::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 8%;
    right: 8%;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(255,69,0,0.35) 18%, rgba(255,69,0,0.95) 50%, rgba(255,69,0,0.35) 82%, transparent 100%);
    pointer-events: none;
}

.nav-shell {
    align-items: center;
    background: linear-gradient(135deg, rgba(240,230,220,0.08), rgba(255,69,0,0.05));
    border: 1px solid rgba(240,230,220,0.12);
    border-radius: 8px;
    box-sizing: border-box;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 12px 34px rgba(0,0,0,0.28);
    display: flex;
    gap: 12px;
    height: 100%;
    margin: 0 auto;
    max-width: 1240px;
    padding: 8px 10px 8px 14px;
    position: relative;
    width: 100%;
}

.nav-brand {
    align-items: center;
    display: flex;
    flex: 0 1 auto;
    gap: 12px;
    min-width: 0;
}

.nav-logo-img {
    border: 1px solid rgba(255,69,0,0.22);
    border-radius: 6px;
    box-shadow: 0 0 22px rgba(255,69,0,0.12);
    display: block;
    height: 48px;
    object-fit: cover;
    width: 48px;
}

.nav-brand-text,
.drawer-brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    min-width: 0;
}

.nav-brand-name,
.drawer-brand-copy span {
    color: var(--nav-ink);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
}

.nav-brand-tag,
.drawer-brand-copy small {
    color: rgba(255,69,0,0.82);
    font-size: 0.72rem;
    margin-top: 4px;
    text-transform: uppercase;
}

.nav-desktop-links,
.nav-desktop-actions {
    align-items: center;
    display: flex;
    gap: 6px;
}

.nav-desktop-links {
    border-left: 1px solid rgba(240,230,220,0.14);
    margin-left: 4px;
    padding-left: 14px;
}

.nav-link-button {
    border-radius: 6px !important;
    min-width: 0 !important;
}

.nav-link-button:hover {
    background: rgba(255,69,0,0.11) !important;
}

.nav-admin-menu {
    position: relative;
}

.nav-admin-menu:hover .nav-admin-flyout,
.nav-admin-menu:focus-within .nav-admin-flyout {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.nav-admin-flyout {
    background: linear-gradient(180deg, rgba(18,8,18,0.98), rgba(5,5,5,0.98));
    border: 1px solid rgba(255,69,0,0.34);
    border-radius: 8px;
    box-shadow: 0 18px 40px rgba(0,0,0,0.45);
    left: 0;
    min-width: 230px;
    opacity: 0;
    padding: 7px;
    pointer-events: none;
    position: absolute;
    top: calc(100% + 8px);
    transform: translateY(-4px);
    transition: opacity 0.14s ease, transform 0.14s ease;
    z-index: 20;
}

.nav-admin-flyout::before {
    content: '';
    height: 10px;
    left: 0;
    position: absolute;
    right: 0;
    top: -10px;
}

.nav-admin-flyout-link {
    border-radius: 6px !important;
    justify-content: flex-start !important;
    width: 100%;
}

.nav-cta-button {
    border-color: rgba(255,69,0,0.62) !important;
    border-radius: 6px !important;
    box-shadow: 0 0 18px rgba(255,69,0,0.08);
}

.nav-player-chip {
    align-items: center;
    background: rgba(0,0,0,0.28);
    border: 1px solid rgba(255,69,0,0.22);
    border-radius: 999px;
    color: rgba(240,230,220,0.9);
    display: flex;
    gap: 7px;
    max-width: 210px;
    min-width: 0;
    padding: 6px 10px;
}

.nav-player-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-inline-form {
    display: inline-flex;
    margin: 0;
}

.nav-mobile-menu {
    display: none !important;
}

.game-nav-drawer {
    background: linear-gradient(180deg, var(--nav-violet) 0%, var(--nav-night) 42%, #050505 100%) !important;
    border-right: 1px solid rgba(255,69,0,0.34);
    color: var(--nav-ink);
    height: 100dvh !important;
    max-width: 320px !important;
    min-height: 100vh !important;
    overflow: hidden;
    top: 0 !important;
    width: min(84vw, 320px) !important;
}

.game-nav-drawer .mud-nav-link,
.game-nav-drawer .mud-nav-link-text,
.game-nav-drawer .mud-nav-link-icon {
    color: var(--nav-ink) !important;
    opacity: 1;
}

.game-nav-drawer .mud-nav-link.active:not(.mud-nav-link-disabled) {
    background: rgba(255,69,0,0.14);
    color: var(--nav-ink) !important;
}

.drawer-header {
    align-items: center;
    border-bottom: 1px solid rgba(255,69,0,0.28);
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 18px 16px;
}

.drawer-brand {
    align-items: center;
    display: flex;
    gap: 12px;
    min-width: 0;
}

.drawer-logo-img {
    border: 1px solid rgba(255,69,0,0.24);
    border-radius: 6px;
    display: block;
    height: 54px;
    object-fit: cover;
    width: 54px;
}

.drawer-player-card {
    align-items: center;
    background: rgba(255,69,0,0.08);
    border: 1px solid rgba(255,69,0,0.16);
    border-radius: 8px;
    color: rgba(240,230,220,0.92);
    display: flex;
    gap: 10px;
    margin: 14px 14px 6px;
    min-width: 0;
    padding: 11px 12px;
}

.drawer-player-card span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.drawer-nav-list {
    box-sizing: border-box;
    max-height: calc(100dvh - 104px);
    overflow-y: auto;
    padding: 8px;
}

.drawer-nav-list .mud-nav-link {
    border-radius: 6px;
    margin: 3px 0;
}

.drawer-nav-list .mud-nav-link:hover {
    background: rgba(255,69,0,0.12);
}

.nav-drawer-divider {
    border-color: rgba(255,69,0,0.25) !important;
}

.drawer-logout-nav-btn {
    align-items: center;
    background: none;
    border: none;
    border-radius: 6px;
    color: var(--nav-ember);
    cursor: pointer;
    display: flex;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    gap: 12px;
    min-height: 40px;
    padding: 8px 16px;
    text-align: left;
    transition: background-color 0.15s ease;
    width: 100%;
}

.drawer-logout-nav-btn:hover {
    background-color: rgba(255,69,0,0.12);
}

.drawer-logout-nav-btn:active {
    background-color: rgba(255,69,0,0.2);
}

@media (max-width: 959px) {
    .game-topbar {
        padding: 7px 10px;
    }

    .nav-shell {
        padding: 6px 8px 6px 10px;
    }

    .nav-logo-img {
        height: 42px;
        width: 42px;
    }

    .nav-brand-name {
        font-size: 0.88rem;
    }

    .nav-brand-tag {
        display: none;
    }

    .nav-desktop-links,
    .nav-desktop-actions {
        display: none;
    }

    .nav-mobile-menu {
        display: inline-flex !important;
    }
}

@media (max-width: 420px) {
    .nav-brand-text {
        display: none;
    }
}

@media (max-width: 599px) {
    :root {
        --mud-appbar-height: 56px;
    }

    .game-topbar {
        padding: 4px 8px;
    }

    .game-topbar::before {
        bottom: -12px;
        height: 12px;
    }

    .nav-shell {
        gap: 8px;
        padding: 4px 7px;
    }

    .nav-logo-img {
        height: 36px;
        width: 36px;
    }

    .nav-brand-name {
        font-size: 0.8rem;
    }

    .nav-mobile-menu {
        height: 40px !important;
        padding: 8px !important;
        width: 40px !important;
    }

    .game-topbar .mud-toolbar {
        height: 50px;
    }
}

/* ===== HOME ===== */

.home-page {
    align-items: center;
    background: radial-gradient(circle at 50% 8%, rgba(255,69,0,0.11), transparent 34%), #000000;
    color: var(--nav-ink);
    display: flex;
    justify-content: center;
    min-height: calc(100dvh - var(--mud-appbar-height));
    padding: 48px 18px;
}

.home-hero {
    align-items: center;
    display: flex;
    flex-direction: column;
    margin: 0 auto;
    max-width: 620px;
    text-align: center;
    width: 100%;
}

.home-hero-logo {
	border: 1px solid rgba(255,69,0,0.25);
	border-radius: 8px;
	box-shadow: 0 0 28px rgba(255,69,0,0.14);
	display: block;
	margin-bottom: 28px;
	object-fit: cover;
	max-width: 100%;
}

.home-title {
    color: var(--nav-ink);
    font-size: 2.25rem !important;
    font-weight: 700 !important;
    line-height: 1.08 !important;
    margin-bottom: 18px !important;
    text-transform: uppercase;
}

.home-copy {
    color: rgba(240,230,220,0.76);
    line-height: 1.7;
    margin-bottom: 30px !important;
    max-width: 520px;
}

.home-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.home-primary-action {
    border-color: rgba(255,69,0,0.72) !important;
    border-radius: 6px !important;
}

.home-secondary-action {
    border-radius: 6px !important;
}

.home-note {
    color: rgba(240,230,220,0.44);
    display: block;
    margin-top: 28px !important;
    text-transform: uppercase;
}

@media (max-width: 599px) {
    .home-page {
        align-items: flex-start;
        padding: 44px 18px 32px;
    }

	.home-hero-logo {
		margin-bottom: 24px;
		max-width: 100%;
	}

    .home-title {
        font-size: 1.75rem !important;
    }

    .home-copy {
        font-size: 0.95rem;
    }

    .home-actions,
    .home-actions .mud-button-root {
        width: 100%;
    }
}

/* ===== AUTH FORM FIELDS (Register & Login) ===== */

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-label {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(240,230,220,0.6);
}

.auth-input {
    background: transparent;
    border: 1px solid rgba(255,69,0,0.5);
    border-radius: 4px;
    color: #f0e6dc;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    padding: 12px 14px;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

.auth-input::placeholder {
    color: rgba(240,230,220,0.2);
}

.auth-input:focus {
    border-color: #ff4500;
    box-shadow: 0 0 0 2px rgba(255,69,0,0.18);
}

.auth-input:hover:not(:focus) {
    border-color: rgba(255,69,0,0.75);
}

.auth-validation-summary {
    background: rgba(229,0,0,0.1);
    border: 1px solid rgba(229,0,0,0.4);
    border-radius: 4px;
    color: #ff6b6b;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    padding: 10px 14px;
    margin-bottom: 20px;
    list-style: none;
}

.auth-validation-msg {
    color: #ff6b6b;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
}

.auth-remember-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    color: rgba(240,230,220,0.7);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.auth-remember-row input[type="checkbox"] {
    accent-color: #ff4500;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.auth-passkey-btn {
    background: none;
    border: 1px solid rgba(255,69,0,0.35);
    border-radius: 4px;
    color: rgba(240,230,220,0.65);
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    padding: 8px 18px;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.auth-passkey-btn:hover {
    border-color: rgba(255,69,0,0.7);
    color: #f0e6dc;
}

/* ===== ACCOUNT MANAGEMENT ===== */

.account-manage-page {
    color: var(--nav-ink);
    min-height: calc(100dvh - var(--mud-appbar-height));
}

.account-manage-intro {
    max-width: 460px;
}

.account-manage-nav,
.account-manage-panel {
    background: linear-gradient(180deg, rgba(18,8,18,0.94), rgba(8,7,8,0.96)) !important;
    border: 1px solid rgba(255,69,0,0.18);
    border-radius: 8px !important;
}

.account-manage-nav {
    position: sticky;
    top: calc(var(--mud-appbar-height) + 16px);
}

.account-manage-nav-title {
    font-family: 'Courier New', monospace;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.account-manage-nav .mud-nav-link {
    border-radius: 6px;
    color: rgba(240,230,220,0.82) !important;
    margin: 3px 0;
}

.account-manage-nav .mud-nav-link:hover {
    background: rgba(255,69,0,0.11);
}

.account-manage-nav .mud-nav-link.active:not(.mud-nav-link-disabled) {
    background: rgba(255,69,0,0.16) !important;
    color: var(--nav-ink) !important;
}

.account-manage-nav .mud-nav-link-icon {
    color: rgba(255,69,0,0.72) !important;
}

.account-manage-panel-heading {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
}

.account-manage-readonly-input {
    color: rgba(240,230,220,0.48);
    cursor: not-allowed;
}

.account-manage-panel .alert {
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    margin-bottom: 20px;
    padding: 10px 14px;
}

.account-manage-panel .alert-success {
    background: rgba(46,125,50,0.12);
    border: 1px solid rgba(102,187,106,0.38);
    color: #8ee59a;
}

.account-manage-panel .alert-danger {
    background: rgba(229,0,0,0.1);
    border: 1px solid rgba(229,0,0,0.4);
    color: #ff6b6b;
}

@media (max-width: 959px) {
    .account-manage-nav {
        position: static;
    }
}

/* ===== ADMIN ===== */

.persona-admin-page {
    color: var(--nav-ink);
    min-height: calc(100dvh - var(--mud-appbar-height));
}

.admin-page-header,
.persona-editor-heading,
.persona-list-heading,
.persona-avatar-row,
.persona-editor-actions,
.island-tile-editor-actions {
    align-items: center;
    display: flex;
}

.admin-page-header,
.persona-editor-heading,
.persona-list-heading {
    gap: 16px;
    justify-content: space-between;
}

.admin-page-title {
    color: var(--nav-ink);
    font-weight: 700 !important;
    text-transform: uppercase;
}

.admin-page-copy,
.muted-admin-text {
    color: rgba(240,230,220,0.66);
}

.persona-editor-panel,
.persona-list-panel,
.island-designer-selector,
.island-designer-board-panel,
.island-designer-detail-panel {
    background: linear-gradient(180deg, rgba(18,8,18,0.94), rgba(8,7,8,0.96)) !important;
    border: 1px solid rgba(255,69,0,0.18);
    border-radius: 8px !important;
}

.admin-action-button {
    border-radius: 6px !important;
}

.persona-avatar-field {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.persona-avatar-row {
    gap: 14px;
}

.persona-avatar-preview,
.persona-avatar-placeholder {
    border: 1px solid rgba(255,69,0,0.28);
    border-radius: 8px;
    height: 96px;
    width: 96px;
}

.persona-avatar-preview {
    display: block;
    object-fit: cover;
}

.persona-avatar-placeholder,
.persona-table-avatar-empty {
    align-items: center;
    background: rgba(0,0,0,0.24);
    color: rgba(240,230,220,0.48);
    display: flex;
    justify-content: center;
}

.persona-upload-stack {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.persona-upload-stack input[type="file"] {
    color: rgba(240,230,220,0.72);
    max-width: 100%;
}

.persona-editor-actions,
.island-tile-editor-actions {
    flex-wrap: wrap;
    gap: 10px;
}

.persona-table-avatar {
    border: 1px solid rgba(255,69,0,0.22);
    border-radius: 6px;
    height: 48px;
    object-fit: cover;
    width: 48px;
}

.persona-table-actions {
    text-align: right;
    vertical-align: middle;
    white-space: nowrap;
}

.persona-table-actions .mud-button-root + .mud-button-root {
    margin-left: 4px;
}

.creature-admin-grid {
    overflow-x: auto;
}

.creature-table-image,
.creature-editor-preview {
    background: rgba(7, 8, 12, 0.82);
    border: 1px solid rgba(214, 183, 106, 0.28);
    border-radius: 8px;
    height: 64px;
    object-fit: cover;
    width: 64px;
}

.creature-image-preview-button {
    background: transparent;
    border: 0;
    cursor: zoom-in;
    display: inline-flex;
    padding: 0;
}

.creature-image-preview-button:hover .creature-table-image,
.creature-image-preview-button:focus-visible .creature-table-image,
.creature-image-preview-button:hover .creature-editor-preview,
.creature-image-preview-button:focus-visible .creature-editor-preview {
    border-color: rgba(255, 69, 0, 0.78);
    box-shadow: 0 0 0 3px rgba(255, 69, 0, 0.16);
}

.creature-table-image-empty,
.creature-editor-preview-empty {
    align-items: center;
    color: rgba(229, 220, 197, 0.7);
    display: inline-flex;
    justify-content: center;
}

.creature-editor-preview-row {
    align-items: start;
    display: grid;
    gap: 1rem;
    grid-template-columns: auto minmax(0, 1fr);
}

.creature-editor-identity {
    min-width: 0;
}

.creature-editor-stat-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.npc-conversation-line-editor-row {
    align-items: flex-start;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: minmax(0, 1fr) auto;
}

.npc-conversation-line-editor-field {
    min-width: 0;
}

.npc-conversation-line-rewrite-button {
    margin-top: 8px;
}

.npc-conversation-line-portrait-row {
    align-items: center;
    display: flex;
    gap: 0.75rem;
}

.npc-conversation-line-portrait-row .mud-input-control {
    flex: 1 1 auto;
    min-width: 0;
}

.npc-conversation-line-portrait-preview {
    border: 1px solid rgba(255,69,0,0.22);
    border-radius: 6px;
    flex: 0 0 auto;
    height: 48px;
    object-fit: cover;
    width: 48px;
}

.npc-portrait-row-info {
    align-items: center;
    display: flex;
    gap: 0.75rem;
}

.creature-appearance-panel {
    background: rgba(7, 8, 12, 0.46);
    border: 1px solid rgba(214, 183, 106, 0.16);
    border-radius: 8px;
}

.creature-coordinate-grid,
.creature-type-rule-row {
    display: grid;
    gap: 0.75rem;
}

.creature-coordinate-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.creature-type-rule-row {
    align-items: center;
    grid-template-columns: minmax(0, 1fr) auto;
}

.creature-attack-row {
    align-items: center;
    border-bottom: 1px solid rgba(214, 183, 106, 0.12);
    display: grid;
    gap: 0.75rem;
    grid-template-columns: minmax(0, 1fr) 140px;
    padding: 0.35rem 0;
}

.creature-attack-weight {
    min-width: 0;
}

.creature-drops-chip {
    cursor: pointer;
}

.creature-drop-row {
    align-items: center;
    border-bottom: 1px solid rgba(214, 183, 106, 0.12);
    display: grid;
    gap: 0.75rem;
    grid-template-columns: minmax(220px, 1fr) 140px 100px 100px 110px;
    padding: 0.55rem 0;
}

.creature-drop-row:last-child {
    border-bottom: 0;
}

.creature-drop-item {
    align-items: center;
    display: flex;
    gap: 0.75rem;
    min-width: 0;
}

.creature-drop-image {
    background: rgba(7, 8, 12, 0.82);
    border: 1px solid rgba(214, 183, 106, 0.24);
    border-radius: 6px;
    flex: 0 0 auto;
    height: 42px;
    object-fit: cover;
    width: 42px;
}

.loot-dialog-title,
.loot-choice-row {
    align-items: center;
    display: flex;
    gap: 0.75rem;
}

.loot-choice-row {
    border-bottom: 1px solid rgba(214, 183, 106, 0.12);
    padding: 0.65rem 0;
}

.loot-choice-row:last-child {
    border-bottom: 0;
}

.loot-choice-image {
    background: rgba(7, 8, 12, 0.82);
    border: 1px solid rgba(214, 183, 106, 0.24);
    border-radius: 6px;
    flex: 0 0 auto;
    height: 50px;
    object-fit: cover;
    width: 50px;
}

.loot-choice-image-empty {
    align-items: center;
    color: rgba(229, 220, 197, 0.7);
    display: inline-flex;
    justify-content: center;
}

.loot-choice-copy {
    flex: 1 1 auto;
    min-width: 0;
}

.creature-appearance-rule-row {
    align-items: center;
    border-bottom: 1px solid rgba(214, 183, 106, 0.12);
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    padding: 0.5rem 0;
}

.creature-appearance-rule-row:last-child {
    border-bottom: 0;
}

.image-preview-dialog-title {
    display: flex;
    min-width: 0;
}

.image-preview-dialog-stage {
    align-items: center;
    background: rgba(7, 8, 12, 0.82);
    border: 1px solid rgba(214, 183, 106, 0.2);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    min-height: 360px;
    overflow: hidden;
}

.image-preview-dialog-image {
    display: block;
    max-height: 72dvh;
    max-width: 100%;
    object-fit: contain;
}

.island-designer-page {
    color: var(--nav-ink);
    min-height: calc(100dvh - var(--mud-appbar-height));
}

.island-designer-selector-grid {
    align-items: center;
}

.island-native-select-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.island-native-select-field label {
    color: rgba(240,230,220,0.72);
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
}

.island-native-select-field select {
    appearance: none;
    background: linear-gradient(180deg, rgba(11,10,12,0.96), rgba(21,10,18,0.96));
    border: 1px solid rgba(255,69,0,0.38);
    border-radius: 6px;
    color: var(--nav-ink);
    cursor: pointer;
    min-height: 48px;
    padding: 0 42px 0 14px;
    width: 100%;
}

.island-native-select-field::after {
    align-self: flex-end;
    color: rgba(255,69,0,0.84);
    content: '▼';
    font-size: 0.7rem;
    margin-right: 14px;
    margin-top: -34px;
    pointer-events: none;
}

.island-native-select-field select:focus {
    border-color: rgba(255,69,0,0.86);
    box-shadow: 0 0 0 2px rgba(255,69,0,0.16);
    outline: none;
}

.island-native-select-field select:disabled {
    cursor: default;
    opacity: 0.6;
}

.island-summary-row,
.island-designer-toolbar,
.island-designer-controls,
.island-detail-heading,
.tile-editor-dialog-title,
.tile-editor-actions-row {
    align-items: center;
    display: flex;
}

.island-summary-row {
    gap: 12px;
}

.island-designer-toolbar {
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 16px;
}

.island-designer-controls {
    background: rgba(0,0,0,0.22);
    border: 1px solid rgba(255,69,0,0.18);
    border-radius: 8px;
    gap: 4px;
    padding: 4px;
}

.island-detail-heading,
.tile-editor-dialog-title {
    gap: 14px;
    justify-content: space-between;
}

.island-designer-controls .mud-checkbox {
    margin-right: 6px;
}

.island-iso-viewport {
    background: linear-gradient(180deg, rgba(0,0,0,0.24), rgba(255,69,0,0.04));
    border: 1px solid rgba(240,230,220,0.1);
    border-radius: 8px;
    height: 620px;
    overflow: auto;
    position: relative;
}

.island-iso-board {
    height: 920px;
    min-width: 980px;
    position: relative;
}

.iso-cube {
    background: transparent;
    border: 0;
    cursor: pointer;
    height: 78px;
    padding: 0;
    position: absolute;
    transform: translate(-42px, -39px);
    transition: opacity 0.16s ease;
    width: 84px;
}

.iso-cube:focus-visible {
    outline: 2px solid rgba(255,69,0,0.9);
    outline-offset: 8px;
}

.iso-cube-top,
.iso-cube-left,
.iso-cube-right {
    display: block;
    position: absolute;
}

.iso-cube-top {
    background: linear-gradient(135deg, rgba(109,123,136,0.96), rgba(42,52,58,0.98));
    clip-path: polygon(50% 0, 100% 25%, 50% 50%, 0 25%);
    height: 84px;
    left: 0;
    top: 0;
    width: 84px;
}

.iso-cube-left {
    background: linear-gradient(135deg, rgba(41,49,55,0.96), rgba(18,22,25,0.98));
    clip-path: polygon(0 0, 50% 25%, 50% 74%, 0 49%);
    height: 84px;
    left: 0;
    top: 21px;
    width: 84px;
}

.iso-cube-right {
    background: linear-gradient(135deg, rgba(63,75,82,0.98), rgba(24,29,32,0.98));
    clip-path: polygon(50% 25%, 100% 0, 100% 49%, 50% 74%);
    height: 84px;
    left: 0;
    top: 21px;
    width: 84px;
}

.iso-cube-label {
    align-items: center;
    background: rgba(0,0,0,0.56);
    border: 1px solid rgba(240,230,220,0.16);
    border-radius: 6px;
    color: rgba(240,230,220,0.9);
    display: flex;
    font-size: 0.68rem;
    font-weight: 700;
    height: 24px;
    justify-content: center;
    left: 15px;
    line-height: 1;
    position: absolute;
    top: 30px;
    width: 54px;
}

.iso-cube:hover .iso-cube-top {
    background: linear-gradient(135deg, rgba(132,147,158,0.98), rgba(65,78,84,0.98));
}

.iso-cube-selected .iso-cube-top {
    background: linear-gradient(135deg, rgba(255,111,40,0.98), rgba(117,43,14,0.98));
}

.iso-cube-selected .iso-cube-left {
    background: linear-gradient(135deg, rgba(128,43,13,0.98), rgba(43,15,7,0.98));
}

.iso-cube-selected .iso-cube-right {
    background: linear-gradient(135deg, rgba(174,69,22,0.98), rgba(67,22,8,0.98));
}

.iso-cube-start .iso-cube-top {
    background: linear-gradient(135deg, rgba(116,148,111,0.98), rgba(47,72,47,0.98));
}

.iso-cube-dimmed {
    opacity: 0.24;
}

.iso-cube-dimmed:hover {
    opacity: 0.58;
}

.iso-cube-add {
    opacity: 0.72;
}

.iso-cube-add .iso-cube-top,
.iso-cube-add .iso-cube-left,
.iso-cube-add .iso-cube-right {
    background: rgba(255,69,0,0.12);
    outline: 1px dashed rgba(255,69,0,0.72);
}

.iso-cube-add .iso-cube-label {
    color: #ff9a68;
    font-size: 1rem;
}

.iso-cube-add:hover {
    opacity: 1;
}

.island-coordinate-card {
    background: rgba(0,0,0,0.22);
    border: 1px solid rgba(255,69,0,0.18);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
}

.island-scene-thumbnail-button {
    background: rgba(0,0,0,0.22);
    border: 1px solid rgba(255,69,0,0.22);
    border-radius: 8px;
    cursor: zoom-in;
    height: 128px;
    overflow: hidden;
    padding: 0;
    width: 100%;
}

.island-scene-thumbnail-button:focus-visible {
    outline: 2px solid rgba(255,69,0,0.9);
    outline-offset: 3px;
}

.island-scene-thumbnail {
    display: block;
    height: 100%;
    object-fit: cover;
    transition: transform 0.16s ease, opacity 0.16s ease;
    width: 100%;
}

.island-scene-thumbnail-button:hover .island-scene-thumbnail {
    opacity: 0.88;
    transform: scale(1.03);
}

.island-scene-overlay {
    align-items: center;
    background: rgba(0,0,0,0.82);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 24px;
    position: fixed;
    z-index: 20000;
}

.island-scene-overlay-panel {
    background: linear-gradient(180deg, rgba(18,8,18,0.98), rgba(8,7,8,0.98));
    border: 1px solid rgba(255,69,0,0.28);
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(0,0,0,0.62);
    max-height: calc(100dvh - 48px);
    max-width: min(1100px, calc(100vw - 48px));
    overflow: hidden;
    width: 100%;
}

.island-scene-overlay-header {
    align-items: center;
    border-bottom: 1px solid rgba(255,69,0,0.18);
    display: flex;
    gap: 16px;
    justify-content: space-between;
    padding: 12px 14px;
}

.island-scene-overlay-header .mud-typography-caption {
    display: block;
    max-width: min(820px, 70vw);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.island-scene-overlay-image {
    display: block;
    max-height: calc(100dvh - 140px);
    object-fit: contain;
    width: 100%;
}

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

.island-direction-grid .mud-button-root {
    border-radius: 6px !important;
    justify-content: flex-start !important;
}

.tile-editor-layout {
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(0, 1fr) 340px;
    width: min(1180px, 84vw);
}

.tile-editor-image-shell,
.tile-editor-side-panel {
    background: rgba(0,0,0,0.24) !important;
    border: 1px solid rgba(255,69,0,0.18);
    border-radius: 8px !important;
}

.tile-editor-image-shell {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 320px;
    overflow: auto;
    padding: 12px;
}

.tile-editor-image-stage {
    display: inline-block;
    line-height: 0;
    max-width: 100%;
    position: relative;
}

.tile-editor-scene-image {
    border-radius: 6px;
    display: block;
    max-height: min(66dvh, 720px);
    max-width: 100%;
    object-fit: contain;
    width: auto;
}

.tile-editor-overlay {
    inset: 0;
    line-height: 1.2;
    position: absolute;
}

.tile-editor-overlay-drawing {
    cursor: crosshair;
}

.tile-editor-overlay-moving {
    cursor: move;
}

.tile-editor-overlay-shaping {
    cursor: default;
}

.tile-editor-vertex-handle {
    background: rgba(255,245,235,0.95);
    border: 2px solid rgba(255,69,0,0.95);
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.45);
    box-sizing: border-box;
    cursor: grab;
    height: 16px;
    margin: -8px 0 0 -8px;
    padding: 0;
    position: absolute;
    transition: transform 0.08s ease;
    width: 16px;
    z-index: 5;
}

.tile-editor-vertex-handle:hover {
    transform: scale(1.18);
}

.tile-editor-vertex-handle-selected {
    background: rgba(255,210,120,0.98);
    border-color: rgba(255,255,255,0.98);
    box-shadow: 0 0 0 3px rgba(255,69,0,0.4);
    cursor: grabbing;
    transform: scale(1.18);
}

.tile-editor-hotspot {
    align-items: center;
    background: rgba(255,69,0,0.22);
    border: 2px solid rgba(255,154,104,0.9);
    border-radius: 6px;
    color: rgba(255,245,235,0.94);
    cursor: move;
    display: flex;
    font-size: 0.78rem;
    font-weight: 700;
    justify-content: center;
    min-height: 18px;
    min-width: 18px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    text-align: center;
    text-shadow: 0 1px 4px rgba(0,0,0,0.78);
}

.tile-editor-hotspot-icon {
    font-size: 1.15rem !important;
    filter: drop-shadow(0 1px 4px rgba(0,0,0,0.78));
    pointer-events: none;
}

.tile-editor-icon-option {
    align-items: center;
    display: flex;
    gap: 10px;
    min-width: 0;
}

.tile-editor-hotspot:hover,
.tile-editor-hotspot-selected {
    background: rgba(255,111,40,0.36);
    border-color: rgba(255,245,235,0.98);
    box-shadow: 0 0 0 2px rgba(255,69,0,0.25);
}

.tile-editor-event-hotspot {
    background: rgba(86,180,152,0.24);
    border-color: rgba(151,224,199,0.9);
}

.tile-editor-event-hotspot:hover,
.tile-editor-event-hotspot.tile-editor-hotspot-selected {
    background: rgba(86,180,152,0.38);
    border-color: rgba(229,255,244,0.98);
    box-shadow: 0 0 0 2px rgba(86,180,152,0.25);
}

.tile-editor-hidden-hotspot {
    background: repeating-linear-gradient(
        135deg,
        rgba(86,180,152,0.18),
        rgba(86,180,152,0.18) 6px,
        rgba(0,0,0,0.28) 6px,
        rgba(0,0,0,0.28) 12px
    );
    border-style: dashed;
}

.tile-editor-hotspot-draft {
    pointer-events: none;
}

.island-detail-action-row {
    align-items: center;
    display: flex;
    gap: 4px;
}

.npc-placement-overlay {
    overflow: hidden;
}

.npc-placement-marker {
    align-items: center;
    background: transparent;
    border: 0;
    cursor: move;
    display: flex;
    flex-direction: column;
    gap: 4px;
    line-height: 1.1;
    padding: 0;
    position: absolute;
    text-align: center;
    transform: translate(-50%, -100%);
    transform-origin: center bottom;
    z-index: 2;
}

.npc-placement-marker img {
    display: block;
    filter: drop-shadow(0 10px 18px rgba(0,0,0,0.72));
    max-width: 100%;
    pointer-events: none;
    user-select: none;
}

.npc-placement-marker span {
    background: rgba(0,0,0,0.72);
    border: 1px solid rgba(255,154,104,0.45);
    border-radius: 6px;
    color: rgba(255,245,235,0.96);
    font-size: 0.72rem;
    font-weight: 700;
    max-width: 100%;
    overflow: hidden;
    padding: 3px 6px;
    pointer-events: none;
    text-overflow: ellipsis;
    text-shadow: 0 1px 4px rgba(0,0,0,0.9);
    white-space: nowrap;
}

.npc-placement-marker:hover img,
.npc-placement-marker-selected img {
    filter: drop-shadow(0 10px 18px rgba(0,0,0,0.72)) drop-shadow(0 0 10px rgba(255,154,104,0.65));
}

.npc-placement-marker-selected span {
    background: rgba(70,24,10,0.86);
    border-color: rgba(255,245,235,0.82);
}

.tile-editor-actions-row {
    flex-wrap: wrap;
    gap: 8px;
}

.tile-editor-actions-row .mud-button-root {
    border-radius: 6px !important;
}

.tile-editor-percent-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tile-editor-connection-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tile-editor-connection-list .mud-button-root {
    border-radius: 6px !important;
    justify-content: flex-start !important;
    min-width: 0 !important;
}

@media (max-width: 599px) {
    .admin-page-header,
    .persona-editor-heading,
    .persona-list-heading,
    .persona-avatar-row,
    .island-designer-toolbar,
    .island-summary-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-page-header .mud-button-root,
    .persona-editor-actions .mud-button-root {
        width: 100%;
    }

    .creature-editor-preview-row,
    .creature-editor-stat-grid,
    .npc-conversation-line-editor-row,
    .creature-coordinate-grid,
    .creature-attack-row,
    .creature-drop-row,
    .creature-type-rule-row {
        grid-template-columns: 1fr;
    }

    .npc-conversation-line-rewrite-button {
        margin-top: 0;
        width: 100%;
    }

    .island-iso-viewport {
        height: 500px;
    }

    .island-scene-overlay {
        padding: 12px;
    }

    .island-scene-overlay-panel {
        max-height: calc(100dvh - 24px);
        max-width: calc(100vw - 24px);
    }

    .island-scene-overlay-header {
        align-items: flex-start;
    }

    .island-scene-overlay-header .mud-typography-caption {
        max-width: calc(100vw - 98px);
    }

    .island-scene-overlay-image {
        max-height: calc(100dvh - 126px);
    }

    .island-direction-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 959px) {
    .tile-editor-layout {
        grid-template-columns: 1fr;
        width: min(100%, 84vw);
    }

    .tile-editor-side-panel {
        order: -1;
    }
}

.animation-testing-layout {
    align-items: stretch;
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
}

.animation-testing-controls {
    align-self: start;
}

.animation-testing-scene-panel {
    min-height: 620px;
}

.animation-testing-frame {
    min-height: 0;
}

.animation-testing-stage {
    max-height: 620px;
    width: min(100%, 620px);
}

.animation-testing-creature {
    filter: drop-shadow(0 18px 24px rgba(0,0,0,0.58));
    height: 46%;
    top: 14%;
}

@media (max-width: 959px) {
    .animation-testing-layout {
        grid-template-columns: 1fr;
    }

    .animation-testing-scene-panel {
        min-height: 0;
    }
}

/* ===== PLAY ONBOARDING ===== */

.play-page {
    color: var(--nav-ink);
    min-height: calc(100dvh - var(--mud-appbar-height));
}

.play-loading {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: calc(100dvh - var(--mud-appbar-height));
}

.play-onboarding-header {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
}

.play-onboarding-title,
.island-intro-title {
    color: var(--nav-ink);
    font-weight: 700 !important;
    text-transform: uppercase;
}

.play-onboarding-copy,
.island-intro-copy {
    color: rgba(240,230,220,0.72);
}

.persona-choice-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
}

.persona-choice-card {
    aspect-ratio: 1;
    background: linear-gradient(180deg, rgba(18,8,18,0.94), rgba(8,7,8,0.98));
    border: 1px solid rgba(255,69,0,0.2);
    border-radius: 8px;
    cursor: pointer;
    overflow: hidden;
    padding: 0;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.persona-choice-card:hover,
.persona-choice-card:focus-visible {
    border-color: rgba(255,69,0,0.72);
    box-shadow: 0 16px 34px rgba(0,0,0,0.34), 0 0 22px rgba(255,69,0,0.12);
    outline: none;
    transform: translateY(-2px);
}

.persona-choice-avatar {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.persona-choice-avatar-empty,
.persona-choice-dialog-avatar-empty {
    align-items: center;
    background: rgba(0,0,0,0.28);
    color: rgba(240,230,220,0.5);
    display: flex;
    justify-content: center;
}

.persona-choice-dialog-avatar {
    border: 1px solid rgba(255,69,0,0.28);
    border-radius: 8px;
    display: block;
    height: min(360px, 58dvh);
    object-fit: cover;
    width: 100%;
}

.persona-choice-dialog-copy {
    color: rgba(240,230,220,0.82);
    line-height: 1.68;
    white-space: pre-line;
}

.island-intro-panel {
    background: linear-gradient(180deg, rgba(18,8,18,0.94), rgba(8,7,8,0.98)) !important;
    border: 1px solid rgba(255,69,0,0.22);
    border-radius: 8px !important;
}

.island-intro-kicker {
    color: rgba(255,69,0,0.78);
}

.island-intro-title {
    line-height: 1.05 !important;
}

.island-intro-arrival {
    border-left: 2px solid rgba(255,69,0,0.54);
    color: rgba(240,230,220,0.86);
    line-height: 1.72;
    padding-left: 16px;
}

.island-intro-action {
    align-self: flex-start;
    border-radius: 6px !important;
}

.play-game-shell {
    box-sizing: border-box;
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    min-height: calc(100dvh - var(--mud-appbar-height));
    padding: 16px;
}

.play-scene-panel,
.play-command-panel {
    background: linear-gradient(180deg, rgba(18,8,18,0.94), rgba(8,7,8,0.98));
    border: 1px solid rgba(255,69,0,0.2);
    border-radius: 8px;
    box-shadow: 0 18px 44px rgba(0,0,0,0.28);
    min-width: 0;
}

.play-scene-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    padding: 14px;
    position: relative;
}

.play-command-panel {
    align-self: stretch;
    box-sizing: border-box;
    overflow-y: auto;
    padding: 14px;
}

.play-scene-header {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
}

.play-location-summary {
    flex: 1 1 auto;
    min-width: 0;
    position: relative;
}

.play-location-title-button {
    align-items: center;
    background: transparent;
    border: 0;
    color: var(--nav-ink);
    cursor: pointer;
    display: inline-flex;
    gap: 8px;
    max-width: 100%;
    padding: 0;
    text-align: left;
}

.play-location-title-button:focus-visible {
    outline: 2px solid rgba(255,69,0,0.86);
    outline-offset: 4px;
}

.play-location-title {
    color: var(--nav-ink);
    font-weight: 700 !important;
    line-height: 1.08 !important;
    text-transform: uppercase;
}

.play-location-caret {
    color: rgba(255,154,104,0.86);
    flex: 0 0 auto;
    transition: transform 0.22s ease;
}

.play-location-caret-open {
    transform: rotate(180deg);
}

.play-location-description-panel {
    background: linear-gradient(180deg, rgba(12,10,12,0.96), rgba(22,9,17,0.96));
    border: 1px solid rgba(255,69,0,0.26);
    border-radius: 8px;
    box-shadow: 0 18px 46px rgba(0,0,0,0.46);
    left: 0;
    max-width: min(720px, calc(100vw - 82px));
    opacity: 0;
    padding: 12px 14px;
    pointer-events: none;
    position: absolute;
    top: calc(100% + 10px);
    transform: translateY(-6px);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
    visibility: hidden;
    width: max-content;
    z-index: 5;
}

.play-location-description-panel-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    visibility: visible;
}

.play-location-description {
    color: rgba(240,230,220,0.68);
    line-height: 1.6;
    max-width: 68ch;
}

.tile-presence-strip {
    align-items: center;
    display: flex;
    gap: 6px;
    height: 32px;
    margin-top: 8px;
    max-width: 100%;
    overflow: hidden;
}

.tile-presence-avatar {
    align-items: center;
    background: rgba(0,0,0,0.36);
    border: 1px solid rgba(255,154,104,0.52);
    border-radius: 999px;
    color: rgba(255,245,235,0.9);
    cursor: pointer;
    display: flex;
    flex: 0 0 30px;
    font-family: 'Courier New', monospace;
    font-size: 0.72rem;
    font-weight: 700;
    height: 30px;
    justify-content: center;
    overflow: hidden;
    padding: 0;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease, opacity 0.16s ease, transform 0.16s ease;
    width: 30px;
}

.tile-presence-avatar img {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.tile-presence-avatar:hover,
.tile-presence-avatar:focus-visible {
    border-color: rgba(255,245,235,0.92);
    box-shadow: 0 0 14px rgba(255,69,0,0.2);
    outline: none;
    transform: translateY(-1px);
}

.tile-presence-avatar-inactive {
    filter: grayscale(0.65);
    opacity: 0.48;
}

.tile-presence-overflow {
    background: rgba(255,69,0,0.18);
    border-color: rgba(255,154,104,0.44);
    letter-spacing: 0;
}

.mud-tooltip {
    max-width: calc(100vw - 24px);
    overflow-wrap: anywhere;
    white-space: normal;
}

.play-avatar-button {
    align-items: center;
    background: rgba(0,0,0,0.34);
    border: 2px solid rgba(255,69,0,0.42);
    border-radius: 999px;
    color: rgba(240,230,220,0.78);
    cursor: pointer;
    display: flex;
    flex: 0 0 auto;
    height: 68px;
    justify-content: center;
    overflow: hidden;
    padding: 0;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
    width: 68px;
}

.play-avatar-button img {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.play-avatar-button-calm {
    border-color: rgba(127,176,133,0.54);
    box-shadow: 0 0 12px rgba(127,176,133,0.1);
}

.play-avatar-button-shaken {
    border-color: rgba(255,203,107,0.68);
    box-shadow: 0 0 18px rgba(255,203,107,0.18), inset 0 0 16px rgba(255,203,107,0.08);
}

.play-avatar-button-panicked {
    border-color: rgba(255,126,74,0.86);
    box-shadow: 0 0 24px rgba(255,126,74,0.28), inset 0 0 22px rgba(255,126,74,0.12);
}

.play-avatar-button-terrified {
    border-color: rgba(255,59,59,0.98);
    box-shadow: 0 0 34px rgba(255,59,59,0.38), 0 0 10px rgba(255,245,235,0.2), inset 0 0 26px rgba(255,59,59,0.16);
}

.play-avatar-button:hover,
.play-avatar-button:focus-visible {
    border-color: rgba(255,154,104,0.96);
    box-shadow: 0 0 24px rgba(255,69,0,0.16);
    outline: none;
    transform: translateY(-1px);
}

.play-status-alert {
    flex: 0 0 auto;
}

.play-journal-notification {
    align-items: center;
    background: rgba(12, 20, 18, 0.92);
    border: 1px solid rgba(214, 183, 106, 0.34);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
    display: grid;
    gap: 10px;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    padding: 10px 12px;
    position: relative;
}

.play-journal-notification-copy {
    min-width: 0;
}

.play-scene-frame {
    align-items: center;
    display: flex;
    flex: 1 1 auto;
    justify-content: center;
    min-height: 0;
    overflow: hidden;
}

.play-scene-stage,
.play-scene-missing {
    aspect-ratio: 1 / 1;
    border: 1px solid rgba(240,230,220,0.12);
    border-radius: 8px;
    box-shadow: inset 0 0 70px rgba(0,0,0,0.24);
    container-type: inline-size;
    max-height: calc(100dvh - var(--mud-appbar-height) - 132px);
    max-width: 100%;
    overflow: hidden;
    position: relative;
    width: min(100%, calc(100dvh - var(--mud-appbar-height) - 132px));
}

.play-scene-stage {
    filter: brightness(1) saturate(1);
    transition: filter 0ms linear;
}

.play-scene-stage-moving {
    filter: brightness(0.56) saturate(0.82);
    transition: filter 850ms ease;
}

.play-scene-image {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.play-scene-stage-battle::after {
    background: radial-gradient(circle at 50% 20%, rgba(255,69,0,0.12), rgba(0,0,0,0.5) 72%);
    content: '';
    inset: 0;
    pointer-events: none;
    position: absolute;
    z-index: 1;
}

.play-battle-creature {
    display: block;
    left: 50%;
    max-width: 100%;
    pointer-events: none;
    position: absolute;
    top: 33.333%;
    transform: translateX(-50%);
    width: 100%;
    z-index: 2;
}

.play-battle-creature-image {
    display: block;
    height: 100%;
    object-fit: contain;
    object-position: top center;
    pointer-events: none;
    position: relative;
    width: 100%;
    z-index: 0;
}

.play-battle-creature-spritewindow {
    height: 100%;
    margin-inline: auto;
    overflow: hidden;
    pointer-events: none;
    position: relative;
    z-index: 0;
}

.play-battle-creature-spritestrip {
    display: block;
    height: 100%;
    left: 0;
    max-width: none;
    position: absolute;
    top: 0;
    transform: translateX(0);
    width: auto;
}

/* Steps through the horizontal sprite strip once when the creature attacks,
   then reverts to the first (idle) frame. The `animation` shorthand (with the
   concrete frame count) is applied inline from Play.razor while attacking. */
@keyframes ms-battle-creature-sprite-attack {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-100%);
    }
}

.play-battle-creature-critical-flash {
    animation: ms-battle-creature-critical-flash 480ms ease-out both;
    display: block;
    filter: brightness(1.45) sepia(1) saturate(7) hue-rotate(-42deg) drop-shadow(0 0 18px rgba(255,0,0,0.74));
    height: 100%;
    inset: 0;
    mix-blend-mode: screen;
    object-fit: contain;
    object-position: top center;
    pointer-events: none;
    position: absolute;
    width: 100%;
    z-index: 1;
}

.play-battle-freeze-overlay {
    animation: ms-battle-player-freeze 1500ms ease-out both;
    border-radius: 8px;
    inset: 0;
    pointer-events: none;
    position: absolute;
    z-index: 4;
}

.play-battle-message-overlay {
    background: rgba(5,4,5,0.72);
    border-top: 1px solid rgba(255,154,104,0.32);
    bottom: 0;
    box-shadow: 0 -14px 30px rgba(0,0,0,0.36);
    left: 0;
    min-height: 82px;
    padding: 12px 14px;
    position: absolute;
    right: 0;
    z-index: 3;
}

.play-battle-message-line {
    color: rgba(255,245,235,0.92);
    line-height: 1.4;
    margin: 0 !important;
    text-shadow: 0 1px 5px rgba(0,0,0,0.82);
}

.play-battle-message-line-emphasis {
    color: rgb(248 83 102);
    font-weight: 800 !important;
}

.play-scene-missing {
    align-items: center;
    background: rgba(0,0,0,0.32);
    color: rgba(240,230,220,0.54);
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-content: center;
    padding: 18px;
    text-align: center;
}

.play-scene-hotspot-layer {
    inset: 0;
    position: absolute;
}

.play-scene-npc-layer {
    inset: 0;
    pointer-events: none;
    position: absolute;
    z-index: 2;
}

.play-scene-npc-marker {
    cursor: pointer;
    pointer-events: auto;
}

.play-scene-npc-marker:disabled {
    cursor: progress;
}

.play-scene-hotspot {
    align-items: center;
    background: rgba(255,69,0,0.25);
    border: 1px solid rgba(255,154,104,0.42);
    border-radius: 6px;
    color: rgba(255,245,235,0.94);
    cursor: pointer;
    display: flex;
    font-size: 0.72rem;
    font-weight: 700;
    justify-content: center;
    min-height: 22px;
    min-width: 22px;
    opacity: 0.6;
    overflow: hidden;
    padding: 0;
    position: absolute;
    text-align: center;
    text-shadow: 0 1px 5px rgba(0,0,0,0.82);
    transition: background-color 0.16s ease, border-color 0.16s ease, opacity 0.16s ease;
}

.play-scene-hotspot-icon {
    font-size: 1.35rem !important;
    filter: drop-shadow(0 1px 5px rgba(0,0,0,0.82));
    pointer-events: none;
}

.play-scene-hotspot:hover,
.play-scene-hotspot:focus-visible {
    background: rgba(255,69,0,0.3);
    border-color: rgba(255,245,235,0.92);
    opacity: 1;
    outline: none;
}

.play-scene-hotspot:disabled {
    cursor: progress;
}

.play-scene-event-hotspot {
    background: rgba(86,180,152,0.24);
    border-color: rgba(151,224,199,0.52);
}

.play-scene-event-hotspot:hover,
.play-scene-event-hotspot:focus-visible {
    background: rgba(86,180,152,0.34);
    border-color: rgba(229,255,244,0.92);
}

.play-player-summary,
.player-profile-title {
    align-items: center;
    display: flex;
    gap: 12px;
    min-width: 0;
}

.play-summary-avatar-shell {
    flex: 0 0 auto;
    position: relative;
}

.play-summary-avatar {
    align-items: center;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,69,0,0.28);
    border-radius: 999px;
    color: rgba(240,230,220,0.58);
    cursor: pointer;
    display: flex;
    height: 40px;
    justify-content: center;
    overflow: hidden;
    padding: 0;
    position: relative;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
    width: 40px;
}

.play-summary-avatar img {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.play-summary-avatar:hover,
.play-summary-avatar:focus-visible {
    border-color: rgba(255,154,104,0.86);
    box-shadow: 0 0 14px rgba(255,69,0,0.18);
    outline: none;
}

.play-summary-health-mini {
    background: rgba(4,4,4,0.82);
    border: 1px solid rgba(240,230,220,0.18);
    border-radius: 999px;
    bottom: 2px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.68);
    height: 5px;
    left: 6px;
    overflow: hidden;
    position: absolute;
    right: 6px;
}

.play-summary-health-mini-fill,
.play-summary-health-large-fill {
    display: block;
    height: 100%;
}

.play-summary-health-fill-healthy {
    background: linear-gradient(90deg, rgba(127,176,133,0.98), rgba(156,220,142,0.98));
}

.play-summary-health-fill-warning {
    background: linear-gradient(90deg, rgba(221,174,58,0.98), rgba(255,220,104,0.98));
}

.play-summary-health-fill-critical {
    background: linear-gradient(90deg, rgba(187,39,39,0.98), rgba(255,84,74,0.98));
}

.play-summary-health-popover {
    background: transparent !important;
    box-shadow: none !important;
}

.play-summary-health-popover-content {
    background: linear-gradient(180deg, rgba(12,10,12,0.98), rgba(22,9,17,0.98));
    border: 1px solid rgba(255,69,0,0.34);
    border-radius: 8px;
    box-shadow: 0 16px 36px rgba(0,0,0,0.48);
    max-width: calc(100vw - 24px);
    min-width: 150px;
    padding: 10px;
    position: relative;
}

.play-summary-health-popover-content::after {
    background: rgba(22,9,17,0.98);
    border-bottom: 1px solid rgba(255,69,0,0.34);
    border-right: 1px solid rgba(255,69,0,0.34);
    bottom: -5px;
    content: '';
    height: 10px;
    left: 15px;
    position: absolute;
    transform: rotate(45deg);
    width: 10px;
}

.play-summary-health-label {
    color: rgba(240,230,220,0.66);
    display: block;
    text-transform: uppercase;
}

.play-summary-health-large {
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(240,230,220,0.16);
    border-radius: 999px;
    height: 12px;
    margin-top: 7px;
    overflow: hidden;
}

.play-summary-health-value {
    color: var(--nav-ink);
    font-weight: 700 !important;
    margin-top: 6px !important;
}

.play-path-list,
.play-command-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.play-path-list .mud-button-root,
.play-command-grid .mud-button-root {
    border-radius: 6px !important;
    justify-content: flex-start !important;
    width: 100%;
}

.play-battle-music-control {
    align-items: center;
    border: 1px solid rgba(242,183,92,0.34);
    border-radius: 6px;
    display: flex;
    gap: 10px;
    min-height: 40px;
    padding: 0 10px 0 0;
    width: 100%;
}

.play-battle-music-control .mud-icon-button {
    border-radius: 6px !important;
    flex: 0 0 auto;
}

.play-battle-music-slider {
    flex: 1 1 auto;
    min-width: 0;
}

.player-profile-dialog-avatar {
    border: 1px solid rgba(255,69,0,0.34);
    border-radius: 999px;
    display: block;
    flex: 0 0 auto;
    height: 58px;
    object-fit: cover;
    width: 58px;
}

.player-profile-dialog-avatar-empty {
    align-items: center;
    background: rgba(0,0,0,0.3);
    color: rgba(240,230,220,0.54);
    display: flex;
    justify-content: center;
}

.player-profile-action-row {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: flex-start;
}

.player-profile-stat-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.player-profile-stat {
    background: rgba(0,0,0,0.22);
    border: 1px solid rgba(255,69,0,0.16);
    border-radius: 8px;
    padding: 10px 12px;
}

.player-profile-stat-fear {
    border-width: 2px;
}

.player-profile-stat-fear-calm {
    border-color: rgba(127,176,133,0.46);
}

.player-profile-stat-fear-shaken {
    border-color: rgba(255,203,107,0.58);
    box-shadow: inset 0 0 18px rgba(255,203,107,0.08);
}

.player-profile-stat-fear-panicked {
    border-color: rgba(255,126,74,0.72);
    box-shadow: inset 0 0 20px rgba(255,126,74,0.12);
}

.player-profile-stat-fear-terrified {
    border-color: rgba(255,59,59,0.88);
    box-shadow: inset 0 0 24px rgba(255,59,59,0.16), 0 0 16px rgba(255,59,59,0.16);
}

.player-profile-backstory {
    color: rgba(240,230,220,0.82);
    line-height: 1.66;
    margin-top: 8px !important;
    white-space: pre-line;
}

.player-journal-entry {
    background: rgba(0,0,0,0.22);
    border: 1px solid rgba(255,69,0,0.16);
    border-radius: 8px;
    padding: 12px;
}

.player-journal-entry-heading {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.player-journal-summary {
    color: rgba(240,230,220,0.86);
    line-height: 1.56;
    margin-top: 8px !important;
}

.player-journal-details {
    color: rgba(240,230,220,0.72);
    line-height: 1.62;
    margin-top: 8px !important;
    white-space: pre-line;
}

.npc-scene-overlay {
    background: linear-gradient(to top, rgba(8,4,2,0.96) 0%, rgba(12,6,3,0.88) 100%);
    border-top: 1px solid rgba(255,69,0,0.28);
    bottom: 0;
    box-sizing: border-box;
    left: 0;
    padding: 14px 16px 12px;
    position: absolute;
    right: 0;
    z-index: 20;
}

.npc-scene-overlay-portrait {
    border: 1px solid rgba(255,69,0,0.34);
    border-radius: 6px;
    display: block;
    float: left;
    height: 96px;
    margin-bottom: 8px;
    margin-right: 14px;
    object-fit: contain;
    width: 96px;
}

.npc-scene-overlay-portrait-empty {
    align-items: center;
    background: rgba(0,0,0,0.3);
    color: rgba(240,230,220,0.54);
    display: flex;
    justify-content: center;
}

.npc-scene-overlay-name {
    color: rgba(255,200,140,0.92);
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.npc-scene-overlay-clear {
    clear: both;
}

.npc-scene-overlay-message {
    color: rgba(240,230,220,0.88);
    font-size: 0.9rem;
    line-height: 1.66;
    margin: 0 0 12px;
    white-space: pre-line;
}

.npc-scene-overlay-dismiss {
    background: transparent;
    border: 1px solid rgba(255,69,0,0.38);
    border-radius: 4px;
    color: rgba(255,130,60,0.82);
    cursor: pointer;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    padding: 4px 14px;
    text-transform: uppercase;
    transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.npc-scene-overlay-dismiss:hover {
    background: rgba(255,69,0,0.12);
    border-color: rgba(255,69,0,0.6);
    color: rgba(255,160,90,0.96);
}

.tile-player-dialog-title {
    align-items: center;
    display: flex;
    gap: 14px;
    min-width: 0;
}

.tile-player-dialog-avatar {
    border: 1px solid rgba(255,69,0,0.34);
    border-radius: 8px;
    display: block;
    flex: 0 0 auto;
    height: 112px;
    object-fit: cover;
    width: 112px;
}

.tile-player-dialog-avatar-empty {
    align-items: center;
    background: rgba(0,0,0,0.3);
    color: rgba(240,230,220,0.54);
    display: flex;
    justify-content: center;
}

.tile-player-dialog-copy {
    min-width: 0;
}

.tile-presence-dialog-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: min(58dvh, 460px);
    overflow-y: auto;
    padding-right: 2px;
}

.tile-presence-dialog-list-row {
    align-items: center;
    background: rgba(0,0,0,0.22);
    border: 1px solid rgba(255,69,0,0.16);
    border-radius: 8px;
    color: var(--nav-ink);
    cursor: pointer;
    display: grid;
    gap: 10px;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    min-height: 54px;
    padding: 6px 10px 6px 6px;
    text-align: left;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
    width: 100%;
}

.tile-presence-dialog-list-row:hover,
.tile-presence-dialog-list-row:focus-visible {
    border-color: rgba(255,154,104,0.72);
    box-shadow: 0 0 14px rgba(255,69,0,0.12);
    outline: none;
}

.tile-presence-dialog-list-row-inactive {
    opacity: 0.58;
}

.tile-presence-dialog-list-avatar {
    border: 1px solid rgba(255,69,0,0.24);
    border-radius: 999px;
    display: block;
    height: 42px;
    object-fit: cover;
    width: 42px;
}

.tile-presence-dialog-list-avatar-empty {
    align-items: center;
    background: rgba(0,0,0,0.3);
    color: rgba(240,230,220,0.54);
    display: flex;
    justify-content: center;
}

.tile-presence-dialog-list-name {
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tile-presence-dialog-list-level {
    color: rgba(240,230,220,0.62);
    font-size: 0.78rem;
    white-space: nowrap;
}

@media (max-width: 959px) {
    .play-game-shell {
        grid-template-columns: 1fr;
    }

    .play-command-panel {
        max-height: none;
        overflow: visible;
    }

    .play-command-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .play-scene-stage,
    .play-scene-missing {
        max-height: calc(100dvh - var(--mud-appbar-height) - 176px);
        width: min(100%, calc(100dvh - var(--mud-appbar-height) - 176px));
    }
}

@media (max-width: 599px) {
    .play-onboarding-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .play-onboarding-header .mud-button-root,
    .island-intro-action {
        width: 100%;
    }

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

    .play-game-shell {
        gap: 10px;
        padding: 10px;
    }

    .play-scene-panel,
    .play-command-panel {
        padding: 10px;
    }

    .play-scene-header {
        align-items: flex-start;
    }

    .play-location-title {
        font-size: 1.15rem !important;
    }

    .play-location-description {
        font-size: 0.84rem;
    }

    .play-location-description-panel {
        max-width: calc(100vw - 42px);
        width: calc(100vw - 42px);
    }

    .play-journal-notification {
        align-items: flex-start;
        grid-template-columns: auto minmax(0, 1fr) auto;
        padding-right: 44px;
    }

    .play-journal-notification-action {
        grid-column: 1 / -1;
        justify-content: flex-start;
        width: 100%;
    }

    .play-journal-notification-close {
        position: absolute;
        right: 6px;
        top: 6px;
    }

    .play-avatar-button {
        height: 52px;
        width: 52px;
    }

    .play-scene-stage,
    .play-scene-missing {
        max-height: calc(100dvh - var(--mud-appbar-height) - 184px);
        width: min(100%, calc(100dvh - var(--mud-appbar-height) - 184px));
    }

    .play-command-grid,
    .player-profile-stat-grid {
        grid-template-columns: 1fr;
    }

    .tile-player-dialog-title {
        align-items: flex-start;
        flex-direction: column;
    }

    .tile-player-dialog-copy {
        width: 100%;
    }
}

/* ===== VIDEO EXTRACTOR (ADMIN) ===== */

.video-extractor-layout {
    align-items: start;
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(0, 1fr) var(--ve-drawer-width, 320px);
}

.video-extractor-main {
    min-width: 0;
}

.video-extractor-upload-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.video-extractor-meta {
    display: flex;
    flex-direction: column;
}

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

.video-extractor-stage-row {
    align-items: start;
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
}

.video-extractor-tools-panel {
    align-self: start;
}

.video-extractor-key-row {
    align-items: center;
    display: flex;
    gap: 8px;
}

.video-extractor-key-swatch {
    background-image: linear-gradient(45deg, #555 25%, transparent 25%),
        linear-gradient(-45deg, #555 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #555 75%),
        linear-gradient(-45deg, transparent 75%, #555 75%);
    background-size: 10px 10px;
    background-position: 0 0, 0 5px, 5px -5px, -5px 0;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    flex: 0 0 auto;
    height: 28px;
    width: 28px;
}

.video-extractor-stage-header {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 8px;
}

.video-extractor-zoom {
    align-items: center;
    display: flex;
    gap: 8px;
}

.video-extractor-zoom-slider {
    width: 150px;
}

.video-extractor-zoom-value {
    min-width: 42px;
    text-align: right;
}

.video-extractor-stage {
    /* "safe" centering keeps the top/left reachable when zoomed past the frame. */
    align-items: safe center;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    display: flex;
    justify-content: safe center;
    max-height: 75vh;
    min-height: 360px;
    overflow: auto;
    position: relative;
}

.video-extractor-stage-eyedrop,
.video-extractor-stage-eyedrop .video-extractor-stage-image {
    cursor: crosshair;
}

.video-extractor-stage-image {
    /* Checkerboard shows through transparent (chroma-keyed) pixels. */
    background-image: linear-gradient(45deg, #2a2a2a 25%, transparent 25%),
        linear-gradient(-45deg, #2a2a2a 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #2a2a2a 75%),
        linear-gradient(-45deg, transparent 75%, #2a2a2a 75%);
    background-size: 18px 18px;
    background-position: 0 0, 0 9px, 9px -9px, -9px 0;
}

.video-extractor-stage-image {
    display: block;
    flex: 0 0 auto;
    height: auto;
    width: calc(var(--ve-zoom, 1) * 100%);
}

.video-extractor-stage-image:not([src]) {
    display: none;
}

.video-extractor-stage-empty {
    align-items: center;
    color: rgba(255, 255, 255, 0.45);
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: absolute;
}

.video-extractor-drawer {
    max-height: calc(100dvh - var(--mud-appbar-height) - 64px);
    overflow-y: auto;
    position: sticky;
    top: calc(var(--mud-appbar-height) + 16px);
}

.video-extractor-resize-handle {
    bottom: 0;
    cursor: col-resize;
    left: 0;
    position: absolute;
    top: 0;
    touch-action: none;
    width: 10px;
    z-index: 2;
}

.video-extractor-resize-handle::before {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 2px;
    content: "";
    height: 42px;
    left: 3px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    transition: background 0.15s ease;
    width: 4px;
}

.video-extractor-resize-handle:hover::before {
    background: var(--mud-palette-primary, #90caf9);
}

.video-extractor-thumb-size {
    align-items: center;
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.video-extractor-thumb-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ve-thumb {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    cursor: pointer;
    display: block;
    flex: 0 0 auto;
    max-width: 100%;
    overflow: hidden;
    padding: 0;
    position: relative;
    transition: border-color 0.15s ease, transform 0.15s ease;
    width: var(--ve-thumb-size, 200px);
}

.ve-thumb:hover {
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.ve-thumb-selected {
    border-color: var(--mud-palette-secondary, #ce93d8);
}

.ve-thumb img {
    display: block;
    height: auto;
    width: 100%;
}

.ve-thumb-label {
    background: rgba(0, 0, 0, 0.6);
    border-radius: 4px;
    bottom: 4px;
    color: #fff;
    font-size: 0.7rem;
    left: 4px;
    padding: 1px 6px;
    position: absolute;
}

.ve-thumb-add {
    align-items: center;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    color: #fff;
    display: flex;
    font-size: 1.1rem;
    font-weight: 700;
    height: 22px;
    justify-content: center;
    line-height: 1;
    opacity: 0;
    position: absolute;
    right: 4px;
    top: 4px;
    transition: opacity 0.15s ease, background 0.15s ease;
    width: 22px;
}

.ve-thumb:hover .ve-thumb-add {
    opacity: 1;
}

.ve-thumb-add:hover {
    background: var(--mud-palette-secondary, #ce93d8);
}

/* ----- Sprite sheet timeline ----- */

.video-extractor-timeline-panel {
    margin-top: 16px;
}

.video-extractor-timeline-header {
    align-items: flex-start;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 12px;
}

.video-extractor-timeline-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.video-extractor-columns-field {
    max-width: 180px;
}

.video-extractor-duration-field {
    max-width: 130px;
}

.video-extractor-download-options {
    align-items: center;
    display: flex;
    flex-direction: column;
}

.video-extractor-preview {
    display: none;
}

.video-extractor-preview-active {
    align-items: center;
    background-color: rgba(0, 0, 0, 0.35);
    background-image: linear-gradient(45deg, #2a2a2a 25%, transparent 25%),
        linear-gradient(-45deg, #2a2a2a 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #2a2a2a 75%),
        linear-gradient(-45deg, transparent 75%, #2a2a2a 75%);
    background-size: 18px 18px;
    background-position: 0 0, 0 9px, 9px -9px, -9px 0;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
    max-height: 50vh;
    min-height: 200px;
    overflow: hidden;
    padding: 10px;
}

.video-extractor-preview-image {
    display: block;
    max-height: 46vh;
    max-width: 100%;
    object-fit: contain;
}

.video-extractor-timeline-list {
    align-items: stretch;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    display: flex;
    gap: 8px;
    min-height: 110px;
    overflow-x: auto;
    padding: 10px;
}

.ve-timeline-item {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    cursor: grab;
    flex: 0 0 auto;
    overflow: hidden;
    position: relative;
}

.ve-timeline-item:active {
    cursor: grabbing;
}

.ve-timeline-item img {
    display: block;
    height: 88px;
    width: auto;
}

.ve-timeline-label {
    background: rgba(0, 0, 0, 0.6);
    border-radius: 4px;
    bottom: 4px;
    color: #fff;
    font-size: 0.65rem;
    left: 4px;
    padding: 1px 5px;
    position: absolute;
}

.ve-timeline-remove {
    align-items: center;
    background: rgba(0, 0, 0, 0.65);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    font-size: 1rem;
    height: 20px;
    justify-content: center;
    line-height: 1;
    padding: 0;
    position: absolute;
    right: 4px;
    top: 4px;
    width: 20px;
}

.ve-timeline-remove:hover {
    background: #c62828;
}

.video-extractor-css-hint {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 4px;
    font-size: 0.75rem;
    margin: 8px 0 0;
    overflow-x: auto;
    padding: 8px 10px;
    white-space: pre;
}

@media (max-width: 959px) {
    .video-extractor-layout {
        grid-template-columns: 1fr;
    }

    .video-extractor-stage-row {
        grid-template-columns: 1fr;
    }

    .video-extractor-drawer {
        max-height: none;
        position: static;
    }

    /* The drag-to-resize handle only makes sense in the side-by-side layout. */
    .video-extractor-resize-handle {
        display: none;
    }
}
