:root{
  /* Darkmode + warmes Heimatlichter-Feeling (gold/amber Akzent) */
  --bg: #0b0d10;
  --panel: #12151b;
  --panel2:#0f1217;
  --text:#e8e8ea;
  --muted:#a7abb5;

  --accent:#d7a24a;
  --accent2:#b47a1d;

  --border: rgba(255,255,255,.10);
  --shadow: 0 10px 30px rgba(0,0,0,.35);

  --bar-h: 86px;
  --btn-h: 56px;
  --radius: 3px;
  --focus: 0 0 0 3px rgba(215,162,74,.35);
}

* { box-sizing: border-box; }
html, body { height: 100%; width: 100%; margin: 0; background: var(--bg); color: var(--text); }
body { font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", sans-serif; overflow: hidden; }

.app{
  height: 100vh;
  width: 100vw;
  display: grid;
  grid-template-rows: var(--bar-h) 1fr;
  background: radial-gradient(1200px 500px at 50% -40%, rgba(215,162,74,.18), transparent 60%), var(--bg);
}

/* TOPBAR */
.topbar{
  height: var(--bar-h);
  display: grid;
  grid-template-columns: 220px 1fr 80px;
  align-items: center;
  padding: 12px 18px;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(18,21,27,.92), rgba(12,14,18,.92));
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

/* LOGO left */
.brand{
  display: flex;
  align-items: center;
  min-width: 0;
  color: #fff;
}
.brand-logo{
  height: 38px;
  width: auto;
  max-width: 200px; /* optional */
  display: block;
  object-fit: contain;
  /* "weiß färben" ohne Bildbearbeitung */
  filter: brightness(0) invert(1);
  opacity: .95;
  user-select: none;
  -webkit-user-drag: none;
}

.brand-btn{
  background: transparent;
  border: 1px solid transparent;
  padding: 6px 8px;
  border-radius: var(--radius);
  cursor: pointer;
}
.brand-btn:focus-visible{
  outline: none;
  box-shadow: var(--focus);
  border-color: rgba(215,162,74,.35);
}

/* NAV center */
.nav{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 0;
}
.nav-row{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 0;
  flex: 0 1 auto;
  overflow: hidden;
  white-space: nowrap;
}

/* Buttons */
.btn{
  height: var(--btn-h);
  padding: 0 18px;
  border-radius: calc(var(--radius) + 6px);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  color: var(--text);
  font-size: 18px;
  font-weight: 650;
  letter-spacing: .2px;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  box-shadow: 0 6px 16px rgba(0,0,0,.25);
  transition: transform .08s ease, background .15s ease, border-color .15s ease;
  outline: none;
  white-space: nowrap;
}
.btn:active{ transform: translateY(1px) scale(.99); }
.btn:focus-visible{ box-shadow: var(--focus), 0 6px 16px rgba(0,0,0,.25); }

.btn.active{
  border-color: rgba(215,162,74,.55);
  background: linear-gradient(180deg, rgba(215,162,74,.22), rgba(215,162,74,.10));
  box-shadow: 0 10px 24px rgba(215,162,74,.18), 0 6px 16px rgba(0,0,0,.25);
}

.btn-primary{
  border-color: rgba(215,162,74,.55);
  background: linear-gradient(180deg, rgba(215,162,74,.28), rgba(215,162,74,.14));
}
.btn-secondary{
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.025));
}

/* Dropdown */
.dropdown{ position: relative; flex: 0 0 auto; }
.dropdown-toggle{ display: inline-flex; align-items: center; gap: 10px; }
.chev{ opacity: .9; }

.dropdown-menu{
  position: absolute;
  top: calc(var(--btn-h) + 10px);
  right: 0;
  min-width: 260px;
  background: linear-gradient(180deg, rgba(18,21,27,.98), rgba(12,14,18,.98));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 8px;
  display: none;
  z-index: 1000;
}
.dropdown-menu.open{ display: block; }

.dropdown-item{
  width: 100%;
  text-align: left;
  height: 54px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  font-weight: 650;
  padding: 0 14px;
  cursor: pointer;
}
.dropdown-item:hover{
  background: rgba(215,162,74,.10);
  border-color: rgba(215,162,74,.25);
}
.dropdown-item:focus-visible{
  outline: none;
  box-shadow: var(--focus);
}

/* Right */
.right{ display: flex; align-items: center; justify-content: flex-end; }
.icon-btn{
  height: 56px;
  width: 56px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255,255,255,.03);
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 16px rgba(0,0,0,.25);
}
.icon-btn svg{ fill: currentColor; opacity: .95; }
.icon-btn:active{ transform: translateY(1px) scale(.99); }
.icon-btn:focus-visible{ outline: none; box-shadow: var(--focus), 0 6px 16px rgba(0,0,0,.25); }

/* IFRAME */
.frame-wrap{
  min-height: 0; /* IMPORTANT for grid/flex: prevent overflow */
  width: 100%;
  height: 100%;
  background: var(--bg);
}
#kioskFrame{
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: var(--bg);
}

/* MODAL */
.modal-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 2000;
}
.modal{
  width: min(900px, 96vw);
  max-height: min(78vh, 860px);
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(18,21,27,.98), rgba(12,14,18,.98));
  box-shadow: var(--shadow);
  display: grid;
  grid-template-rows: auto 1fr auto;
}
.modal-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 10px 18px;
  border-bottom: 1px solid var(--border);
}
.modal-head h2{
  margin: 0;
  font-size: 18px;
  letter-spacing: .3px;
}
.modal-body{
  padding: 16px 18px 18px 18px;
  overflow: auto;
}
.modal-foot{
  padding: 14px 18px 18px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}

.modal.modal-idle{
  width: min(520px, 92vw);
  max-height: none;
}

.muted{ color: var(--muted); margin-top: 0; }

/* Cards */
.card{
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  background: rgba(255,255,255,.03);
}
.card h3{ margin: 0 0 8px 0; font-size: 16px; }
.card p{ margin: 0; color: var(--muted); line-height: 1.35; }

@media (max-width: 980px){
  :root{ --bar-h: 78px; --btn-h: 52px; }
  .topbar{ grid-template-columns: 180px 1fr 72px; }
  .btn{ font-size: 16px; }
}

/* Fallback: garantiert, dass hidden wirklich unsichtbar ist */
[hidden] { display: none !important; }

/* --- Modal Title: Icon + Headline inline --- */
.modal-title-row {
  display: flex;
  align-items: center;
}

.modal-title-inline {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.modal-title-ico {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  font-size: 22px; /* für emoji fallback */
  color: var(--text);
}

.modal-title {
  margin: 0;
  font-size: 20px;
  letter-spacing: .2px;
}

/* --- Start Modal body --- */
.start-hero {
  text-align: center;
  padding: 6px 0 14px 0;
}

.start-hero-title {
  font-size: 44px;
  line-height: 1.05;
  font-weight: 850;
  letter-spacing: .2px;
}

.start-hero-sub {
  margin-top: 10px;
  font-size: 20px;
  color: var(--muted);
}

.start-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 10px;
}

/* --- Help Grid Layout (columns grouped by wrapper) --- */
/*
  Idee:
  - Du umrahmst Cards, die zusammen in eine Spalte sollen, mit <div class="help-col">...</div>.
  - help-grid hat genau 3 Spalten (help-col Elemente).
  - In jeder help-col stapeln sich die cards vertikal.
*/
.help-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 10px;
  align-items: start;
}

/* Wrapper für eine Spalte */
.help-col{
  display: grid;
  gap: 12px;
  align-content: start;
}

/* Responsive: bei schmalen Screens stapeln */
@media (max-width: 980px) {
  .start-grid,
  .help-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Center buttons in footer --- */
.modal-foot.center {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* =========================
   KIOSK: SVG Icons (as <img>) – uniform + white
   ========================= */
.svg-icon{
  display: block;
  width: 54px;
  height: 54px;
  user-select: none;
  -webkit-user-drag: none;

  /* Makes black/monochrome SVGs white in dark mode */
  filter: invert(1) brightness(1.15) contrast(1.05);
}

/* optional sizes */
.svg-icon--lg{ width: 54px; height: 54px; }
.svg-icon--md{ width: 46px; height: 46px; }
.svg-icon--sm{ width: 34px; height: 34px; }

/* Inline SVG (magnifier) */
.svg-icon-stroke{
  width: 54px;
  height: 54px;
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* =========================
   Help-Modal: One-finger gestures tiles (text under icon)
   ========================= */
.gesture-grid{
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.gesture-grid img {
  width: 30px;
  height: auto;
}

.gesture-grid.gesture-grid-2{
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.gesture-grid.gesture-grid-2 img {
  width: 45px;
  height: auto;
}

.gesture-tile{
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 10px;
  background: rgba(255,255,255,.03);

  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}

.gesture-label{
  font-size: 10px;
  font-weight: 800;
  color: var(--text);
}

.gesture-sub{
  font-size: 11px;
  color: var(--muted);
  line-height: 1.2;
}

/* on smaller screens wrap */
@media (max-width: 980px){
  .gesture-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* --- Zoom row --- */
.zoom-row {
  margin-top: 14px;
  display: flex;
  justify-content: space-evenly;
  gap: 14px;
  flex-wrap: wrap;
}

.zoom-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 120px;
}

.zoom-label {
  font-weight: 700;
  color: var(--text);
}

#idleDebug {
  display: none !important;
}