/* GPlay Account-Menü v1.0.002: gleiche Kopfzeile für Portal, Store, Admin und Emulator */
.site-header { z-index: 30; }
.site-header .header-actions { min-width: 0; margin-left: auto; }
.site-header .session-tools { flex-wrap: nowrap; }
.account-menu { position: relative; display: inline-flex; min-width: 0; }
.account-trigger.user-pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 40px; max-width: min(45vw, 270px); padding: 7px 12px;
  border: 1px solid var(--line-strong, var(--line));
  border-radius: var(--radius-control, 8px); background: transparent;
  color: var(--text); cursor: pointer; font: 600 12px/1.4 var(--font-body, sans-serif);
  letter-spacing: 0; white-space: nowrap; overflow-wrap: normal;
}
.account-trigger .account-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-chevron { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; transition: transform .15s ease; }
.account-trigger[aria-expanded="true"] .account-chevron { transform: rotate(180deg); }
.account-trigger:hover, .account-trigger[aria-expanded="true"] { border-color: var(--accent); color: var(--text); background: var(--surface); }
.account-trigger:focus-visible, .account-action:focus-visible { outline: 3px solid var(--focus, var(--accent)); outline-offset: 2px; }
.account-popover {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 100;
  width: max-content; min-width: 196px; max-width: min(300px, calc(100vw - 24px));
  padding: 6px; border: 1px solid var(--line-strong, var(--line));
  border-radius: 12px; background: var(--bg-elevated, var(--surface));
  box-shadow: 0 16px 36px #0006;
}
.account-action {
  display: flex; align-items: center; width: 100%; gap: 9px;
  padding: 11px 12px; border: 0; border-radius: 8px;
  text-decoration: none; text-align: left; background: transparent;
  color: var(--text); font: 600 13px/1.4 var(--font-body, sans-serif);
}
.account-action:hover { background: var(--surface); color: var(--accent); }
.account-signout { border-top: 1px solid var(--line); margin-top: 4px; border-radius: 0 0 8px 8px; cursor: pointer; }
.account-feedback { margin: 5px 8px; color: var(--text); font-size: 12px; max-width: 260px; }
@media (max-width: 760px) {
  .site-header .account-trigger.user-pill { max-width: min(55vw, 260px); min-height: 44px; }
  .site-header .header-actions { justify-content: flex-end; }
  .site-header .session-tools { margin-left: auto; gap: 7px; }
  .account-popover { min-width: 180px; }
}
@media (max-width: 420px) {
  .site-header .account-trigger.user-pill { max-width: 52vw; }
}

/* Ältere Mobile-Regeln verstecken .user-pill und #signout pauschal.
   Im neuen Account-Menü müssen beide bewusst bedienbar bleiben. */
@media (max-width: 760px) {
  .arcade-portal .header-actions .account-trigger.user-pill { display: inline-flex; }
  .arcade-portal .portal-header #signout { display: flex; }
}

/* Standalone GPlay screens use the same compact identity, navigation and account actions.
   Game surfaces remain unobstructed: training iframe mode hides this utility shell. */
[data-gplay-header-root] { width: 100%; position: relative; z-index: 70; flex: none; }
.gplay-utility-shell {
  --bg: #060b11; --surface: #10202b; --bg-elevated: #0d1925;
  --line: #26394b; --line-strong: #36546a;
  --text: #eaf1fa; --muted: #9cb1c9; --accent: #36b7f5;
  --focus: #36b7f5; --radius-control: 8px;
  color: var(--text); background: var(--bg);
  border-bottom: 1px solid var(--line);
  font: 14px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
}
html[data-theme="light"] .gplay-utility-shell {
  --bg: #f6faff; --surface: #eaf2fb; --bg-elevated: #fff;
  --line: #bed1e4; --line-strong: #829fbb; --text: #142638;
  --muted: #4a647c; --accent: #096da8; --focus: #096da8;
}
.gplay-shared-header {
  max-width: 1400px; width: calc(100% - 32px); min-height: 72px;
  margin: 0 auto; padding: 9px 0; display: flex; align-items: center;
  gap: clamp(12px, 2.4vw, 30px); position: relative;
}
.gplay-shared-header .brand {
  display: inline-flex; align-items: center; flex-shrink: 0;
  gap: 10px; text-decoration: none; color: var(--text);
}
.gplay-shared-header .brand img {
  width: 42px; height: 42px; border-radius: 8px; object-fit: cover;
  background: #02060b; box-shadow: 0 0 0 1px var(--line-strong);
}
.gplay-shared-header .brand-copy { display: flex; flex-direction: column; gap: 3px; }
.gplay-shared-header .brand-copy strong { font: 650 16px/1.1 system-ui, sans-serif; letter-spacing: -.025em; color: var(--text); }
.gplay-shared-header .brand-copy strong span { color: var(--accent); }
.gplay-shared-header .brand-copy small { font: 700 8px/1.2 system-ui, sans-serif; letter-spacing: .16em; color: var(--muted); }
.gplay-shared-header .primary-nav { display: flex; align-items: center; gap: 7px; flex: 1; }
.gplay-shared-header .nav-link {
  display: inline-flex; align-items: center; min-height: 42px;
  border: 0; border-bottom: 2px solid transparent; padding: 9px 12px;
  border-radius: 0; background: transparent; color: var(--muted);
  text-decoration: none; white-space: nowrap; font-size: 12px; font-weight: 600;
}
.gplay-shared-header .nav-link:hover { color: var(--text); background: var(--surface); }
.gplay-shared-header .nav-link.current { border-bottom-color: var(--accent); color: var(--text); }
.gplay-shared-header .header-actions { display: flex; align-items: center; margin-left: auto; }
.gplay-shared-header .account-trigger.user-pill { color: var(--text); }
.gplay-shared-header .account-popover { background: var(--bg-elevated); }
.gplay-shared-header [hidden], .account-menu[hidden], .account-popover[hidden], .account-feedback[hidden] { display: none !important; }
.gplay-shared-header :focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.gplay-utility-shell + .lab-bar { flex: none; }
html.training [data-gplay-header-root] { display: none; }
@media(max-width:760px) {
  .gplay-shared-header { min-height: 59px; width: calc(100% - 24px); gap: 8px; }
  .gplay-shared-header .brand img { width: 36px; height: 36px; }
  .gplay-shared-header .brand-copy strong { font-size: 14px; }
  .gplay-shared-header .primary-nav { display: none; }
  .gplay-shared-header .account-trigger.user-pill { max-width: 46vw; }
}

/* v1.0.002 – Portalnavigation direkt in der oberen Leiste wie im Admin-Bereich. */
@media(min-width:761px) {
  .arcade-portal .portal-header { flex-wrap:wrap; row-gap: 7px; }
  .arcade-portal .portal-header .portal-sidebar {
    display:flex; flex:1 1 auto; position:static; min-width:0; width:auto;
    min-height:0; margin:0; padding:0; order:1;
    align-items:center; gap:3px; border:0;
  }
  .arcade-portal .portal-header .portal-sidebar .portal-nav-link {
    display:inline-flex; min-height:40px; white-space:nowrap;
    padding:9px clamp(8px,1.1vw,13px); font-size:12px;
  }
  .arcade-portal .portal-header .header-actions { order:2; flex:none; margin-left:auto; }
  .arcade-portal .portal-header .portal-search {
    order:3; flex:0 0 100%; width:min(100%,440px); max-width:440px;
    margin:0 0 8px;
  }
}
@media(max-width:760px) {
  .arcade-portal .portal-header .portal-sidebar { display:none !important; }
}
