/* Shared atelier UI; world art and illustrated inventory retain their own palette. */
:root {
  --atelier-paper: #fff9e8;
  --atelier-ink: #243f49;
  --atelier-muted: #536e70;
  --atelier-line: #91b3af;
  --atelier-gold: #f1d37e;
  --atelier-frame: inset 0 0 0 2px #fffef7, inset 0 0 0 5px #abc4b8, 0 4px 0 #182f38, 0 10px 24px #142a3430;
}
html { color-scheme: light; }
button, input { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid #36859a; outline-offset: 3px;
}
#hud-buttons { top: 14px; right: 16px; gap: 8px; }
.hud-btn {
  position: relative; width: 56px; height: 56px; min-height: 56px; padding: 6px; gap: 0;
  display: grid; place-items: center;
  color: var(--atelier-ink); background: var(--atelier-paper);
  border: 2px solid var(--atelier-ink); border-radius: 8px;
  box-shadow: inset 0 0 0 2px #fffef7, 0 3px 0 #182f38;
  font-size: 0;
}
.hud-btn img { width: 42px; height: 42px; image-rendering: pixelated; }
.hud-btn span { display: none; }
.hud-btn kbd { color: var(--atelier-muted); font: 11px system-ui; border: 1px solid #a6b9af; border-radius: 3px; padding: 1px 4px; }
.hud-btn kbd { position: absolute; right: -5px; bottom: -7px; background: var(--atelier-paper); font-size: 9px; line-height: 13px; padding: 0 3px; }
.hud-btn:hover { background: #fae8ad; filter: none; }
.hud-btn:active { transform: translateY(2px); box-shadow: inset 0 0 0 2px #fffef7; }
#story-day-bar {
  top: 16px; left: 16px; transform: none; max-width: calc(100vw - 450px);
  min-height: 44px; padding: 5px 8px 5px 12px;
  background: var(--atelier-ink); border: 2px solid #142f38; border-radius: 8px;
  box-shadow: inset 0 0 0 1px #597978, 0 3px 0 #182f38;
}
#story-day-current { color: #fff4ce; font: 600 13px/1.4 system-ui; }
#story-day-change { min-height: 30px; padding: 6px 9px; background: var(--atelier-gold); border-color: #142f38; border-radius: 4px; }
#hud {
  top: auto; bottom: 20px; left: 158px; max-width: min(540px, calc(100vw - 185px));
  background: #243f49ed; color: #fff9e8; border: 1px solid #91b3af;
  padding: 9px 13px; font-size: 13px; border-radius: 7px;
}
#hud:empty { display: none; }
.app-version { font: 10px system-ui; color: #fff9e8; background: #243f49bd; border-radius: 4px; z-index: 40; }
#minimap { border-color: var(--atelier-ink); }
#step-panel {
  top: 76px; right: 16px; width: 236px; padding: 14px;
  background: var(--atelier-paper); border: 2px solid var(--atelier-ink);
  border-radius: 10px; box-shadow: var(--atelier-frame);
}
#step-panel h3 { color: var(--atelier-ink); font-size: 14px; text-shadow: none; margin-bottom: 5px; }
#step-panel .step-sub { color: var(--atelier-muted); font-size: 12px; line-height: 1.5; font-style: normal; }
#step-panel li { line-height: 1.5; color: var(--atelier-ink); }
#step-panel li.locked { opacity: .75; }
#step-panel footer { color: var(--atelier-muted); line-height: 1.5; }
#hud-modal-backdrop, #auth-overlay { background: #132e3b99; padding: 16px; }
#hud-modal:not(.backpack-modal), #auth-box, #story-day-box {
  background: var(--atelier-paper); color: var(--atelier-ink);
  border: 3px solid var(--atelier-ink); border-radius: 12px;
  box-shadow: var(--atelier-frame); padding: 28px;
  min-width: 0; max-height: calc(100dvh - 32px);
  scrollbar-width: thin; scrollbar-color: #789994 #f2eddb;
}
#hud-modal:not(.backpack-modal) { width: min(640px, 100%); }
#hud-modal h2, #auth-box h3 {
  color: var(--atelier-ink); text-shadow: none; border-bottom: 2px solid #adc3b7;
  padding: 0 38px 15px 0; line-height: 1.7; margin-bottom: 18px;
}
#hud-modal-close { width: 36px; height: 36px; top: 12px; right: 12px; border-radius: 6px; border: 2px solid #243f49; background: #e3ebdf; color: #243f49; box-shadow: none; }
#hud-modal-close:hover { background: #f1d37e; }
#hud-quest-list { gap: 10px; }
#hud-quest-list li { padding: 14px; background: #f1f0df; border: 1px solid #c5d2bf; border-radius: 7px; box-shadow: none; line-height: 1.5; }
#hud-quest-list li.active { border: 2px solid #52877e; background: #e3edda; color: #214d45; }
#hud-quest-list li.open { color: #536565; }
#hud-quest-list li.done { color: #3f6b43; }
#hud-quest-empty, #hud-char-progress { color: var(--atelier-muted); line-height: 1.6; }
#hud-char-sprite { margin: 6px auto 20px; filter: drop-shadow(0 5px 0 #243f4920); }
#hud-char-name-row { flex-wrap: wrap; }
#hud-char-name-row input, #auth-box input { min-width: 0; max-width: 100%; color: var(--atelier-ink); background: #fffef6; border: 2px solid #8ca8a2; border-radius: 6px; box-shadow: inset 0 2px 0 #243f4910; padding: 10px; }
#hud-char-name-row button, #auth-box button { border-radius: 5px; min-height: 40px; }
#hud-progress-track { margin-top: 12px; height: 14px; border: 2px solid #799b91; border-radius: 6px; background: #e3e8d8; box-shadow: none; }
#hud-progress-fill { background: #508a74; }
#auth-box label { color: var(--atelier-muted); }
#story-day-overlay { background: radial-gradient(ellipse at top, #385e60, #132c37 80%); }
#story-day-box { width: min(850px, 100%); }
#story-day-box::before { content: 'MAISON LUMIÈRE'; display: block; color: #547b70; font: 10px/1.8 'Press Start 2P', monospace; letter-spacing: 2px; margin-bottom: 12px; }
#story-day-box h2 { color: var(--atelier-ink); font-size: 15px; line-height: 1.8; }
#story-day-box p { color: var(--atelier-muted); line-height: 1.65; }
#story-day-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.story-day-card { padding: 16px; background: #f5f2df; color: var(--atelier-ink); border: 2px solid #b5c6b7; border-radius: 8px; box-shadow: 0 3px 0 #cbd3bf; min-height: 108px; }
.story-day-card:hover, .story-day-card:focus { background: #e4edda; outline-color: #4c817b; }
.story-day-card.selected { border-color: #437b70; background: #e4edda; }
.story-day-date { color: #4a7469; font: 600 12px system-ui; margin-bottom: 8px; }
.story-day-card strong { font-size: 10px; line-height: 1.7; }
.story-day-card small { color: var(--atelier-muted); line-height: 1.5; }
#hud-modal.backpack-modal { border-radius: 12px; min-width: 0; width: min(860px, 100%); padding-top: 56px; }
@media (max-width: 760px) {
  #hud-buttons { top: 66px; right: 12px; left: auto; justify-content: flex-end; gap: 8px; }
  .hud-btn { flex: 0 0 52px; width: 52px; height: 52px; min-width: 52px; min-height: 52px; }
  .hud-btn img { width: 38px; height: 38px; }
  .hud-btn kbd { display: none; }
  #story-day-bar { top: 12px; left: 12px; right: 12px; max-width: none; justify-content: space-between; }
  #step-panel { top: 124px; right: 12px; width: 210px; max-height: min(28dvh, 220px); }
  #step-panel .step-sub, #step-panel footer { display: none; }
  #hud { left: 12px; bottom: 154px; max-width: calc(100vw - 24px); }
  #story-day-box, #hud-modal:not(.backpack-modal), #auth-box { padding: 22px; }
  #story-day-list { grid-template-columns: 1fr; }
  #story-day-box h2 { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  #step-panel li.active .st-num { animation: none; }
  #hud-progress-fill { transition: none; }
}
#hud-sec-account { margin-top: 24px; }
#hud-account-info { color: var(--atelier-muted); }
#hud-account-info .acc-name { color: #315f51; }
#hud-account-actions button {
  padding: 10px 14px; min-height: 40px; background: var(--atelier-gold);
  color: var(--atelier-ink); border: 2px solid var(--atelier-ink); border-radius: 5px;
  font: 600 14px system-ui; cursor: pointer;
}
