/* KETSUIN WEAVER CSS */
@font-face {
    font-family: 'AaJianMingShouShu-2';
    src: url('../assets/fonts/AaJianMingShouShu-2.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg-main: #0a0a0b;
    --panel-bg: #141416;
    --text-main: #f0f0f0;
    --text-dim: #888;
    --accent: #FF3F00;
    --accent-hover: #E63900;
    --border-color: #333;

    --font-mono: 'JetBrains Mono', monospace;
    --font-display: 'Syne', sans-serif;
    --font-ninja: "AaJianMingShouShu-2", serif;
}

body {
    margin: 0;
    padding: 0;
    background-color: #000;
    background-image: url('../assets/background.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-main);
    font-family: var(--font-mono);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.hardware-chassis {
    width: 100%;
    max-width: 1400px;
    background: rgba(10, 10, 11, 0.92);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
}

header.branding {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    background: repeating-linear-gradient(45deg,
            #0a0a0b,
            #0a0a0b 10px,
            #0f0f10 10px,
            #0f0f10 20px);
}

.logo h1 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    line-height: 0.9;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: -1px;
    color: var(--text-main);
}

.status-badge {
    background: rgba(255, 63, 0, 0.1);
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
}

.grid-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    min-height: 700px;
}

.control-module {
    border-right: 1px solid var(--border-color);
    background: var(--panel-bg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
}

.display-module {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    background: #000;
}

.panel {
    border: 1px solid var(--border-color);
    background: var(--bg-main);
    padding: 1rem;
}

.export-panel {
    border-top: 1px solid var(--border-color);
    border-right: none;
    border-left: none;
    border-bottom: none;
}

.align-right {
    text-align: right;
}

h2 {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--text-dim);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-top: 0;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.panel-desc {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: -0.5rem;
    margin-bottom: 1rem;
}

/* T9 Grid */
.t9-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.t9-btn {
    background: #111;
    border: 1px solid #333;
    color: #fff;
    padding: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    position: relative;
    overflow: hidden;
}

.t9-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    filter: invert(1);
    /* Assuming black images, invert to white for dark theme */
    opacity: 0.8;
}

.t9-btn:hover .t9-img {
    opacity: 1;
    filter: invert(1) drop-shadow(0 0 5px var(--accent));
}

.t9-btn:hover {
    border-color: var(--accent);
    background: rgba(255, 63, 0, 0.1);
}

.t9-btn.recorded {
    border-color: #00FF66;
    background: rgba(0, 255, 102, 0.1);
}

.t9-btn.recording {
    background: rgba(255, 0, 0, 0.3);
    border-color: red;
    animation: flash 1s infinite alternate;
}

.t9-label {
    font-weight: bold;
    font-size: 1rem;
}

.t9-sub {
    color: var(--text-dim);
    font-size: 0.6rem;
}

/* Forms & Buttons */
.input-block {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
}

.input-block label {
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-bottom: 0.4rem;
}

.input-block input[type="file"] {
    background: #111;
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-main);
    width: 100%;
    box-sizing: border-box;
}

.primary-btn,
.secondary-btn,
.outline-btn {
    font-family: var(--font-mono);
    font-weight: bold;
    padding: 0.8rem 1rem;
    text-transform: uppercase;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    width: 100%;
}

.primary-btn {
    background: var(--accent);
    color: #fff;
}

.primary-btn:hover:not(:disabled) {
    background: var(--accent-hover);
}

.secondary-btn {
    background: #333;
    color: #fff;
}

.secondary-btn:hover:not(:disabled) {
    background: #444;
}

.outline-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.outline-btn.accent-border {
    border-color: var(--accent);
    color: var(--accent);
}

.outline-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.transport-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

/* Display Module Area */
.display-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.8rem;
}

.status-indicator {
    color: #00FF66;
    font-weight: bold;
}

.coordinates {
    color: var(--accent);
}

.canvas-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #111;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.crt-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 4px, 6px 100%;
    z-index: 10;
}

canvas {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.export-status {
    font-size: 0.75rem;
    color: #00FF66;
    margin-top: 0.5rem;
}

.hidden {
    display: none !important;
}

/* Ketsuin Splash Animation Overlay container */
.sign-overlay-container {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Vignette Background during animation */
.sign-overlay-bg {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.4);
    transition: opacity 0.3s;
    opacity: 0;
}

.sign-overlay-bg.animate {
    opacity: 1;
}

/* Kanji Character */
.ketsuin-flash {
    position: relative;
    font-size: 15rem;
    font-family: var(--font-ninja);
    color: #F2A900;
    line-height: 1;
    user-select: none;
    filter: drop-shadow(0 0 30px rgba(242, 169, 0, 0.8));
    transform-origin: center;
    transition: all 0.7s ease-out;
    opacity: 0;
    transform: scale(0.5);
    /* Start state */
}

@media (min-width: 768px) {
    .ketsuin-flash {
        font-size: 25rem;
    }
}

.ketsuin-flash.animate {
    animation: sekiro-flash 1s ease-out forwards;
}

@keyframes flash {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0.5;
    }
}

@keyframes sekiro-flash {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }

    15% {
        opacity: 1;
        transform: scale(1.0);
        filter: drop-shadow(0 0 50px rgba(242, 169, 0, 1));
    }

    20% {
        transform: scale(1.05);
    }

    25% {
        transform: scale(1.0);
    }

    100% {
        opacity: 0;
        transform: scale(1.4);
        filter: drop-shadow(0 0 10px rgba(242, 169, 0, 0));
    }
}

.chassis-footer {
    display: flex;
    justify-content: space-between;
    padding: 1rem 2rem;
    border-top: 1px solid var(--border-color);
    background: var(--panel-bg);
}

.screw {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #333;
    border: 1px solid #111;
}

.serial {
    font-size: 0.7rem;
    color: var(--text-dim);
}

/* Modifiers for lyrics playback overlay so it doesn't obscure the middle box */
.sign-overlay-container.lyrics-pop {
    align-items: flex-end;
    padding-bottom: 25vh;
    /* Push up from bottom, but still below center box */
}