/* ═══════════════════════════════════════════════
   CASTLE BREACH — style.css
   Orange-Red-Black Arcade / CRT Theme
════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&display=swap');

/* ── CSS Variables ── */
:root {
    --orange: #ff4400;
    --orange-bright: #ff8800;
    --orange-dim: #cc2200;
    --orange-dark: #660000;
    --orange-glow: rgba(255, 68, 0, 0.4);
    --yellow: #ffcc00;
    --black: #0d0500;
    --black-mid: #1a0800;
    --black-light: #2a1000;
    --red-err: #ff2200;
    --font-pixel: 'Press Start 2P', monospace;
    --font-vt: 'VT323', monospace;
}

/* ── Reset ── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    width: 100%;
    height: 100%;
    background: var(--black);
    overflow: hidden;
    font-family: var(--font-pixel);
}

/* ═══════════════════════════════════════════════
   SCREEN SYSTEM
════════════════════════════════════════════════ */
.screen {
    position: fixed;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--black);
    overflow: hidden;
}

.screen.active {
    display: flex;
}

/* ═══════════════════════════════════════════════
   CRT EFFECTS
════════════════════════════════════════════════ */
.crt-scanlines {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(0deg, transparent, transparent 2px,
            rgba(0, 0, 0, 0.20) 2px, rgba(0, 0, 0, 0.20) 4px);
    pointer-events: none;
    z-index: 100;
}

.crt-vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.88) 100%);
    pointer-events: none;
    z-index: 99;
}

.bg-grid {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image:
        linear-gradient(rgba(200, 60, 0, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(200, 60, 0, 0.04) 1px, transparent 1px);
    background-size: 28px 28px;
}

/* ── Twinkling stars ── */
.stars {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
}

.star {
    position: absolute;
    border-radius: 50%;
    opacity: 0;
    animation: twinkle var(--d) ease-in-out infinite var(--delay);
}

@keyframes twinkle {
    0%, 100% { opacity: 0 }
    50%       { opacity: 0.8 }
}

/* Ember glow from bottom */
#screen-start {
    background:
        radial-gradient(ellipse 70% 35% at 50% 100%, rgba(160, 40, 0, 0.22) 0%, transparent 70%),
        linear-gradient(180deg, var(--black) 0%, #1a0800 70%, #220c00 100%);
}

/* ═══════════════════════════════════════════════
   START SCREEN
════════════════════════════════════════════════ */
.start-content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 680px;
    padding: 20px;
}

/* Insert coin */
.insert-coin {
    font-size: 9px;
    color: var(--orange-bright);
    letter-spacing: 3px;
    margin-bottom: 16px;
    animation: blink 1s step-end infinite;
    text-shadow: 0 0 8px var(--orange);
}

/* ── Pixel castle ── */
.castle-art {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 12px;
    image-rendering: pixelated;
}

.castle-row { display: flex; }

.px {
    width: 6px;
    height: 6px;
    display: inline-block;
    flex-shrink: 0;
}

/* ── Title ── */
.title-wrap {
    text-align: center;
    margin-bottom: 12px;
}

.title-main {
    font-size: clamp(18px, 4vw, 30px);
    color: var(--orange);
    text-shadow: 0 0 6px var(--orange), 0 0 18px var(--orange-dim),
        0 0 36px #880000, 3px 3px 0 #1a0000;
    letter-spacing: 4px;
    display: block;
    line-height: 1.3;
    animation: flicker 5s infinite;
}

.title-sub {
    font-family: var(--font-vt);
    font-size: clamp(20px, 3.5vw, 28px);
    color: var(--orange-bright);
    text-shadow: 0 0 8px #ff6600, 0 0 20px #cc4400;
    letter-spacing: 3px;
    display: block;
    margin-top: 5px;
    animation: pulse-orange 2.5s ease-in-out infinite;
}

/* ── Score bar ── */
.score-bar {
    display: flex;
    gap: 24px;
    margin: 12px 0;
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.score-label {
    color: #cc4400;
    font-size: 7px;
    letter-spacing: 1px;
}

.score-val {
    color: var(--orange-bright);
    font-size: 12px;
    text-shadow: 0 0 8px var(--orange);
}

/* ── Pixel divider ── */
.pixel-divider {
    display: flex;
    gap: 5px;
    margin: 8px 0 16px;
    align-items: center;
}

.pdot {
    width: 6px;
    height: 6px;
    animation: dot-cycle 1.4s steps(1) infinite;
}

.pdot:nth-child(1) { animation-delay: 0s }
.pdot:nth-child(2) { animation-delay: .17s }
.pdot:nth-child(3) { animation-delay: .35s }
.pdot:nth-child(4) { animation-delay: .52s }
.pdot:nth-child(5) { animation-delay: .7s }
.pdot:nth-child(6) { animation-delay: .87s }
.pdot:nth-child(7) { animation-delay: 1.05s }
.pdot:nth-child(8) { animation-delay: 1.22s }

@keyframes dot-cycle {
    0%  { background: var(--orange); }
    33% { background: var(--orange-bright); }
    66% { background: var(--yellow); }
}

/* ── Pixel frame ── */
.pixel-frame {
    border: 2px solid rgba(255, 80, 0, 0.22);
    padding: 24px 20px;
    position: relative;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 0 30px rgba(255, 60, 0, 0.07), inset 0 0 20px rgba(255, 60, 0, 0.03);
}

.pixel-frame::before,
.pixel-frame::after {
    content: '▪';
    position: absolute;
    color: var(--orange);
    font-size: 12px;
    top: -8px;
    text-shadow: 0 0 8px var(--orange);
}

.pixel-frame::before { left: -2px; }
.pixel-frame::after  { right: -2px; }

/* ── Input section ── */
.input-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.input-label {
    font-size: 8px;
    color: #ff6600;
    letter-spacing: 2px;
    text-shadow: 0 0 6px var(--orange);
}

.name-input {
    width: 100%;
    background: var(--black);
    border: 2px solid var(--orange);
    color: var(--orange-bright);
    font-family: var(--font-pixel);
    font-size: 13px;
    padding: 12px 16px;
    text-align: center;
    letter-spacing: 3px;
    outline: none;
    text-transform: uppercase;
    transition: box-shadow 0.2s;
    box-shadow: 0 0 12px rgba(255, 60, 0, 0.28), inset 0 0 14px rgba(255, 60, 0, 0.05);
}

.name-input::placeholder {
    color: rgba(255, 80, 0, 0.3);
    font-size: 9px;
    letter-spacing: 1px;
}

.name-input:focus {
    box-shadow: 0 0 22px rgba(255, 60, 0, 0.5), 0 0 44px rgba(255, 40, 0, 0.2),
        inset 0 0 16px rgba(255, 60, 0, 0.1);
}

/* ── Single unified button style ── */
.game-btn {
    font-family: var(--font-pixel);
    font-size: 11px;
    color: var(--black);
    background: var(--orange);
    border: none;
    padding: 14px 32px;
    letter-spacing: 3px;
    cursor: pointer;
    box-shadow: 4px 4px 0 var(--orange-dark), 0 0 22px var(--orange-glow);
    animation: btn-pulse 2s ease-in-out infinite;
    transition: all 0.08s steps(1);
}

.game-btn:hover {
    background: var(--orange-bright);
    box-shadow: 4px 4px 0 #883300, 0 0 30px rgba(255, 120, 0, 0.5);
    transform: translate(-1px, -1px);
    animation: none;
}

.game-btn:active {
    transform: translate(3px, 3px);
    box-shadow: 1px 1px 0 var(--orange-dark);
}

.game-btn:disabled {
    background: var(--black-light);
    color: #4a2800;
    cursor: not-allowed;
    box-shadow: none;
    animation: none;
}

/* ── Error message ── */
.error-msg {
    font-size: 7px;
    color: var(--red-err);
    text-shadow: 0 0 8px var(--red-err);
    letter-spacing: 1px;
    min-height: 14px;
    display: none;
    animation: blink 0.5s step-end infinite;
}

.error-msg.show { display: block; }

/* ── Load bar ── */
.load-bar-wrap {
    width: 100%;
    max-width: 260px;
    height: 14px;
    border: 2px solid var(--orange);
    display: none;
    overflow: hidden;
}

.load-bar-wrap.show { display: block; }

.load-bar-inner {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #cc2200, #ff6600, #ffcc00);
    transition: width 1.2s steps(14) forwards;
}

/* ── Credits ── */
.credits {
    font-size: 6px;
    color: var(--black-light);
    letter-spacing: 1px;
    margin-top: 16px;
    text-align: center;
    line-height: 2.4;
}

/* ── Success overlay ── */
.success-overlay {
    position: absolute;
    inset: 0;
    background: var(--black);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s;
    gap: 16px;
}

.success-overlay.show {
    opacity: 1;
    pointer-events: all;
}

.success-title {
    font-size: 12px;
    color: #ffaa00;
    text-shadow: 0 0 16px #ff8800;
    letter-spacing: 3px;
    animation: blink 0.8s step-end infinite;
}

.success-name {
    font-family: var(--font-vt);
    font-size: 44px;
    color: var(--orange);
    text-shadow: 0 0 16px var(--orange-dim), 0 0 40px #cc2200;
    letter-spacing: 6px;
}

.success-await {
    font-size: 8px;
    color: var(--orange);
    letter-spacing: 2px;
    animation: blink 1.2s step-end infinite;
}

/* ═══════════════════════════════════════════════
   HUD (game screen)
════════════════════════════════════════════════ */
.hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 2px solid rgba(255, 80, 0, 0.2);
    background: rgba(13, 5, 0, 0.95);
}

.hud-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.hud-label {
    font-size: 6px;
    color: #cc4400;
    letter-spacing: 1px;
}

.hud-val {
    font-size: 10px;
    color: #ff6600;
    text-shadow: 0 0 6px var(--orange);
}

.timer-display {
    color: var(--orange-bright) !important;
    text-shadow: 0 0 8px #ff6600 !important;
}

.timer-display.warning {
    color: var(--red-err) !important;
    text-shadow: 0 0 10px var(--red-err) !important;
    animation: blink 0.5s step-end infinite;
}

/* ── Audio mute button in HUD ── */
.hud-mute-btn {
    background: none;
    border: 1px solid rgba(255, 80, 0, 0.35);
    color: #ff6600;
    font-size: 14px;
    width: 28px;
    height: 22px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: all 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hud-mute-btn:hover {
    border-color: var(--orange);
    background: rgba(255, 68, 0, 0.15);
}

/* ═══════════════════════════════════════════════
   GAME SCENE
════════════════════════════════════════════════ */
.game-scene {
    position: absolute;
    inset: 0;
    top: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.scene-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.scene-title {
    font-size: 20px;
    color: var(--orange);
    text-shadow: 0 0 14px var(--orange-dim), 0 0 30px #880000;
    animation: flicker 3s infinite;
}

.scene-sub {
    font-family: var(--font-vt);
    font-size: 22px;
    color: var(--orange-bright);
    letter-spacing: 3px;
    animation: blink 1s step-end infinite;
}

/* ═══════════════════════════════════════════════
   GAME OVER SCREEN
════════════════════════════════════════════════ */
.gameover-content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    width: 100%;
    max-width: 520px;
    padding: 20px;
}

.gameover-title {
    font-size: clamp(24px, 5vw, 42px);
    color: var(--red-err);
    text-shadow: 0 0 14px #cc0000, 4px 4px 0 #330000;
    letter-spacing: 6px;
    animation: flicker 4s infinite;
}

.gameover-stats {
    border: 2px solid rgba(255, 80, 0, 0.2);
    padding: 20px 28px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: 0 0 20px rgba(255, 40, 0, 0.07);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 80, 0, 0.1);
    padding-bottom: 10px;
}

.stat-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.stat-label {
    font-size: 8px;
    color: #cc4400;
    letter-spacing: 1px;
}

.stat-val {
    font-size: 11px;
    color: #ff6600;
    text-shadow: 0 0 6px var(--orange);
}

/* ═══════════════════════════════════════════════
   SHARED ANIMATIONS
════════════════════════════════════════════════ */
@keyframes blink {
    0%, 100% { opacity: 1 }
    50%       { opacity: 0 }
}

@keyframes flicker {
    0%, 93%, 100% { opacity: 1 }
    94%            { opacity: 0.8 }
    96%            { opacity: 0.55 }
    98%            { opacity: 1 }
}

@keyframes pulse-orange {
    0%, 100% { text-shadow: 0 0 8px #ff6600, 0 0 20px #cc4400; }
    50%       { text-shadow: 0 0 18px #ff8800, 0 0 40px #ff4400, 0 0 60px #cc2200; }
}

@keyframes btn-pulse {
    0%, 100% { box-shadow: 4px 4px 0 var(--orange-dark), 0 0 22px var(--orange-glow); }
    50%       { box-shadow: 4px 4px 0 var(--orange-dark), 0 0 40px rgba(255, 80, 0, 0.7); }
}

/* ═══════════════════════════════════════════════
   CP2 — HALL OF PATHS (PRO LEVEL)
════════════════════════════════════════════════ */

.cp2-scene {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background:
        radial-gradient(circle at center, #1a0800 0%, #0d0500 60%, #000 100%);
}

.cp2-bg {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        repeating-linear-gradient(0deg,
            rgba(255, 60, 0, 0.04) 0px,
            rgba(255, 60, 0, 0.04) 2px,
            transparent 2px,
            transparent 40px);
}

.cp2-floor {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 140px;
    background: linear-gradient(#2a1000, #0d0500);
    z-index: 2;
}

.cp2-title {
    position: absolute;
    top: 20px;
    width: 100%;
    text-align: center;
    font-size: 20px;
    color: var(--orange);
    text-shadow: 0 0 12px var(--orange-dim);
    z-index: 10;
    animation: flicker 3s infinite;
}

.hallways {
    position: absolute;
    bottom: 140px;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 90px;
    perspective: 900px;
    z-index: 5;
}

.hall {
    width: 130px;
    height: 230px;
    position: relative;
    cursor: pointer;
    transition: box-shadow 0.3s ease, transform 0.15s ease;
    border: 3px solid var(--orange);
    background: linear-gradient(180deg, #050100, #1a0900);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8), inset 0 0 40px rgba(0, 0, 0, 0.9);
}

.hall::before {
    content: "";
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.9);
    pointer-events: none;
}

.hall::after {
    content: "";
    position: absolute;
    inset: 10% 20%;
    background: radial-gradient(ellipse at 50% 0%, rgba(255, 80, 0, 0.08), transparent);
    pointer-events: none;
}

.hall:hover {
    transform: scale(1.08);
    box-shadow: 0 0 35px var(--orange), inset 0 0 40px rgba(0, 0, 0, 0.9);
}

.hall-a { background: rgba(255, 100, 0, 0.45); }
.hall-b { background: rgba(200, 80, 0, 0.35); }
.hall-c { background: rgba(0, 0, 0, 0.95); }

.code {
    position: absolute;
    top: -50px;
    width: 100%;
    font-size: 8px;
    color: var(--yellow);
    text-align: center;
    text-shadow: 0 0 6px var(--orange);
    letter-spacing: 1px;
    user-select: text;
    -webkit-user-select: text;
    cursor: text;
    z-index: 6;
}

.hall-enter-btn {
    position: absolute;
    bottom: 36px;
    left: 0;
    right: 0;
    width: fit-content;
    margin: 0 auto;
    font-family: var(--font-pixel);
    font-size: 8px;
    color: var(--black);
    background: var(--orange);
    border: none;
    padding: 8px 16px;
    letter-spacing: 2px;
    cursor: pointer;
    z-index: 100;
    box-shadow: 3px 3px 0 var(--orange-dark), 0 0 14px var(--orange-glow);
    animation: btn-pulse 2s ease-in-out infinite;
    transition: background 0.08s steps(1), box-shadow 0.08s steps(1);
    pointer-events: all;
}

.hall-enter-btn:hover {
    background: var(--orange-bright);
    box-shadow: 3px 3px 0 #883300, 0 0 22px rgba(255, 120, 0, 0.5);
    animation: none;
}

.hall-enter-btn:active {
    box-shadow: 1px 1px 0 var(--orange-dark);
}

.inscription,
.cp2-subtitle {
    position: absolute;
    top: 72px;
    width: 100%;
    text-align: center;
    font-family: 'VT323', monospace;
    font-size: 20px;
    color: var(--orange-bright);
    letter-spacing: 3px;
    z-index: 10;
    text-shadow: 0 0 8px var(--orange);
}

.cp2-hall-cipher {
    position: absolute;
    top: 12px;
    width: 100%;
    padding: 0 6px;
    font-family: 'Press Start 2P', monospace;
    font-size: 6px;
    color: var(--yellow);
    text-align: center;
    text-shadow: 0 0 6px var(--orange);
    letter-spacing: 1px;
    user-select: text;
    -webkit-user-select: text;
    cursor: text;
    z-index: 6;
    word-break: break-all;
}

.torch {
    position: absolute;
    width: 20px;
    height: 60px;
    background: #4e2800;
    top: 45%;
    z-index: 6;
}

.torch.left  { left: 20px; }
.torch.right { right: 20px; }

.torch::after {
    content: '';
    position: absolute;
    top: -18px;
    left: 0;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, #ffcc00, #ff4400);
    border-radius: 50%;
    animation: cp2-flicker 0.25s infinite alternate;
}

@keyframes cp2-flicker {
    from { opacity: 0.6; transform: scale(0.9); }
    to   { opacity: 1;   transform: scale(1.1); }
}

.skull {
    position: absolute;
    width: 26px;
    height: 26px;
    background: #ddd;
    bottom: 30px;
    border-radius: 50%;
    z-index: 6;
    box-shadow: inset 0 0 6px #000;
}

.skull-left  { left: 120px; }
.skull-right { right: 120px; }

#particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 20;
}

.particle.dust {
    width: 4px;
    height: 4px;
    background: #aa5500;
    position: absolute;
    animation: dustMove 2s linear forwards;
}

@keyframes dustMove {
    from { transform: translateY(0);     opacity: 0.5; }
    to   { transform: translateY(-120px); opacity: 0; }
}

.particle.fire {
    width: 3px;
    height: 6px;
    background: orange;
    position: absolute;
    animation: fireMove 1s linear forwards;
}

@keyframes fireMove {
    from { transform: translateY(0); }
    to   { transform: translateY(-80px); opacity: 0; }
}

.collapse {
    animation: collapse 0.3s infinite;
}

@keyframes collapse {
    0%   { transform: translate(0, 0); }
    50%  { transform: translate(6px, -6px); }
    100% { transform: translate(-6px, 6px); }
}

.blackout {
    background: black !important;
    transition: 0.6s;
}

.enter {
    animation: enterHall 1.5s forwards;
}

@keyframes enterHall {
    to { transform: scale(6); opacity: 0; }
}

.fadeout {
    opacity: 0;
    transition: 1s;
}

.cp2-transition {
    position: absolute;
    inset: 0;
    background: black;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--orange);
    font-size: 18px;
    opacity: 0;
    z-index: 50;
}

.cp2-transition.show {
    opacity: 1;
    transition: 1s;
}

.cp2-trans-text {
    font-family: var(--font-pixel);
    font-size: clamp(14px, 3vw, 22px);
    color: #ffcc00;
    text-shadow: 0 0 20px #ffaa00, 0 0 40px #ff8800;
    letter-spacing: 4px;
    animation: blink 0.6s step-end infinite;
}

.cp2-trans-sub {
    font-family: var(--font-vt);
    font-size: 20px;
    color: #ff8800;
    letter-spacing: 3px;
    margin-top: 12px;
}

.hall-label {
    position: absolute;
    bottom: 12px;
    width: 100%;
    text-align: center;
    font-family: var(--font-pixel);
    font-size: 8px;
    color: var(--orange-bright);
    letter-spacing: 2px;
    text-shadow: 0 0 8px var(--orange);
    z-index: 5;
}

.hall-selected {
    box-shadow: 0 0 50px var(--orange), 0 0 100px rgba(255, 120, 0, 0.6) !important;
    border-color: var(--yellow) !important;
}

.hall-selected::before {
    border-color: var(--yellow) !important;
    box-shadow: inset 0 0 40px rgba(255, 200, 0, 0.3) !important;
}

.hallways.hall-entering .hall:not(.enter) {
    opacity: 0;
    transition: opacity 0.6s;
}

/* ═══════════════════════════════════════════════
   CP2 — SUBMIT MODAL
════════════════════════════════════════════════ */
.cp2-submit-modal {
    position: absolute;
    inset: 0;
    z-index: 40;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
}

.cp2-submit-modal.open {
    opacity: 1;
    pointer-events: all;
}

.cp2-submit-box {
    width: 90%;
    max-width: 500px;
    background: linear-gradient(135deg, #1a0800, #0d0500);
    border: 2px solid var(--orange);
    box-shadow: 0 0 40px rgba(255, 68, 0, 0.5), inset 0 0 20px rgba(0, 0, 0, 0.6);
}

.cp2-submit-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 68, 0, 0.3);
    background: rgba(255, 68, 0, 0.08);
}

.cp2-submit-title {
    font-family: var(--font-pixel);
    font-size: 11px;
    color: var(--orange-bright);
    text-shadow: 0 0 8px var(--orange);
    flex: 1;
    letter-spacing: 2px;
}

.cp2-submit-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cp2-cipher-display {
    font-family: var(--font-pixel);
    font-size: 9px;
    color: var(--yellow);
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--orange);
    padding: 10px 14px;
    letter-spacing: 2px;
    word-break: break-all;
    text-shadow: 0 0 8px #ffaa00;
    text-align: center;
    user-select: text;
    -webkit-user-select: text;
    cursor: text;
}

.cp2-submit-hint {
    font-family: var(--font-vt);
    font-size: 16px;
    color: #cc4400;
    letter-spacing: 1px;
    text-align: center;
}

.cp2-submit-row { display: flex; gap: 8px; }

.cp2-submit-input {
    flex: 1;
    background: #0d0500;
    border: 2px solid var(--orange);
    color: var(--orange-bright);
    font-family: var(--font-pixel);
    font-size: 9px;
    padding: 10px 12px;
    outline: none;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: inset 0 0 10px rgba(255, 60, 0, 0.08);
    transition: box-shadow 0.2s;
}

.cp2-submit-input:focus {
    box-shadow: 0 0 16px rgba(255, 60, 0, 0.4), inset 0 0 10px rgba(255, 60, 0, 0.1);
}

.cp2-submit-input.shake {
    animation: input-shake 0.4s ease-in-out;
}

@keyframes input-shake {
    0%, 100% { transform: translateX(0) }
    20%       { transform: translateX(-6px) }
    60%       { transform: translateX(6px) }
}

.cp2-submit-feedback {
    font-family: var(--font-pixel);
    font-size: 7px;
    min-height: 16px;
    letter-spacing: 1px;
    text-align: center;
}

.cp2-submit-feedback.success {
    color: #00ff88;
    text-shadow: 0 0 8px #00cc66;
    animation: blink 0.6s step-end infinite;
}

.cp2-submit-feedback.error {
    color: #ff2200;
    text-shadow: 0 0 8px #cc0000;
}

/* ═══════════════════════════════════════════════
   CP2 — RED FLASH OVERLAY
════════════════════════════════════════════════ */
.cp2-red-flash {
    position: absolute;
    inset: 0;
    z-index: 35;
    background: radial-gradient(circle, rgba(255, 0, 0, 0.6), rgba(180, 0, 0, 0.3));
    opacity: 0;
    pointer-events: none;
}

.cp2-red-flash.active {
    opacity: 1;
    animation: red-pulse 0.15s ease-in-out 3;
}

@keyframes red-pulse {
    0%, 100% { opacity: 0.8; }
    50%       { opacity: 0.3; }
}