/* base.css — V1 appearance. See DESIGN-HANDOVER.md. */


/* Foundations */

* {
  box-sizing:border-box;
}

body {
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font:var(--text-size)/var(--text-leading) var(--font-body);
}

a {
  color:var(--accent);
}

header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  padding:24px max(5vw,16px);
  border-bottom:1px solid #46506c;
  flex-wrap:wrap;
}

:is(body,.app-scroll)>header {
  gap:8px 16px;
  padding:10px max(5vw,16px);
  border-bottom:1px solid #ffffff1a;
}

.brand {
  font-weight:900;
  font-size:26px;
  text-decoration:none;
  letter-spacing:2px;
}

.brand small {
  display:block;
  font-size:10px;
  letter-spacing:4px;
  color:var(--subtle);
}

nav {
  display:flex;
  align-items:center;
  gap:22px;
  flex-wrap:wrap;
}

nav form {
  margin:0;
}

main {
  max-width:1160px;
  margin:auto;
  padding:40px 24px 80px;
}

h1 {
  font-size:var(--heading-size);
  line-height:var(--heading-leading);
  margin:10px 0 24px;
}

h2 {
  font-size:var(--heading-small-size);
}

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline:3px solid #fff;
  outline-offset:4px;
}

footer {
  color:var(--subtle);
}

footer {
  padding:24px;
  text-align:center;
  border-top:1px solid var(--border-color);
}

.home-legal {
  margin-top:24px;
  padding:0;
  border:0;
  text-align:right;
}
.home-legal a {
  display:inline-flex;
  align-items:center;
  min-height:44px;
  padding:0 4px;
  color:#a5a5ad;
  font-size:14px;
  text-decoration:none;
}
.home-legal a:hover, .home-legal a:focus-visible {
  text-decoration:underline;
}

.account-session-list { display:grid; gap:24px; padding-left:20px; }
.account-session-list button { margin-top:8px; }
.account-session-actions { display:flex; flex-wrap:wrap; gap:12px; margin-top:24px; }

.skip {
  position:absolute;
  left:-10000px;
}

.skip:focus {
  left:10px;
  top:10px;
  background:#111;
  padding:10px;
}

summary {
  cursor:pointer;
}

dd {
  margin-bottom:12px;
  overflow-wrap:anywhere;
}

form p {
  overflow-wrap:anywhere;
}

img {
  max-width:100%;
}

header .header-role-menus { display:flex; gap:16px; align-items:center; }
header .header-role-menus:not(:has(.staff-menu)) { display:none; }
@media(max-width:600px) {
header {
  padding:20px;
}

:is(body,.app-scroll)>header {
  padding:8px 12px;
  min-height:61px;
}


nav {
  gap:12px;
  font-size:14px;
}


main {
  padding:28px 16px;
}
}


/* Navigation and game views */

body:where(:not(.day-stage)) {
  padding-bottom:calc(108px + env(safe-area-inset-bottom));
}

/* Keep navigation in normal layout, outside the scrolling content. Mobile
   browser toolbar transitions must not reposition a fixed bottom layer. */
body.app-shell {
  height:100vh;
  height:100dvh;
  overflow:hidden;
  display:grid;
  grid-template-rows:minmax(0,1fr) auto;
  padding-bottom:0;
}
.app-scroll {
  min-height:0;
  overflow:auto;
  overscroll-behavior-y:contain;
  scroll-padding-block:16px 28px;
}
.app-scroll>main { padding-bottom:40px; }
.bottom-nav-viewport {
  position:relative;
  z-index:50;
}
.bottom-nav {
  /* Browser chrome already reserves the system navigation area. Only an
     installed/fullscreen app draws into that area and needs an extra inset. */
  --nav-bottom-inset:0px;
  position:relative;
  z-index:50;
  display:flex;
  flex-wrap:nowrap;
  align-items:center;
  height:calc(82px + var(--nav-bottom-inset));
  pointer-events:auto;
  gap:4px;
  background:#171d31;
  border-top:1px solid #66728f;
  padding:10px max(10px,calc((100vw - 840px)/2)) calc(10px + var(--nav-bottom-inset));
  box-shadow:0 -8px 24px #0004;
}

@media (display-mode:standalone), (display-mode:fullscreen) {
  .bottom-nav { --nav-bottom-inset:env(safe-area-inset-bottom,0px); }
}

.bottom-nav a {
  flex:1 1 0;
  min-width:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:3px;
  min-height:60px;
  color:var(--subtle);
  text-decoration:none;
  font-size:12px;
  white-space:nowrap;
}

.bottom-nav a>span:first-child {
  font-size:26px;
  line-height:30px;
}

.bottom-nav img {
  image-rendering:pixelated;
}

.bottom-nav a[aria-current=page] {
  color:var(--accent);
  font-weight:800;
}

.bottom-nav .scan-nav {
  flex:0 0 78px;
  background:var(--accent);
  color:#132208;
  border-radius:50%;
  width:78px;
  height:78px;
  justify-self:center;
  align-self:center;
  margin-top:-28px;
  box-shadow:0 0 0 7px #171d31;
  font-size:14px;
  font-weight:900;
}

.bottom-nav .scan-nav[aria-current=page] {
  color:#132208;
  outline:2px solid white;
}

.qr-image {
  display:block;
  max-width:min(100%,460px);
  height:auto;
  margin:24px auto;
  background:white;
  padding:16px;
}

.scan-video {
  width:100%;
  max-height:50vh;
  object-fit:cover;
  border-radius:var(--radius-control);
}

.scan-tools {
  display:flex;
  gap:12px;
  flex-wrap:wrap;
}

.scan-status {
  min-height:2em;
}

.scan-manual input {
  width:100%;
}

[hidden] {
  display:none!important;
}

@media(max-width:600px) {
.bottom-nav a {
  font-size:10px;
}


.bottom-nav .scan-nav {
  flex-basis:70px;
  width:70px;
  height:70px;
}
}


/* Public event presentation */

.flash {
  display:flex;
  align-items:flex-start;
  gap:14px;
  padding:20px 24px;
  margin:0 0 24px;
  border:2px solid #8896b0;
  border-radius:var(--radius-control);
  background:#242d45;
  font-weight:650;
  overflow-wrap:anywhere;
}

.flash-icon {
  font-size:25px;
  line-height:1.2;
}

.flash.success {
  border-color:#a7f36b;
  background:#203529;
}

.flash.success .flash-icon {
  color:#a7f36b;
}

.flash.error {
  border-color:#ff8c8c;
  background:#40272e;
  color:#fff;
}

.flash.warning {
  border-color:#ffc877;
  background:#393025;
}

.flash p {
  margin:0;
}

.flash small {
  display:block;
  font-weight:400;
  margin-top:5px;
}

@media(max-width:650px) {
.flash {
  padding:16px;
}
}


/* Museum and visitor orientation */

body:has(.intro-scan) .scan-nav {
  outline:3px solid #fff;
  outline-offset:5px;
}

/* Compact common header; keep all role-dependent navigation in the template. */
header .header-actions {
  gap:8px;
  min-width:0;
  margin-left:auto;
}

header .header-actions>.button,
header .header-actions>form>button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:44px;
  padding:9px 12px;
  border-radius:var(--radius-control);
  font-size:.875rem;
  line-height:1.4;
  text-align:center;
  text-decoration:none;
  white-space:normal;
}

header .header-secondary {
  background:#a7f36b0d;
  color:var(--accent);
  border:1px solid #a7f36b59;
}

header .header-actions>form>button {
  background:#ffffff0d;
  color:var(--ink);
  border:1px solid #ffffff40;
}

header .header-actions>form {
  margin:0;
}

header .brand {
  display:flex;
  align-items:center;
  flex-shrink:0;
  min-height:44px;
  line-height:1;
}

header .brand-logo {
  display:block;
  width:136px;
  height:auto;
  max-width:100%;
  object-fit:contain;
}

@media(max-width:600px) {
  header .brand-logo { width:108px; }
  header .header-actions { gap:6px; }
  :is(body,.app-scroll)>header:has(.header-primary) { flex-wrap:nowrap; gap:8px; padding-inline:12px; }
  header:has(.header-primary) .brand { flex-shrink:0; min-width:108px; }
  header:has(.header-primary) .brand-logo { width:108px; }
  header:has(.header-primary) .header-actions { flex-wrap:nowrap; flex-shrink:0; }
  header:has(.header-primary) .header-actions>.button { padding-inline:8px; font-size:.8125rem; white-space:nowrap; }
  :is(body,.app-scroll)>header:has(.staff-menu) {
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:6px;
  }
  header .header-actions:has(.staff-menu) { display:contents; }
  header:has(.account-menu) .brand-logos { grid-column:1; grid-row:1; }
  header .header-actions>.account-menu { grid-column:2; grid-row:1; justify-self:end; }
  header .header-actions:has(.staff-menu)>.button { grid-column:2; grid-row:1; }
  header .header-actions:has(.staff-menu)>form { grid-column:3; grid-row:1; }
  header .header-role-menus {
    grid-column:1/-1;
    grid-row:2;
    min-width:0;
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:0 12px;
  }
  header .header-role-menus>.staff-menu { display:contents; }
  header .header-role-menus>.staff-menu[open]::details-content { display:contents; }
  header .header-role-menus>.staff-menu:not([open])::details-content { display:none; }
  header .header-role-menus>.staff-menu>summary { grid-row:1; min-height:44px; }
  header .header-role-menus>.staff-menu:has(nav[aria-label="Plattformverwaltung"])>summary { grid-column:2; text-align:right; }
  header .header-role-menus>.staff-menu>nav {
    grid-column:1/-1;
    grid-row:2;
    justify-self:start;
    position:static;
    width:max-content;
    max-width:100%;
    min-width:0;
  }
}

@media(max-width:600px) {
  header .header-role-menus>.staff-menu>nav[aria-label="Plattformverwaltung"] { justify-self:end; }
}

/* Public Pixelpokal shortcut remains beside the museum brand. */
header .brand-logos {
  display:flex;
  align-items:center;
  gap:12px;
  flex-shrink:0;
  min-width:max-content;
}
header .pixel-header-link {
  display:flex;
  align-items:center;
  justify-content:center;
  width:52px;
  height:52px;
  flex-shrink:0;
  border-radius:var(--radius-chip);
}
header .pixel-header-link img {
  display:block;
  width:100%;
  height:100%;
  object-fit:contain;
}

@media(max-width:600px) {
  header .brand-logos { gap:8px; }
  header .pixel-header-link { width:48px; height:48px; }
  :is(body,.app-scroll)>header.has-pixel-header { flex-wrap:nowrap; }
  header.has-pixel-header .header-actions { flex-wrap:nowrap; }
  header.has-pixel-header .header-scores,
  header.has-pixel-header .header-actions>form { flex-shrink:0; }
  header.has-pixel-header .header-scores { display:none; white-space:nowrap; }
  header.has-pixel-header.pixel-header-fits .header-scores,
  header.has-pixel-header.pixel-header-measuring .header-scores { display:inline-flex; }
  header.has-pixel-header:has(.header-primary) .header-actions {
    flex-shrink:1;
    flex-wrap:wrap;
    justify-content:flex-end;
  }
  header.has-pixel-header:has(.header-primary) .header-actions>.button {
    white-space:normal;
  }
}

.brand-name {
  white-space:nowrap;
  hyphens:none;
  overflow-wrap:normal;
  word-break:normal;
}

/* Accepted compact layouts */

#scan-status:empty {
  min-height:0;
  margin:8px 0;
}

.scan-manual button {
  margin-top:16px;
}

.scan-manual label {
  display:block;
  margin-bottom:8px;
}

html {
  scroll-padding-bottom:calc(128px + env(safe-area-inset-bottom));
}

/* Shared notifications retain success/error colors and readable message structure. */
:is(body,.app-scroll)>main>.flash { border-radius:var(--ci-radius); font-size:1rem; line-height:1.55; box-shadow:none; }
