:root {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: #e8eafa;
  background: #0d1023;
  color-scheme: dark;
  --gold: #e5c48d;
  --muted: #a9aecb;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(ellipse at 50% 10%, #38345666, transparent 65%); }
header, main, footer { width: min(100% - 16px, 432px); margin: auto; }
header { display: flex; align-items: center; justify-content: space-between; min-height: 56px; padding: 8px 0; }
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand img { display: block; width: auto; height: 40px; max-width: 180px; object-fit: contain; }
select { padding: 4px; border: 1px solid #414761; border-radius: 4px; background: #1b2038; color: #e8eafa; font: inherit; font-size: 14px; max-width: 170px; }
main { padding: 8px 16px 32px; }
h1 { margin: 0 0 8px; font-size: 30px; font-weight: 800; line-height: 1.3; letter-spacing: -1px; text-align: center; color: var(--gold); }
h2 { font-size: 18px; margin: 0 0 12px; }
.subtitle { margin: 0 0 12px; font-size: 14px; text-align: center; color: var(--muted); line-height: 1.65; }
.portal { position: relative; display: grid; place-items: center; width: 208px; height: 208px; margin: 0 auto 16px; overflow: hidden; border: 1px solid #e5c48d55; border-radius: 24px; background: radial-gradient(ellipse, #c7b0e433, transparent 70%); box-shadow: 0 8px 32px #cbb1ff12; }
.portal::before { content: '✧'; font-size: 112px; color: var(--gold); text-shadow: 0 0 40px #dbbcf3; }
.portal img { position: absolute; width: 100%; height: 100%; object-fit: contain; background: #14182a; }
.upload-guide { max-width: 320px; margin: 0 auto 16px; padding: 12px 16px; border: 1px solid #363d56; border-radius: 16px; background: #1b2034bb; color: var(--muted); text-align: left; font-size: 12px; line-height: 1.6; }
.upload-guide p { margin: 0; }
.upload-guide p + p { margin-top: 6px; }
.upload-controls { width: 100%; max-width: 320px; margin: auto; }
input[type=file] { display: block; width: 100%; min-height: 44px; margin-bottom: 12px; padding: 8px 12px; border: 1px solid #414761; border-radius: 12px; background: #1b2038; color: #e8eafa; font: inherit; font-size: 13px; }
input[type=file]::file-selector-button { margin-right: 10px; padding: 5px 9px; border: 0; border-radius: 5px; background: #343d58; color: #e8eafa; font: inherit; cursor: pointer; }
button, .button { display: block; width: 100%; max-width: 320px; min-height: 48px; margin: 0 auto; padding: 12px 24px; border: 1px solid transparent; border-radius: 999px; background: var(--gold); color: #25213b; font: inherit; font-weight: 600; text-decoration: none; text-align: center; line-height: 1.5; cursor: pointer; transition: background .15s, opacity .15s; }
button:hover:not(:disabled), .button:hover { background: #efd5aa; }
button:disabled { opacity: .4; cursor: not-allowed; }
.secondary { margin-top: 12px; border-color: #4a5476; background: #2d3550; color: #e6e9f7; }
.secondary:hover:not(:disabled) { background: #3c4765; }
.row { display: flex; flex-direction: column; gap: 12px; }
.row .secondary { margin-top: 0; }
.card { margin: 16px 0; padding: 20px; border: 1px solid #363d56; border-radius: 16px; background: #1b2034bb; }
.notice { color: var(--muted); font-size: 12px; line-height: 1.8; }
.info-details { max-width: 320px; margin: 16px auto 0; font-size: 12px; }
details summary { cursor: pointer; color: var(--muted); font-size: 13px; }
ol { padding-left: 20px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.recommendations { margin-top: 24px; padding-top: 20px; border-top: 1px solid #363d56; }
.recommendations h2 { font-size: 14px; color: var(--muted); }
nav { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; font-size: 12px; }
a { color: #b6c7ff; }
footer { padding: 0 0 24px; color: var(--muted); text-align: center; font-size: 11px; }
#status { min-height: 20px; margin: 12px 0 0; color: var(--gold); text-align: center; font-size: 13px; line-height: 1.6; }
.portrait { display: block; width: 100%; height: 310px; max-height: 310px; object-fit: contain; border-radius: 12px; background: #10162b; }
.badge { display: inline-block; padding: 5px 10px; border: 1px solid #80704c; border-radius: 999px; color: var(--gold); font-size: 11px; }
.center { text-align: center; }
.score { margin: 8px; color: var(--gold); font-size: 42px; font-weight: 800; }
.measurement { display: grid; grid-template-columns: 1fr auto; gap: 5px; margin: 17px 0; font-size: 13px; }
.measurement meter { width: 100%; height: 8px; grid-column: 1 / -1; }
p { line-height: 1.8; }
#twist { border-color: #d6bb82; animation: reveal .4s ease; }
#twist p:first-of-type { color: #f0d5a6; font-size: 19px; }
#loading { width: 32px; height: 32px; margin: 16px auto; border: 2px solid #424864; border-top-color: var(--gold); border-radius: 50%; animation: spin 1s linear infinite; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #a8c5ff; outline-offset: 4px; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes reveal { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (max-width: 359px) { main { padding-right: 8px; padding-left: 8px; } h1 { font-size: 27px; } .brand img { max-width: 140px; } select { max-width: 150px; } }

.entertainment-note { max-width:320px; margin:12px auto 0; text-align:center; font-size:11px; }
