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

html { background: #000; min-height: 100%; }

body {
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
    background: #000;
    color: #c8c8c8;
    min-height: 100vh;
    padding: 2rem 1rem 4rem;
    line-height: 1.6;
}

/* ?? Back ?? */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: #555;
    text-decoration: none;
    letter-spacing: 0.06em;
    margin-bottom: 2.5rem;
    transition: color 0.15s;
}
.back-link:hover { color: #aaa; }
.back-link::before { content: '<'; }

/* ?? Layout ?? */
.container { max-width: 680px; margin: 0 auto; }

/* ?? Header ?? */
.header {
    border-bottom: 1px solid #222;
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}
.header-title {
    font-size: 1.6rem;
    font-weight: 500;
    color: #fff;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}
.header-sub {
    font-size: 0.75rem;
    color: #555;
    letter-spacing: 0.12em;
}

/* ?? Prompt line ?? */
.prompt-line {
    font-size: 0.8rem;
    color: #555;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2rem;
}
.prompt-line .cwd { color: #888; }
.prompt-cursor {
    display: inline-block;
    width: 7px;
    height: 13px;
    background: #777;
    animation: blink 1.1s step-end infinite;
    vertical-align: -2px;
}
@keyframes blink { 50% { opacity: 0; } }

/* ?? Field ?? */
.field { margin-bottom: 1.6rem; }
.field-label {
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #555;
    margin-bottom: 8px;
    padding-left: 2px;
}

input[type="url"] {
    width: 100%;
    background: #0b0b0b;
    border: 1px solid #1e1e1e;
    border-radius: 8px;
    color: #e0e0e0;
    font-family: inherit;
    font-size: 0.88rem;
    padding: 12px 14px;
    transition: border-color 0.15s;
}
input[type="url"]:focus {
    outline: none;
    border-color: #444;
}
input[type="url"]::placeholder { color: #3a3a3a; }

/* ?? Video info card ?? */
.video-info {
    display: none;
    border: 1px solid #1e1e1e;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1.4rem;
    animation: fadeIn 0.2s ease-out;
}
.video-info.error { border-color: #4a1a1a; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.info-header {
    padding: 8px 14px;
    background: #0d0d0d;
    border-bottom: 1px solid #1e1e1e;
    display: flex;
    align-items: center;
    gap: 8px;
}
.video-info.error .info-header { background: #100808; border-bottom-color: #3a1a1a; }

.info-header-label {
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #555;
}
.video-info.error .info-header-label { color: #884444; }

.info-body { padding: 14px; background: #080808; }

.video-title {
    font-size: 0.92rem;
    color: #e8e8e8;
    font-weight: 500;
    margin-bottom: 10px;
    letter-spacing: 0.02em;
}
.video-info.error .video-title { color: #cc7777; }

.video-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 0;
    margin-bottom: 12px;
}
.video-meta span {
    font-size: 0.75rem;
    color: #555;
    letter-spacing: 0.04em;
}
.video-meta span::after { content: ' ·'; margin: 0 6px; color: #333; }
.video-meta span:last-child::after { content: ''; margin: 0; }

.video-description {
    font-size: 0.78rem;
    color: #444;
    line-height: 1.7;
    max-height: 80px;
    overflow: hidden;
    position: relative;
}
.video-description::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 24px;
    background: linear-gradient(transparent, #080808);
}

/* ?? Download button ?? */
.run-btn {
    font-family: inherit;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    width: 100%;
    padding: 13px;
    background: #0f0f0f;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    color: #aaa;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.run-btn::before { content: '?'; font-size: 0.9rem; color: #555; }
.run-btn:hover:not(:disabled) { color: #fff; border-color: #555; background: #111; }
.run-btn:active:not(:disabled) { background: #1a1a1a; }
.run-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ?? Status ?? */
.status-line {
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    color: #555;
    margin-top: 1.2rem;
    min-height: 18px;
    padding-left: 2px;
    transition: color 0.2s;
}
.status-line.ok  { color: #668866; }
.status-line.err { color: #886666; }

/* ?? Footer ?? */
.footer {
    margin-top: 3rem;
    padding-top: 1rem;
    border-top: 1px solid #1a1a1a;
    font-size: 0.72rem;
    color: #333;
    letter-spacing: 0.1em;
    text-align: right;
}