:root { --base:#07060a; --surface:#110e17; --line:#2b2433; --text:#ede9f2; --muted:#a39cae; --accent:#a374ff; --crimson:#e0163f; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--base); color: var(--text);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
#stage { position: fixed; inset: 0; overflow: hidden; }
#unity-canvas { width: 100%; height: 100%; display: block; background: var(--base); outline: none; }
.panel { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(520px, calc(100% - 32px));
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px; text-align: center;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .45); }
.panel h1 { font-size: 22px; margin: 12px 0 8px; text-wrap: balance; }
.panel p { color: var(--muted); margin: 8px 0; line-height: 1.6; }
.panel a { color: var(--accent); }
.bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin: 16px 0; }
#bar-fill { height: 100%; width: 0; background: var(--accent); transition: width .2s ease-out; }
#loading-pct { font-variant-numeric: tabular-nums; }
.notes { text-align: left; color: var(--muted); font-size: 14px; line-height: 1.7; padding-left: 18px; margin: 0; }
kbd { border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; font-size: 12px; }
#toolbar { position: absolute; right: 12px; bottom: 10px; display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); }
#toolbar button { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 12px; min-height: 32px; font: inherit; cursor: pointer; transition: border-color .12s ease-out; }
#toolbar button:hover { border-color: var(--accent); }
#toolbar button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#input-mode.raw { color: #4cff88; }
#input-mode.adjusted { color: #ffc861; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { #bar-fill, #toolbar button { transition: none; } }

/* ---- account dialog (account.js) ---- */
#account-backdrop { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; padding: 16px;
  background: rgba(8, 10, 14, .62); }
#account-dialog { width: min(440px, 100%); max-height: calc(100% - 32px); overflow: auto; background: var(--surface);
  border: 1px solid var(--line); border-radius: 16px; padding: 24px; box-shadow: 0 24px 64px rgba(0, 0, 0, .45);
  color: var(--text); font-size: 14px; line-height: 1.6; outline: none; animation: account-in .16s ease-out; }
@keyframes account-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.account-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.account-head h2 { font-size: 18px; margin: 0; }
.account-lead, .account-note { color: var(--muted); margin: 8px 0; }
.account-hint { color: var(--muted); font-weight: 400; }
.account-alert { border: 1px solid #ffc861; color: #ffc861; border-radius: 8px; padding: 8px 12px; margin: 12px 0; }
.account-msg { min-height: 1.6em; margin: 8px 0; color: var(--text); }
.account-msg.error { color: #ff8a8a; }
.account-msg.error::before { content: "⚠ "; }
.account-view { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.account-view label { font-weight: 600; }
.account-view label.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; cursor: pointer; }
.account-view label.check input { margin-top: 4px; width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.account-view a { color: var(--accent); }
.account-who { font-size: 16px; margin: 4px 0 0; }
#account-me-name { font-weight: 700; }
.account-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.account-danger { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; display: flex; flex-direction: column; gap: 8px; }
.account-danger label { font-weight: 400; color: var(--muted); }
#account-dialog input[type="text"] { background: var(--base); color: var(--text); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; min-height: 36px; font: inherit; min-width: 0; }
.account-row input[type="text"] { flex: 1 1 140px; }
#account-dialog button { background: var(--base); color: var(--text); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 14px; min-height: 36px; font: inherit; cursor: pointer; transition: border-color .12s ease-out, opacity .12s ease-out; }
#account-dialog button:hover:not(:disabled) { border-color: var(--accent); }
#account-dialog button.primary { background: var(--accent); border-color: var(--accent); color: #0f1218; font-weight: 700; }
#account-dialog button.danger { border-color: #ff8a8a; color: #ff8a8a; }
#account-dialog button.ghost { background: transparent; }
#account-dialog button.link { background: none; border: 0; padding: 0; min-height: 0; color: var(--accent); text-decoration: underline; }
#account-dialog button:disabled { opacity: .5; cursor: not-allowed; }
#account-dialog :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#account-dialog[aria-busy="true"] { cursor: progress; }
@media (prefers-reduced-motion: reduce) { #account-dialog { animation: none; } #account-dialog button { transition: none; } }
#account-open:disabled { opacity: .55; cursor: not-allowed; }
