*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --bg: #0f172a; --surface: #1e293b; --surface2: #263348;
    --border: #2d3f55; --border-hover: #3d5470; --text: #e2e8f0;
    --muted: #7a90a8; --blue: #6366f1; --success: #3dd68c;
    --success-dim: rgba(61, 214, 140, 0.1);
}
html, body { height: 100%; background: var(--bg); color: var(--text); font-family: 'Geist', sans-serif; font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
#app { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem; }
.gear-btn { position: fixed; top: 1.25rem; right: 1.25rem; width: 40px; height: 40px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--muted); transition: border-color 0.15s, color 0.15s; z-index: 10; }
.gear-btn:hover { border-color: var(--border-hover); color: var(--text); }
.header { text-align: center; margin-bottom: 3rem; }
.logo { width: 96px; height: 96px; margin: 0 auto 1.5rem; display: block; object-fit: contain; }
.title { font-size: 2rem; font-weight: 600; letter-spacing: -0.03em; margin-bottom: 0.5rem; }
.subtitle { font-size: 0.8rem; color: var(--muted); font-family: 'Geist Mono', monospace; letter-spacing: 0.06em; text-transform: uppercase; }
.dropzone-wrapper { width: 100%; max-width: 520px; }
.dropzone { position: relative; border: 1px solid var(--border); border-radius: 16px; padding: 4rem 2.5rem; text-align: center; cursor: pointer; background: var(--surface); transition: border-color 0.2s, box-shadow 0.2s; }
.dropzone:hover, .dropzone.drag-over { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.dropzone input[type="file"] { display: none; }
.drop-icon { width: 40px; height: 40px; margin: 0 auto 1.25rem; color: var(--muted); transition: color 0.2s; }
.dropzone:hover .drop-icon, .dropzone.drag-over .drop-icon { color: var(--blue); }
.drop-label { font-size: 1rem; font-weight: 500; margin-bottom: 0.4rem; }
.drop-hint { font-size: 0.78rem; color: var(--muted); font-family: 'Geist Mono', monospace; }
.progress-bar { margin-top: 1.25rem; height: 2px; background: var(--border); border-radius: 2px; overflow: hidden; opacity: 0; transition: opacity 0.3s; }
.progress-bar.visible { opacity: 1; }
.progress-fill { height: 100%; width: 0%; background: var(--blue); border-radius: 2px; transition: width 0.3s ease; }
.status { margin-top: 1rem; height: 22px; text-align: center; font-family: 'Geist Mono', monospace; font-size: 0.78rem; color: var(--blue); letter-spacing: 0.02em; }
.status.error { color: #ff6b6b; }
#assignScreen { display: none; width: 100%; max-width: 560px; flex-direction: column; }
#assignScreen.visible { display: flex; }
.assign-header { text-align: center; margin-bottom: 2rem; }
.assign-header h2 { font-size: 1.3rem; font-weight: 600; margin-bottom: 0.4rem; letter-spacing: -0.02em; }
.assign-header p { font-size: 0.78rem; color: var(--muted); font-family: 'Geist Mono', monospace; }
.assign-list { display: flex; flex-direction: column; gap: 0.6rem; max-height: 380px; overflow-y: auto; margin-bottom: 1.5rem; padding-right: 2px; }
.assign-row { display: grid; grid-template-columns: 52px 1fr 1fr; gap: 1rem; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 0.75rem 1rem; }
.assign-preview { width: 40px; height: 40px; border-radius: 6px; object-fit: contain; image-rendering: pixelated; background: var(--bg); border: 1px solid var(--border); }
.assign-filename { font-size: 0.78rem; color: var(--muted); font-family: 'Geist Mono', monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.assign-select { font-family: 'Geist', sans-serif; font-size: 0.82rem; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 0.45rem 0.6rem; cursor: pointer; outline: none; transition: border-color 0.15s; width: 100%; }
.assign-select:focus { border-color: var(--blue); }
.assign-select option { background: var(--bg); }
.btn-primary { font-family: 'Geist', sans-serif; font-size: 0.88rem; font-weight: 500; color: #ffffff; background: var(--blue); border: none; padding: 0.7rem 1.5rem; border-radius: 10px; cursor: pointer; transition: opacity 0.15s; width: 100%; margin-bottom: 0.75rem; }
.btn-primary:hover { opacity: 0.85; }
.btn-secondary { font-family: 'Geist', sans-serif; font-size: 0.88rem; font-weight: 500; color: var(--muted); background: transparent; border: 1px solid var(--border); padding: 0.7rem 1.5rem; border-radius: 10px; cursor: pointer; transition: border-color 0.15s, color 0.15s; width: 100%; }
.btn-secondary:hover { border-color: var(--border-hover); color: var(--text); }
#success { display: none; flex-direction: column; align-items: center; text-align: center; width: 100%; max-width: 520px; animation: fadeUp 0.4s ease forwards; }
#success.visible { display: flex; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.success-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--success-dim); border: 1px solid rgba(61, 214, 140, 0.2); display: flex; align-items: center; justify-content: center; margin-bottom: 1.5rem; color: var(--success); }
.success-title { font-size: 1.4rem; font-weight: 600; margin-bottom: 0.5rem; letter-spacing: -0.02em; }
.success-sub { font-size: 0.8rem; color: var(--muted); font-family: 'Geist Mono', monospace; margin-bottom: 1.75rem; }
.json-box { width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1.25rem; font-family: 'Geist Mono', monospace; font-size: 0.72rem; color: var(--muted); text-align: left; white-space: pre-wrap; word-break: break-all; max-height: 220px; overflow-y: auto; margin-bottom: 1.25rem; }
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.75); backdrop-filter: blur(6px); z-index: 20; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.backdrop.visible { opacity: 1; pointer-events: all; }
.modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -48%) scale(0.97); width: 90%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; z-index: 30; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; }
.modal.visible { opacity: 1; pointer-events: all; transform: translate(-50%, -50%) scale(1); }
.modal-header { position: relative; display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.5rem; border-bottom: 1px solid var(--border); }
.modal-title { display: block; font-size: 0.95rem; font-weight: 600; letter-spacing: -0.01em; }
.modal-meta { position: absolute; left: 50%; transform: translateX(-50%); font-size: 0.68rem; color: var(--muted); font-family: 'Geist Mono', monospace; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.modal-close { position: absolute; right: 1.5rem; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 7px; cursor: pointer; color: var(--muted); background: transparent; border: none; transition: color 0.15s, background 0.15s; }
.modal-close:hover { color: var(--text); background: var(--border); }
.modal-body { padding: 1.5rem; }
.settings-note { margin-bottom: 1.1rem; color: #a0b4cc; font-family: 'Geist Mono', monospace; font-size: 0.74rem; line-height: 1.6; text-align: center; text-wrap: balance; }
.field { margin-bottom: 1.25rem; }
.field:last-of-type { margin-bottom: 0; }
.field label { display: block; font-size: 0.72rem; color: var(--muted); font-family: 'Geist Mono', monospace; margin-bottom: 0.5rem; letter-spacing: 0.05em; text-transform: uppercase; }
.field input { width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 0.65rem 0.9rem; font-family: 'Geist Mono', monospace; font-size: 0.82rem; color: var(--text); outline: none; transition: border-color 0.15s; }
.field input:focus { border-color: var(--blue); }
.field input::placeholder { color: var(--muted); }
input::-ms-reveal, input::-ms-clear { display: none; }
.password-wrap { position: relative; display: flex; align-items: center; }
.password-wrap input { width: 100%; padding-right: 2.5rem; }
.eye-btn { position: absolute; right: 0.75rem; background: none; border: none; cursor: pointer; color: var(--text); display: flex; align-items: center; padding: 0; opacity: 0.6; transition: opacity 0.15s; }
.eye-btn:hover { opacity: 1; }
.modal-footer { padding: 1.1rem 1.5rem; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 0.75rem; }
.modal-save { font-family: 'Geist', sans-serif; font-size: 0.88rem; font-weight: 500; color: #ffffff; background: var(--blue); border: none; padding: 0.65rem 1rem; border-radius: 10px; cursor: pointer; transition: opacity 0.15s; width: 100%; }
.modal-save:hover { opacity: 0.85; }
.tutorial-link { font-size: 0.8rem; color: #a0b4cc; font-family: 'Geist Mono', monospace; text-align: center; cursor: pointer; transition: color 0.15s; background: none; border: none; width: 100%; padding: 0; }
.tutorial-link:hover { color: var(--blue); }
.tutorial-overlay { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -48%) scale(0.97); width: 90%; max-width: 400px; background: var(--surface2); border: 1px solid var(--border-hover); border-radius: 16px; z-index: 40; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; box-shadow: 0 16px 60px rgba(0,0,0,0.6); }
.tutorial-overlay.visible { opacity: 1; pointer-events: all; transform: translate(-50%, -50%) scale(1); }
.tutorial-header { position: relative; display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.5rem; border-bottom: 1px solid var(--border); }
.tutorial-title { font-size: 0.95rem; font-weight: 600; letter-spacing: -0.01em; }
.tutorial-body { padding: 1.5rem; min-height: 160px; }
.tutorial-step { display: none; }
.tutorial-step.active { display: block; }
.tutorial-step h3 { font-size: 0.82rem; font-weight: 600; color: var(--blue); margin-bottom: 0.9rem; font-family: 'Geist Mono', monospace; letter-spacing: 0.03em; }
.tutorial-step p { font-size: 0.83rem; color: #8a9ab0; line-height: 1.75; margin-bottom: 0.65rem; }
.tutorial-step p:last-child { margin-bottom: 0; }
.tutorial-step a { color: var(--blue); text-decoration: none; }
.tutorial-step a:hover { text-decoration: underline; }
.tutorial-step code { font-family: 'Geist Mono', monospace; font-size: 0.76rem; background: var(--bg); border: 1px solid var(--border); border-radius: 4px; padding: 0.1rem 0.4rem; color: var(--text); }
.tutorial-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.tutorial-dots { display: flex; gap: 6px; }
.tutorial-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border); transition: background 0.15s; }
.tutorial-dot.active { background: var(--blue); }
.tutorial-nav { display: flex; gap: 0.6rem; }
.tutorial-nav button { font-family: 'Geist', sans-serif; font-size: 0.82rem; font-weight: 500; padding: 0.45rem 1rem; border-radius: 8px; cursor: pointer; transition: opacity 0.15s, background 0.15s; border: none; }
.btn-tut-back { background: transparent; color: var(--muted); border: 1px solid var(--border) !important; }
.btn-tut-back:hover { color: var(--text); }
.btn-tut-back:disabled { opacity: 0.3; cursor: not-allowed; }
.btn-tut-next { background: var(--blue); color: #ffffff; }
.btn-tut-next:hover { opacity: 0.85; }
.footer { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.15rem; font-family: 'Geist Mono', monospace; font-size: 0.72rem; color: var(--muted); letter-spacing: 0.04em; white-space: nowrap; }
.footer-text { color: var(--muted); }
.footer a {
    text-decoration: none;
    display: inline-flex;
    gap: 0;
}
.wave-char {
    display: inline-block;
    background: linear-gradient(90deg, #bae6fd, #7dd3fc, #38bdf8, #0ea5e9, #7dd3fc, #bae6fd);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: waveChar 2.2s ease-in-out infinite, shimmer 3s linear infinite;
}
.wave-char:nth-child(1) { animation-delay: 0s, 0s; }
.wave-char:nth-child(2) { animation-delay: 0.12s, 0s; }
.wave-char:nth-child(3) { animation-delay: 0.24s, 0s; }
.wave-char:nth-child(4) { animation-delay: 0.36s, 0s; }
.wave-char:nth-child(5) { animation-delay: 0.48s, 0s; }
.wave-char:nth-child(6) { animation-delay: 0.6s, 0s; }
.wave-char:nth-child(7) { animation-delay: 0.72s, 0s; }
@keyframes waveChar {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-3px); }
}
@keyframes shimmer {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }