:root {
    --bg: #020202;
    --red: #ff1212;
    --red-soft: #8f0808;
    --red-dim: #390202;
    --panel: rgba(30, 0, 0, 0.76);
    --panel-dark: rgba(8, 0, 0, 0.94);
    --text: #ffe5e5;
    --muted: #b76464;
    --line: rgba(255, 18, 18, 0.72);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    overflow-x: hidden;
    background:
        radial-gradient(circle at center, rgba(90, 0, 0, 0.18), transparent 38%),
        linear-gradient(180deg, #050000 0%, var(--bg) 58%, #000 100%);
    color: var(--text);
    font-family: "Courier New", Courier, monospace;
    letter-spacing: 0;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        repeating-linear-gradient(
            180deg,
            rgba(255, 18, 18, 0.045) 0,
            rgba(255, 18, 18, 0.045) 1px,
            transparent 1px,
            transparent 12px
        );
    opacity: 0.52;
    mix-blend-mode: screen;
}

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

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

.mask-stage {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.interface-layout {
    width: min(860px, 100%);
    display: grid;
    gap: 20px;
    align-items: center;
}

.interface-layout.has-images {
    width: min(1260px, 100%);
    grid-template-columns: minmax(0, 860px) minmax(300px, 380px);
}

.data-field {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    opacity: 0.72;
    mask-image: radial-gradient(circle at center, transparent 0 18%, #000 44%, #000 100%);
}

.data-field span {
    position: absolute;
    top: -42vh;
    width: 230px;
    color: rgba(255, 42, 42, 0.46);
    font-size: 11px;
    line-height: 1.6;
    white-space: pre;
    text-shadow: 0 0 12px rgba(255, 18, 18, 0.50);
    animation: data-fall linear infinite;
}

.session-bar {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.session-bar a,
.session-bar span {
    display: inline-grid;
    place-items: center;
    min-height: 31px;
    padding: 0 10px;
    color: var(--red);
    background: rgba(0, 0, 0, 0.72);
    border: 1px solid rgba(255, 18, 18, 0.58);
    text-decoration: none;
    box-shadow: 0 0 14px rgba(255, 18, 18, 0.16);
}

.session-bar span {
    color: var(--muted);
    border-color: rgba(183, 100, 100, 0.34);
}

.session-bar a:hover {
    border-color: var(--red);
    box-shadow: 0 0 18px rgba(255, 18, 18, 0.26);
}

.mask-panel {
    position: relative;
    z-index: 1;
    width: min(860px, 100%);
    min-height: 430px;
    padding: 40px 52px 38px;
    background:
        linear-gradient(90deg, transparent 0 5%, rgba(255, 18, 18, 0.10) 5% 5.6%, transparent 5.6% 94.4%, rgba(255, 18, 18, 0.10) 94.4% 95%, transparent 95%),
        linear-gradient(135deg, rgba(255, 18, 18, 0.12), rgba(25, 0, 0, 0.86) 42%, rgba(5, 0, 0, 0.96));
    border: 1px solid var(--line);
    box-shadow:
        0 0 0 1px rgba(255, 18, 18, 0.18),
        0 0 34px rgba(255, 18, 18, 0.24),
        inset 0 0 34px rgba(255, 18, 18, 0.12);
    clip-path: polygon(7% 0, 93% 0, 100% 30%, 100% 70%, 93% 100%, 7% 100%, 0 70%, 0 30%);
}

.interface-layout .mask-panel {
    width: 100%;
}

.mask-panel::before,
.mask-panel::after {
    content: "";
    position: absolute;
    pointer-events: none;
    border: 1px solid rgba(255, 18, 18, 0.45);
}

.mask-panel::before {
    inset: 11px 24px;
    clip-path: polygon(6% 0, 94% 0, 100% 34%, 100% 66%, 94% 100%, 6% 100%, 0 66%, 0 34%);
}

.mask-panel::after {
    inset: -16px 84px;
    border-left: 0;
    border-right: 0;
    opacity: 0.75;
}

.hud-rail {
    position: absolute;
    left: 27%;
    right: 27%;
    height: 5px;
    background:
        repeating-linear-gradient(90deg, var(--red) 0 3px, transparent 3px 8px),
        linear-gradient(90deg, transparent, rgba(255, 18, 18, 0.95), transparent);
    pointer-events: none;
}

.hud-rail-top {
    top: 17px;
}

.hud-rail-bottom {
    bottom: 17px;
}

.mask-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-bottom: 30px;
}

.mask-header h1 {
    margin: 0;
    color: var(--red);
    font-size: 25px;
    font-weight: 700;
    text-transform: uppercase;
    text-shadow: 0 0 16px rgba(255, 18, 18, 0.72);
}

.signal-dot {
    width: 6px;
    height: 6px;
    background: var(--red);
    box-shadow: 0 0 12px var(--red);
}

.phrase-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: stretch;
}

.phrase-form input,
.admin-field input,
.admin-field textarea,
.admin-field select {
    width: 100%;
    min-height: 46px;
    color: var(--text);
    background: rgba(0, 0, 0, 0.78);
    border: 1px solid rgba(255, 18, 18, 0.68);
    border-radius: 0;
    outline: none;
    padding: 12px 14px;
    box-shadow: inset 0 0 18px rgba(255, 18, 18, 0.12);
}

.phrase-form input:focus,
.admin-field input:focus,
.admin-field textarea:focus,
.admin-field select:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 1px rgba(255, 18, 18, 0.34), inset 0 0 24px rgba(255, 18, 18, 0.16);
}

.phrase-form button,
.admin-button,
.admin-link-button {
    min-height: 46px;
    color: #120000;
    background: var(--red);
    border: 1px solid var(--red);
    border-radius: 0;
    padding: 0 18px;
    cursor: pointer;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: 0 0 18px rgba(255, 18, 18, 0.34);
}

.phrase-form button:hover,
.admin-button:hover,
.admin-link-button:hover {
    background: #ff3a3a;
}

.phrase-form.submitting {
    opacity: 0.72;
}

.mask-visual {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 18px;
    align-items: stretch;
    margin-top: 22px;
}

.mask-image-frame,
.mask-status {
    position: relative;
    min-height: 190px;
    background:
        linear-gradient(135deg, rgba(255, 18, 18, 0.10), rgba(0, 0, 0, 0.76)),
        rgba(0, 0, 0, 0.48);
    border: 1px solid rgba(255, 18, 18, 0.42);
    box-shadow:
        inset 0 0 24px rgba(255, 18, 18, 0.10),
        0 0 20px rgba(255, 18, 18, 0.10);
    overflow: hidden;
}

.mask-image-frame {
    display: grid;
    place-items: center;
    padding: 8px;
    clip-path: polygon(9% 0, 91% 0, 100% 16%, 100% 84%, 91% 100%, 9% 100%, 0 84%, 0 16%);
}

.mask-image-frame::after,
.mask-status::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        repeating-linear-gradient(180deg, transparent 0 9px, rgba(255, 18, 18, 0.10) 9px 10px),
        linear-gradient(90deg, transparent, rgba(255, 18, 18, 0.12), transparent);
    opacity: 0.42;
}

.mask-image-frame img {
    width: min(100%, 185px);
    aspect-ratio: 1;
    object-fit: cover;
    filter: saturate(0.92) contrast(1.08) drop-shadow(0 0 18px rgba(255, 18, 18, 0.52));
}

.mask-status {
    display: grid;
    align-content: start;
    gap: 14px;
    padding: 16px;
    clip-path: polygon(4% 0, 96% 0, 100% 10%, 100% 90%, 96% 100%, 4% 100%, 0 90%, 0 10%);
}

.status-heading {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    color: var(--red);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    text-shadow: 0 0 12px rgba(255, 18, 18, 0.58);
}

.status-pulse {
    color: #120000;
    background: var(--red);
    padding: 2px 7px;
    box-shadow: 0 0 14px rgba(255, 18, 18, 0.42);
    animation: status-blink 1.8s steps(2, end) infinite;
}

.log-result {
    position: relative;
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid rgba(255, 18, 18, 0.48);
}

.saved-logs {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 18, 18, 0.32);
}

.saved-logs-title,
.progress-note {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.progress-note {
    margin-top: 14px;
}

.saved-log-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.saved-log-button {
    min-height: 32px;
    color: var(--red);
    background: rgba(0, 0, 0, 0.54);
    border: 1px solid rgba(255, 18, 18, 0.46);
    padding: 0 10px;
    cursor: pointer;
    text-transform: uppercase;
}

.saved-log-button:hover {
    border-color: var(--red);
}

.log-title-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
}

.log-title-copy {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.close-file {
    min-height: 32px;
    color: var(--red);
    background: rgba(0, 0, 0, 0.58);
    border: 1px solid rgba(255, 18, 18, 0.50);
    border-radius: 0;
    padding: 0 10px;
    cursor: pointer;
    font-size: 12px;
    text-transform: uppercase;
    box-shadow: inset 0 0 14px rgba(255, 18, 18, 0.10);
}

.close-file:hover {
    border-color: var(--red);
    box-shadow: 0 0 16px rgba(255, 18, 18, 0.20), inset 0 0 16px rgba(255, 18, 18, 0.16);
}

.log-result.log-entering {
    animation: log-panel-in 460ms steps(5, end);
}

.log-result.log-closing {
    animation: log-panel-out 280ms steps(3, end) forwards;
    pointer-events: none;
}

.log-result.log-entering,
.log-result.log-closing,
.image-window.image-entering,
.image-window.image-closing,
.wave-player.wave-entering {
    backface-visibility: hidden;
    transform: translateZ(0);
    will-change: transform, opacity;
}

.log-state,
.admin-kicker {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.log-result h2 {
    margin: 0;
    color: var(--red);
    font-size: 20px;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

.log-result p {
    margin: 16px 0 18px;
    color: var(--text);
    line-height: 1.55;
    white-space: pre-wrap;
}

.log-result p.typing::after {
    content: "";
    display: inline-block;
    width: 9px;
    height: 1em;
    margin-left: 4px;
    vertical-align: -2px;
    background: var(--red);
    box-shadow: 0 0 10px rgba(255, 18, 18, 0.58);
    animation: typing-cursor 760ms steps(2, end) infinite;
}

.native-audio {
    display: none;
}

.wave-player {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) 92px;
    gap: 12px;
    align-items: center;
    margin-top: 18px;
    padding: 12px;
    background:
        linear-gradient(90deg, rgba(255, 18, 18, 0.08), rgba(0, 0, 0, 0.62)),
        rgba(0, 0, 0, 0.52);
    border: 1px solid rgba(255, 18, 18, 0.42);
    box-shadow:
        inset 0 0 22px rgba(255, 18, 18, 0.10),
        0 0 18px rgba(255, 18, 18, 0.12);
}

.wave-player[hidden] {
    display: none;
}

.wave-player.wave-entering {
    animation: wave-panel-in 420ms steps(5, end);
}

.wave-play,
.wave-surface {
    border-radius: 0;
    cursor: pointer;
}

.wave-play {
    position: relative;
    width: 46px;
    height: 46px;
    padding: 0;
    background: rgba(255, 18, 18, 0.92);
    border: 1px solid var(--red);
    box-shadow: 0 0 16px rgba(255, 18, 18, 0.35);
}

.wave-play:hover {
    background: #ff3a3a;
}

.play-icon {
    position: absolute;
    left: 18px;
    top: 13px;
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 15px solid #130000;
}

.wave-play.is-playing .play-icon {
    left: 14px;
    top: 13px;
    width: 18px;
    height: 20px;
    border: 0;
    background:
        linear-gradient(90deg, #130000 0 6px, transparent 6px 12px, #130000 12px 18px);
}

.wave-surface {
    min-width: 0;
    height: 74px;
    padding: 0;
    background: rgba(0, 0, 0, 0.62);
    border: 1px solid rgba(255, 18, 18, 0.30);
    overflow: hidden;
}

.wave-surface:hover {
    border-color: rgba(255, 18, 18, 0.62);
}

.wave-surface canvas {
    display: block;
    width: 100%;
    height: 74px;
}

.wave-time {
    display: grid;
    gap: 8px;
    justify-items: end;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.wave-time span:first-child {
    color: var(--text);
    text-shadow: 0 0 10px rgba(255, 18, 18, 0.34);
}

.image-window {
    position: relative;
    min-height: 430px;
    padding: 22px;
    background:
        linear-gradient(135deg, rgba(255, 18, 18, 0.08), rgba(0, 0, 0, 0.86)),
        rgba(0, 0, 0, 0.68);
    border: 1px solid rgba(255, 18, 18, 0.54);
    box-shadow:
        0 0 0 1px rgba(255, 18, 18, 0.12),
        0 0 30px rgba(255, 18, 18, 0.18),
        inset 0 0 30px rgba(255, 18, 18, 0.10);
    clip-path: polygon(5% 0, 100% 0, 100% 88%, 92% 100%, 0 100%, 0 12%);
    overflow: hidden;
}

.image-window[hidden] {
    display: none;
}

.image-window::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        repeating-linear-gradient(180deg, transparent 0 10px, rgba(255, 18, 18, 0.10) 10px 11px),
        linear-gradient(90deg, rgba(255, 18, 18, 0.08), transparent 30%, transparent 70%, rgba(255, 18, 18, 0.12));
    opacity: 0.48;
}

.image-window.image-entering {
    animation: image-panel-in 520ms steps(5, end);
}

.image-window.image-closing {
    animation: image-panel-out 280ms steps(3, end) forwards;
    pointer-events: none;
}

.image-window.corrupted:not(.image-entering):not(.image-closing) {
    animation: image-window-glitch 1.4s steps(3, end) infinite;
}

.image-window-heading {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--red);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    text-shadow: 0 0 12px rgba(255, 18, 18, 0.58);
    margin-bottom: 16px;
}

.image-viewer {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 255px;
    background: rgba(0, 0, 0, 0.62);
    border: 1px solid rgba(255, 18, 18, 0.30);
    overflow: hidden;
}

.image-viewer img {
    display: block;
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    filter: saturate(0.95) contrast(1.06) drop-shadow(0 0 12px rgba(255, 18, 18, 0.24));
}

.image-window.corrupted:not(.image-entering):not(.image-closing) .image-viewer img {
    animation: image-glitch 900ms steps(2, end) infinite;
}

.image-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.image-tabs button {
    min-height: 30px;
    color: var(--muted);
    background: rgba(0, 0, 0, 0.52);
    border: 1px solid rgba(255, 18, 18, 0.34);
    padding: 0 9px;
    cursor: pointer;
    text-transform: uppercase;
    font-size: 12px;
}

.image-tabs button.active,
.image-tabs button:hover {
    color: var(--red);
    border-color: var(--red);
}

.mask-panel.glitching {
    animation: panel-glitch 520ms steps(2, end);
}

.mask-panel.corrupted {
    animation: corrupted-pulse 1.8s steps(4, end) infinite;
}

.mask-panel.corrupted .log-result {
    text-shadow: 1px 0 rgba(255, 18, 18, 0.9), -1px 0 rgba(255, 255, 255, 0.18);
}

.mask-panel.corrupted .log-result::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        repeating-linear-gradient(90deg, transparent 0 12px, rgba(255, 18, 18, 0.13) 12px 14px),
        repeating-linear-gradient(180deg, transparent 0 5px, rgba(255, 18, 18, 0.12) 5px 6px);
    opacity: 0.32;
    animation: static-drift 620ms steps(3, end) infinite;
}

@keyframes log-panel-in {
    0% {
        opacity: 0;
        transform: translateY(14px) scaleY(0.92);
        filter: brightness(1.9);
    }
    18% {
        opacity: 1;
        transform: translate(-5px, 8px) scaleY(1.02);
        filter: brightness(0.72);
    }
    36% {
        transform: translate(4px, 4px);
        filter: brightness(1.45);
    }
    100% {
        opacity: 1;
        transform: translate(0, 0) scaleY(1);
        filter: brightness(1);
    }
}

@keyframes log-panel-out {
    0% {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
    32% {
        opacity: 0.82;
        transform: translate3d(4px, -2px, 0);
    }
    100% {
        opacity: 0;
        transform: translate3d(0, 10px, 0) scaleY(0.96);
    }
}

@keyframes wave-panel-in {
    0% {
        opacity: 0;
        transform: translateY(10px) scaleX(0.94);
        filter: brightness(1.8);
    }
    40% {
        opacity: 1;
        transform: translate(-2px, 3px) scaleX(1.01);
        filter: brightness(0.78);
    }
    100% {
        opacity: 1;
        transform: translate(0, 0) scaleX(1);
        filter: brightness(1);
    }
}

@keyframes image-panel-in {
    0% {
        opacity: 0;
        transform: translateX(28px) scaleX(0.92);
        filter: brightness(1.8);
    }
    18% {
        opacity: 1;
        transform: translateX(-5px) scaleX(1.02);
        filter: brightness(0.72);
    }
    44% {
        transform: translateX(3px);
        filter: brightness(1.35);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scaleX(1);
        filter: brightness(1);
    }
}

@keyframes image-panel-out {
    0% {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
    30% {
        opacity: 0.84;
        transform: translate3d(-4px, 0, 0);
    }
    100% {
        opacity: 0;
        transform: translate3d(24px, 0, 0) scaleX(0.96);
    }
}

@keyframes typing-cursor {
    0%, 58% { opacity: 1; }
    59%, 100% { opacity: 0; }
}

@keyframes panel-glitch {
    0% { transform: translateX(0); filter: brightness(1); }
    18% { transform: translateX(-6px); filter: brightness(1.5); }
    36% { transform: translateX(7px); filter: brightness(0.7); }
    54% { transform: translateX(-3px); filter: brightness(1.3); }
    72% { transform: translateX(4px); filter: brightness(0.8); }
    100% { transform: translateX(0); filter: brightness(1); }
}

@keyframes corrupted-pulse {
    0%, 100% { filter: brightness(1); }
    30% { filter: brightness(1.2); }
    44% { transform: translateX(1px); }
    48% { transform: translateX(-1px); }
    52% { transform: translateX(0); }
}

@keyframes static-drift {
    0% { transform: translate(0, 0); opacity: 0.22; }
    50% { transform: translate(2px, -1px); opacity: 0.36; }
    100% { transform: translate(-1px, 1px); opacity: 0.28; }
}

@keyframes data-fall {
    0% { transform: translateY(-20vh); opacity: 0; }
    14% { opacity: 0.55; }
    84% { opacity: 0.38; }
    100% { transform: translateY(145vh); opacity: 0; }
}

@keyframes status-blink {
    0%, 70% { opacity: 1; }
    71%, 100% { opacity: 0.62; }
}

@keyframes image-window-glitch {
    0%, 100% { transform: translate(0, 0); filter: brightness(1); }
    42% { transform: translate(1px, 0); filter: brightness(1.12); }
    46% { transform: translate(-2px, 1px); filter: brightness(0.86); }
    50% { transform: translate(0, 0); filter: brightness(1); }
}

@keyframes image-glitch {
    0%, 100% { transform: translate(0, 0); opacity: 1; }
    44% { transform: translate(2px, -1px); opacity: 0.86; }
    48% { transform: translate(-2px, 1px); opacity: 1; }
}

.admin-screen .mask-stage {
    align-items: start;
    padding-top: 42px;
    padding-bottom: 42px;
}

.admin-shell {
    width: min(1040px, 100%);
}

.admin-panel {
    width: 100%;
    clip-path: polygon(3% 0, 97% 0, 100% 12%, 100% 88%, 97% 100%, 3% 100%, 0 88%, 0 12%);
}

.admin-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 26px;
}

.admin-top h1,
.admin-form h2 {
    margin: 0;
    color: var(--red);
    text-transform: uppercase;
}

.admin-top h1 {
    font-size: 24px;
}

.admin-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-nav a,
.admin-inline-link {
    color: var(--red);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 18, 18, 0.45);
}

.admin-nav a:hover,
.admin-inline-link:hover {
    border-bottom-color: var(--red);
}

.admin-grid {
    display: grid;
    gap: 20px;
}

.admin-form {
    display: grid;
    gap: 16px;
}

.admin-field {
    display: grid;
    gap: 8px;
}

.admin-field label,
.admin-check label {
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
}

.admin-field textarea {
    min-height: 150px;
    resize: vertical;
    line-height: 1.5;
}

.admin-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}

.admin-check {
    display: flex;
    align-items: center;
    gap: 9px;
}

.admin-check input {
    accent-color: var(--red);
}

.admin-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.admin-link-button {
    display: inline-grid;
    place-items: center;
    min-height: 38px;
    text-decoration: none;
}

.admin-table-wrap {
    overflow-x: auto;
    border-top: 1px solid rgba(255, 18, 18, 0.42);
}

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

.admin-table th,
.admin-table td {
    padding: 14px 10px;
    border-bottom: 1px solid rgba(255, 18, 18, 0.25);
    text-align: left;
    vertical-align: top;
}

.admin-table th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.admin-table td {
    color: var(--text);
}

.badge {
    display: inline-block;
    padding: 3px 7px;
    color: var(--red);
    border: 1px solid rgba(255, 18, 18, 0.55);
    font-size: 12px;
    text-transform: uppercase;
}

.badge.muted {
    color: var(--muted);
    border-color: rgba(183, 100, 100, 0.42);
}

.flash {
    padding: 12px 14px;
    margin-bottom: 18px;
    border: 1px solid rgba(255, 18, 18, 0.55);
    background: rgba(255, 18, 18, 0.08);
    color: var(--text);
}

.flash.error {
    background: rgba(255, 18, 18, 0.15);
}

.delete-button {
    color: var(--red);
    background: transparent;
    border: 1px solid rgba(255, 18, 18, 0.55);
    padding: 7px 10px;
    cursor: pointer;
}

.delete-button:hover {
    border-color: var(--red);
}

.login-panel {
    text-align: center;
}

.login-panel p {
    margin: 0 0 22px;
    color: var(--muted);
}

.attached-images {
    display: grid;
    gap: 10px;
}

.attached-image-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.remove-image-check {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.compact-textarea {
    min-height: 76px !important;
}

.admin-split {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
    gap: 20px;
}

.compact-table {
    min-width: 540px;
}

.selected-row {
    background: rgba(255, 18, 18, 0.08);
}

.user-detail-panel {
    padding: 16px;
    border: 1px solid rgba(255, 18, 18, 0.34);
    background: rgba(0, 0, 0, 0.48);
}

.user-detail-panel h2 {
    margin: 4px 0 16px;
    color: var(--red);
    font-size: 19px;
    overflow-wrap: anywhere;
}

.user-detail-panel p {
    margin: 0;
    color: var(--muted);
}

.unlock-list {
    display: grid;
    gap: 10px;
}

.unlock-row {
    display: grid;
    gap: 5px;
    padding: 10px;
    border: 1px solid rgba(255, 18, 18, 0.24);
    background: rgba(0, 0, 0, 0.44);
}

.unlock-row strong {
    color: var(--text);
}

.unlock-row span {
    color: var(--muted);
    font-size: 12px;
}

.settings-panel {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
}

.settings-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.52);
    border: 1px solid rgba(255, 18, 18, 0.25);
}

.settings-row span {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.settings-row strong {
    color: var(--text);
    font-size: 14px;
    overflow-wrap: anywhere;
}

.settings-reset {
    border-top: 1px solid rgba(255, 18, 18, 0.32);
    padding-top: 16px;
}

@media (max-width: 680px) {
    .mask-stage {
        padding: 16px;
    }

    .mask-panel {
        min-height: auto;
        padding: 32px 22px 28px;
        clip-path: polygon(9% 0, 91% 0, 100% 24%, 100% 76%, 91% 100%, 9% 100%, 0 76%, 0 24%);
    }

    .interface-layout,
    .interface-layout.has-images {
        width: 100%;
        grid-template-columns: 1fr;
    }

    .image-window {
        min-height: 0;
        padding: 18px;
    }

    .image-viewer {
        min-height: 210px;
    }

    .mask-panel::before {
        inset: 10px 14px;
    }

    .mask-header {
        gap: 12px;
        margin-bottom: 24px;
    }

    .mask-header h1 {
        font-size: 20px;
        text-align: center;
    }

    .phrase-form {
        grid-template-columns: 1fr;
    }

    .mask-visual {
        grid-template-columns: 1fr;
    }

    .mask-image-frame {
        min-height: 170px;
    }

    .mask-status {
        min-height: 0;
    }

    .log-title-row {
        grid-template-columns: 1fr;
    }

    .close-file {
        justify-self: start;
    }

    .wave-player {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .wave-play {
        width: 42px;
        height: 42px;
    }

    .wave-time {
        grid-column: 1 / -1;
        grid-template-columns: 1fr auto;
        justify-items: stretch;
    }

    .session-bar {
        position: static;
        justify-content: center;
        flex-wrap: wrap;
        padding: 12px 12px 0;
    }

    .admin-top {
        align-items: flex-start;
        flex-direction: column;
    }

    .attached-image-row,
    .admin-split {
        grid-template-columns: 1fr;
    }
}
