:root {
    color-scheme: light;
    font-family: Inter, Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #172033;
    background: #f4f6fb;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    --muted: #68748a;
    --line: #e2e7f0;
    --blue: #365be5;
}

* { box-sizing: border-box; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: radial-gradient(ellipse at 82% 0, #e8edff 0, transparent 38%), #f4f6fb; }
button, input, select { font: inherit; }
button, .file-button { cursor: pointer; }
.shell { width: min(940px, calc(100% - 36px)); margin: 0 auto; padding: 22px 0 34px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 0 22px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.brand-mark { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; background: #365be5; color: #fff; font-size: 22px; font-weight: 900; box-shadow: 0 7px 16px #365be533; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 13px; letter-spacing: .09em; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.server-badge { display: inline-flex; align-items: center; gap: 8px; color: #59667d; font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.server-badge i { width: 8px; height: 8px; border-radius: 50%; background: #28a978; box-shadow: 0 0 0 4px #28a9781c; }
.server-badge[data-mode="fallback"] i { background: #d99822; box-shadow: 0 0 0 4px #d998221c; }
.server-badge[data-mode="error"] i { background: #c83d42; box-shadow: 0 0 0 4px #c83d421c; }
.intro { max-width: 690px; padding: 39px 0 26px; }
.eyebrow { margin: 0 0 12px; color: var(--blue); font-size: 10px; font-weight: 900; letter-spacing: .13em; }
h1 { margin: 0; color: #18233b; font-size: clamp(32px, 6vw, 48px); line-height: 1.15; letter-spacing: -.055em; }
h1 span { color: var(--blue); }
.intro > p:last-child { max-width: 620px; margin: 15px 0 0; color: var(--muted); font-size: 14px; line-height: 1.8; }
.intro-links { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 13px; margin-top: 18px; }
.linux-app-link { display: inline-flex; min-height: 40px; align-items: center; gap: 8px; padding: 0 14px; border: 1px solid #cbd5ff; border-radius: 9px; background: #fff; color: var(--blue); font-size: 12px; font-weight: 850; text-decoration: none; box-shadow: 0 5px 15px #365be512; }
.linux-app-link:hover { border-color: var(--blue); background: #f5f7ff; }
.linux-app-link:focus-visible { outline: 3px solid #9cadff; outline-offset: 3px; }
.intro-links > span { color: var(--muted); font-size: 11px; }
.player-panel { overflow: hidden; border: 1px solid #dfe4ee; border-radius: 16px; background: #fff; box-shadow: 0 18px 48px #29385814; }
.toolbar { display: flex; align-items: flex-end; gap: 10px; padding: 15px; }
.sample-feature { display: grid; flex: 1; gap: 5px; align-self: center; color: #58647b; font-size: 11px; font-weight: 750; }
.sample-feature strong { color: #26314a; font-size: 13px; }
.file-button, .url-form input, .url-form button, .player-actions button { min-height: 41px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: #26314a; }
.file-button { display: inline-flex; align-items: center; justify-content: center; padding: 0 14px; color: var(--blue); font-size: 12px; font-weight: 800; white-space: nowrap; }
.file-button:hover, .player-actions button:hover:not(:disabled) { background: #f1f4ff; border-color: #bdcaff; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; clip-path: inset(50%); }
.visually-hidden:focus-visible + .file-button { outline: 3px solid #9cadff; outline-offset: 3px; }
.url-form { display: flex; align-items: center; gap: 9px; padding: 0 15px 15px; }
.url-form label { color: #58647b; font-size: 11px; font-weight: 750; white-space: nowrap; }
.url-form input { flex: 1; min-width: 0; padding: 0 11px; font-size: 12px; }
.url-form button { padding: 0 15px; border-color: var(--blue); background: var(--blue); color: #fff; font-size: 12px; font-weight: 800; }
.url-form button:hover { background: #2949c6; }
.stage { position: relative; display: grid; min-height: 390px; place-items: center; overflow: hidden; background: #111827; }
.stage canvas { display: block; width: 100%; max-height: 75vh; object-fit: contain; background: #111827; }
.stage:fullscreen { width: 100vw; height: 100vh; min-height: 100vh; border-radius: 0; background: #000; }
.stage:fullscreen canvas { width: 100vw; height: 100vh; max-height: 100vh; }
.fullscreen-close { position: absolute; z-index: 20; top: 14px; right: 14px; display: inline-flex; min-height: 40px; align-items: center; gap: 7px; padding: 0 13px; border: 1px solid #ffffff55; border-radius: 9px; background: #101725e8; color: #fff; font-size: 13px; font-weight: 750; cursor: pointer; }
.fullscreen-close span { font-size: 20px; line-height: 1; }
.fullscreen-close[hidden] { display: none !important; }
.stage:fullscreen .fullscreen-close:not([hidden]) { display: inline-flex; }
.stage-placeholder { position: absolute; z-index: 1; inset: 0; display: grid; place-items: center; color: #c4cce0; text-align: center; }
.stage-placeholder[hidden] { display: none !important; }
.loading-panel { width: min(380px, calc(100% - 48px)); text-align: center; }
.loading-value { display: block; color: #fff; font-size: clamp(44px, 9vw, 72px); line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.055em; }
.loading-time { display: block; margin-top: 10px; color: #7ef0e8; font-size: 13px; font-variant-numeric: tabular-nums; font-weight: 850; }
.loading-label { display: block; margin: 14px 0 12px; color: #c4cce0; font-size: 13px; }
.loading-panel[hidden] { display: none; }
.stage-placeholder p { position: absolute; right: 12px; bottom: 20px; left: 12px; margin: 0; font-size: 13px; }
.loading-track { display: block; height: 8px; overflow: hidden; border: 1px solid #8ca4db55; border-radius: 999px; background: #293449; }
.loading-fill { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #647cff, #55d9c2); transition: width .18s ease; }
.play-mark { position: absolute; top: 50%; left: 50%; display: grid; width: 58px; height: 58px; place-items: center; padding: 0 0 0 3px; transform: translate(-50%, -50%); border: 1px solid #ffffff5c; border-radius: 50%; background: #ffffff20; color: #fff; font-size: 20px; cursor: pointer; transition: background .16s ease, transform .16s ease; }
.play-mark[hidden] { display: none !important; }
.play-mark:hover:not(:disabled) { transform: translate(-50%, -50%) scale(1.08); background: #ffffff36; }
.play-mark:focus-visible { outline: 3px solid #9cadff; outline-offset: 4px; }
.play-mark:disabled { cursor: not-allowed; opacity: .55; }
.player-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 59px; padding: 9px 15px; }
#status { color: var(--muted); font-size: 11px; line-height: 1.5; }
#status[data-error="true"] { color: #b42318; }
.player-actions > div { display: flex; gap: 7px; }
.player-actions button { min-height: 35px; padding: 0 11px; color: #34415d; font-size: 11px; font-weight: 750; }
.player-actions button:disabled { cursor: not-allowed; opacity: .48; }
.notice { margin: 17px 2px 0; color: var(--muted); font-size: 11px; line-height: 1.8; }
.notice strong { color: #34415d; }
.guide-lead { max-width: 720px; margin: 13px 0 0; color: var(--muted); font-size: 14px; line-height: 1.8; }
.guide-card { margin-top: 18px; padding: 20px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: 0 12px 32px #2938580c; }
.guide-card h2 { margin: 0; color: #18233b; font-size: 18px; letter-spacing: -.025em; }
.guide-card p, .guide-card li { color: #58647b; font-size: 13px; line-height: 1.75; }
.guide-card p { margin: 9px 0 0; }
.guide-card ul, .guide-card ol { display: grid; gap: 7px; margin: 12px 0 0; padding-left: 21px; }
.guide-card li::marker { color: #7185e8; }
.guide-links { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 15px; }
.guide-links a { display: inline-flex; min-height: 39px; align-items: center; padding: 0 13px; border: 1px solid #cbd5ff; border-radius: 8px; color: var(--blue); font-size: 12px; font-weight: 800; text-decoration: none; }
.guide-links a:hover { background: #f1f4ff; }
.guide-note { padding: 12px 14px; border-left: 3px solid var(--blue); border-radius: 0 8px 8px 0; background: #f4f6ff; }
.guide-back { display: inline-flex; margin-top: 20px; color: var(--blue); font-size: 12px; font-weight: 800; text-decoration: none; }
.guide-back:hover { text-decoration: underline; }
.work-history { margin-top: 30px; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 12px 32px #2938580c; }
.history-heading { margin-bottom: 16px; }
.history-heading .eyebrow { margin-bottom: 7px; }
.history-heading h2 { margin: 0; color: #18233b; font-size: 21px; letter-spacing: -.025em; }
.history-heading > p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.history-list { display: grid; gap: 8px; }
.history-entry { overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: #fbfcff; }
.history-entry[open] { border-color: #cbd5ff; background: #fff; }
.history-entry summary { display: flex; min-height: 42px; align-items: center; gap: 12px; padding: 0 13px; color: #34415d; cursor: pointer; list-style: none; }
.history-entry summary::-webkit-details-marker { display: none; }
.history-entry summary::before { width: 7px; height: 7px; flex: 0 0 7px; border-right: 1.5px solid #68748a; border-bottom: 1.5px solid #68748a; content: ""; transform: rotate(-45deg); transition: transform .16s ease; }
.history-entry[open] summary::before { transform: rotate(45deg); }
.history-entry summary span { color: #26314a; font-size: 12px; font-weight: 850; }
.history-entry summary time { color: var(--muted); font-size: 11px; }
.history-entry summary b { margin-left: auto; padding: 4px 8px; border-radius: 999px; background: #eaf0ff; color: var(--blue); font-size: 9px; letter-spacing: .04em; }
.history-entry ul { display: grid; gap: 5px; margin: 0; padding: 0 16px 13px 49px; color: #58647b; font-size: 11px; line-height: 1.65; }
.history-entry li::marker { color: #7185e8; }
footer { display: flex; justify-content: space-between; gap: 14px; margin-top: 20px; color: var(--muted); font-size: 10px; }
footer a { color: var(--blue); font-weight: 750; text-decoration: none; }
footer a:hover { text-decoration: underline; }

@media (max-width: 620px) {
    .shell { width: min(100% - 24px, 940px); padding-top: 12px; }
    .intro { padding-top: 30px; }
    .toolbar { align-items: stretch; flex-direction: column; }
    .file-button { min-height: 40px; }
    .url-form { display: grid; grid-template-columns: 1fr auto; }
    .url-form label { grid-column: 1 / -1; }
    .url-form input { width: 100%; }
    .stage { min-height: 270px; }
    .stage canvas { max-height: 65vh; }
    .stage:fullscreen, .stage:fullscreen canvas { min-height: 100vh; }
    .player-actions { align-items: flex-start; flex-direction: column; padding: 12px 15px; }
    .player-actions > div { width: 100%; }
    .player-actions button { flex: 1; padding-inline: 5px; }
    .work-history { padding: 16px 12px; }
    .history-entry summary { gap: 8px; padding-inline: 10px; }
    .history-entry summary time { font-size: 10px; }
    .history-entry ul { padding-left: 42px; }
    footer { flex-direction: column; }
}
