/* Edahnien CSS — autogeneriert aus edahnien.css */

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE & TABLET
   Breakpoints: 768px (Tablet/Landscape), 480px (Portrait-Phone)
   Landscape-Phone: max-height 500px + orientation:landscape
   ═══════════════════════════════════════════════════════════════════ */

/* ── 768px: Tablet + Landscape-Phone ──────────────────────────────── */
@media (max-width: 768px) {

  /* ── Info/Interactive Layout ────────────────────────────────────── */

  /* Town-Grid: nav-col ausblenden, 2-Spalten → 1-Spalte */
  .town-grid {
    grid-template-columns: 1fr !important;
    padding: 0 12px 60px;
    gap: 12px;
  }
  /* Nav-Spalte: Drawer (von links einfahrbar) */
  .town-col.nav-col {
    position: fixed;
    top: 0;
    left: -270px;
    width: 250px;
    height: 100vh;
    z-index: 300;
    background: var(--panel-bg, #0e1a14);
    border-right: 1px solid var(--line);
    overflow-y: auto;
    overflow-x: hidden;
    white-space: normal;
    padding: 72px 0 24px;
    transition: left 0.25s ease;
    /* verhindert sticky oben */
    top: 0;
  }
  body.nav-open .town-col.nav-col {
    left: 0;
  }
  .town-col.nav-col .navhead { display: block; padding: 12px 16px 4px; }
  .town-col.nav-col a.nav    { display: block; padding: 6px 16px; }
  .town-col.nav-col .navhelp { display: block; font-size: 11px; padding: 4px 16px 12px; }

  /* Nav-Overlay: abdunkelnde Fläche wenn Drawer offen */
  .nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 299;
  }
  body.nav-open .nav-overlay {
    display: block;
  }

  /* Hamburger-Button: sichtbar auf Mobile */
  .nav-hamburger {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 32px;
    height: 22px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
  }
  .nav-hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--jade, #3a7a5a);
    border-radius: 2px;
    transition: background 0.2s;
  }
  .nav-hamburger:hover span { background: var(--jade-light, #5aaa8a); }

  /* Stats-Spalte ganz nach unten */
  .town-col.stats-col { order: 3; }
  .town-col.content-col { order: 2; }

  /* Char-Card: kompakter */
  .char-card { padding: 14px; margin-bottom: 10px; position: static; top: unset; }
  .char-head { gap: 10px; margin-bottom: 14px; padding-bottom: 12px; }
  .char-portrait { width: 40px; height: 40px; font-size: 15px; }
  .char-name { font-size: 14px; }

  /* Info-Topbar: kompakter, Logo kleiner */
  .info-topbar { height: 68px; padding: 0 16px; }
  .info-logo { height: 50px; }
  .info-topbar .town-banner-title { font-size: 14px; letter-spacing: 0.04em; }
  .info-icon-btn { min-width: 40px; padding: 4px 6px; font-size: 17px; }
  .info-icon-btn .btn-label { font-size: 8px; letter-spacing: 0.06em; }

  /* GameTime-Strip: kompakter */
  .gt-strip { padding: 4px 12px; gap: 3px 10px; font-size: 10px; }

  /* ── Wizard (interactive) ────────────────────────────────────────── */
  .cs-head  { padding: 0 16px; height: 68px; }
  .cs-logo  { height: 50px; }
  .cs-head-center { position: static; transform: none; text-align: left; }
  .wiz-foot { padding: 16px 20px 24px; }
  .wiz-stage { padding: 0 16px; }
  .wiz-char  { width: 200px; height: 300px; }
  .summary   { grid-template-columns: 1fr; gap: 20px; }
  .summary-char { margin: 0 auto; }
  .summary-portrait { margin: 0 auto; }
  .appearance-panel { grid-template-columns: 1fr; gap: 16px; }
  .wiz-char-preview { width: 180px; height: 270px; margin: 0 auto; }

  /* ── Wizard Neu-Layout ───────────────────────────────────────────── */
  .wiz-main-row { grid-template-columns: 1fr; gap: 24px; }
  .wiz-portrait-col { max-width: 320px; margin: 0 auto; }
  .style-cards { grid-template-columns: repeat(2, 1fr); }

  /* ── Landing Page ────────────────────────────────────────────────── */
  .hero-layout {
    flex-direction: column;
    align-items: flex-start;
    padding: 80px 16px 80px;
    gap: 24px;
    /* kein absolute mehr — scrollbarer Flow */
    position: relative;
    min-height: 100vh;
  }
  .hero-content {
    max-width: 100%;
    gap: 16px;
  }
  .hero-headline { font-size: clamp(1.6rem, 5vw, 2.6rem); }
  .hero-headline-em { font-size: clamp(32px, 8vw, 56px); }
  .hero-desc { font-size: 13px; max-width: 100%; }
  .hero-stats { gap: 20px; padding: 12px 16px; width: 100%; flex-wrap: wrap; }
  .hero-stat-val { font-size: 22px; }
  .hero-ctas { gap: 8px; }
  .btn-outline { padding: 9px 14px; font-size: 10px; }

  /* Login-Panel: volle Breite unten */
  .login-float {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 24px 20px 20px;
  }
  .login-title { font-size: 22px; }

  /* Topbar (Landing/Public) */
  .landing-topbar { height: 68px; padding: 0 16px; }
  .topbar-logo { height: 50px; }
  .topbar-name { font-size: 12px; letter-spacing: 0.14em; }
  .topbar-nav  { padding: 5px 10px; }
  .topbar-link { padding: 5px 10px; font-size: 10px; }
  .topbar-stats { padding: 5px 10px; font-size: 11px; }

  /* Ticker: kompakter */
  .ticker { padding: 10px 16px; }

  /* ── Public Pages ────────────────────────────────────────────────── */
  .public-main { padding: 80px 12px 60px; }
  .public-panel { max-width: 100% !important; }
  .public-panel-header { padding: 16px 18px 12px; }
  .public-panel-body   { padding: 16px 18px; }

  /* Bestiary-Grid: 1-spaltig */
  .bestiary-grid { grid-template-columns: 1fr; }

  /* Hall of Fame Tabelle: scrollbar */
  .hof-table { font-size: 12px; }
  .hof-table th, .hof-table td { padding: 7px 8px; }
  .hof-rank { width: 32px; font-size: 16px; }

  /* ── Gemeinsame Elemente ─────────────────────────────────────────── */

  /* Popup-Overlay: volle Breite auf kleinen Screens */
  .popup-overlay .popup-box {
    width: 92vw;
    max-height: 85vh;
  }

  /* Inventar-Popup */
  #popup-inventar { padding: 8px; }
  .iv-D {
    width: 96vw;
    height: 88vh;
  }
  .iv-D-body { grid-template-columns: 1fr; }
  .iv-D-cats   { display: none; }
  .iv-D-detail { display: none; }
  .iv-D-cards  { grid-template-columns: 1fr; padding: 10px 12px; }
  .iv-titlebar { padding: 10px 14px 8px; }
  .iv-search   { width: 140px; }

  /* Dialog-System: Avatare kleiner */
  .dlg-avatar { width: 72px; height: 90px; }
  .dlg-avatar--dual { width: 116px; }
  .bubble-text { font-size: 16px; }
  .choice-btn  { font-size: 15px; padding: 9px 12px; }

  /* Schließfach */
  .sf-actions { flex-direction: column; gap: 12px; }

  /* ── Combat Layout ───────────────────────────────────────────────── */

  /* Combat: vollständiger Umbau auf flow-Layout */
  body.combat-page { overflow: auto; }

  /* Topbar fix */
  .combat-wrap .info-topbar { height: 60px; padding: 0 12px; flex-shrink: 0; }

  /* Haupt-Wrap: Flex-Column, scroll */
  .combat-wrap {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  /* battle-body: keine Side-by-Side mehr */
  .battle-body { flex-direction: column; overflow: visible; }

  /* Battle-Nav: als schmale horizontale Leiste oben */
  .battle-nav {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--line);
    flex-direction: row;
    flex-wrap: wrap;
    padding: 4px 8px;
    overflow-x: auto;
    gap: 0;
  }
  .battle-nav .navhead      { padding: 4px 8px 2px; display: inline-block; }
  .battle-nav a.nav,
  .battle-nav span.nav      { display: inline-block; padding: 4px 8px; white-space: nowrap; }
  .battle-nav-sep           { display: none; }

  /* Combat-Frame: Höhe begrenzt, kein absolute mehr für Panels */
  .combat-frame {
    position: relative;
    flex: none;
    height: 220px; /* Wald-Szene als atmosphärisches Band */
    overflow: hidden;
  }
  /* Combat-Hintergrund-Overlay bleibt, Bild wird gezoomt */
  .combat-bg__img { object-position: center 30%; }

  /* Eck-Ornamente auf Mobile ausblenden */
  .combat-corner { display: none; }
  .combat-topbar-loc { top: 48px; font-size: 8px; }

  /* Info-Panels: aus absolute herauslösen → flow nach dem Frame */
  .combat-enemy-info,
  .combat-player-info {
    position: relative !important;
    top: unset !important; bottom: unset !important;
    left: unset !important; right: unset !important;
    width: 100% !important;
    margin: 0;
    border-radius: 0;
    border-left: none; border-right: none;
  }

  /* Portraits: relativ, kompakter */
  .combat-portrait,
  .portrait-enemy-wrap,
  .portrait-player-wrap {
    position: relative !important;
    top: unset !important; bottom: unset !important;
    left: unset !important; right: unset !important;
    width: 80px !important;
    height: 80px !important;
    display: inline-block;
    vertical-align: middle;
    margin: 8px 10px;
  }

  /* Dock: nicht mehr absolute, volle Breite, flache Höhe */
  .combat-dock-wrap {
    position: relative !important;
    left: unset !important; right: unset !important;
    bottom: unset !important;
    width: 100% !important;
    height: auto !important;
    background: rgba(6,9,4,0.96);
    border-top: 1px solid rgba(134,239,172,0.14);
  }
  .combat-dock {
    position: relative;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: 0;
    padding: 0;
  }
  /* Dock-Panels: stapeln vertikal */
  .combat-dock > .combat-panel { border-left: none; border-right: none; border-top: none; }
  #combat-action-panel  { order: 1; }
  #combat-log-panel     { order: 2; }
  #combat-companion-panel { display: none; } /* Companion Phase 2, auf Mobile weglassen */

  /* Action-Grid: 2×2 auf voller Breite */
  .combat-action-grid { grid-template-columns: 1fr 1fr; padding: 8px; }
  .combat-attack-grid { grid-template-columns: 1fr 1fr; padding: 6px 8px 4px; }

  /* Log: begrenzte Höhe */
  .combat-log-box { max-height: 140px; }

  /* Debug-Panel: aus absolute heraus */
  .combat-debug-panel {
    position: relative !important;
    top: unset !important; right: unset !important;
    width: 100% !important;
    max-height: 200px;
    border-left: none; border-right: none;
  }

  /* Intro-Screen anpassen */
  .combat-intro-name { font-size: 26px; letter-spacing: 0.14em; }
  .combat-intro-sprite { width: 160px; height: 160px; }

  /* End-Screen */
  .combat-end-title { font-size: 28px; letter-spacing: 0.14em; }
  .combat-loot-box  { width: 94vw; }

} /* end @media 768px */


/* ── 480px: Portrait-Phone ────────────────────────────────────────── */
@media (max-width: 480px) {

  /* Topbar noch kompakter */
  .info-topbar { height: 58px; padding: 0 10px; }
  .info-logo   { height: 42px; }
  .info-topbar .town-banner-title { font-size: 12px; display: none; }
  .info-icon-btn { min-width: 36px; padding: 3px 5px; font-size: 16px; }
  .info-icon-btn .btn-label { display: none; }

  /* Town-Grid: enger */
  .town-grid { padding: 0 8px 50px; gap: 10px; }

  /* Nav: noch kompakter */
  .town-col.nav-col { font-size: 12px; }
  .town-col.nav-col a.nav { padding: 3px 8px; font-size: 12px; }

  /* Char-Card: minimal */
  .char-card { padding: 10px; }
  .char-portrait { width: 36px; height: 36px; font-size: 13px; }
  .char-name  { font-size: 13px; }
  .char-class { font-size: 10px; }
  .char-row   { font-size: 12px; }
  .char-row .k { font-size: 10px; }
  .char-bar-head { font-size: 9px; }

  /* Landing: enger */
  .hero-layout { padding: 68px 12px 68px; gap: 16px; }
  .landing-topbar { height: 60px; padding: 0 12px; }
  .topbar-logo { height: 42px; }
  .topbar-glyph { width: 28px; height: 28px; font-size: 13px; }
  .topbar-name  { font-size: 11px; letter-spacing: 0.12em; }
  .topbar-nav   { display: none; } /* Platz sparen — Login-Form reicht */
  .topbar-stats { padding: 4px 8px; font-size: 10px; }

  .hero-headline    { font-size: clamp(1.4rem, 6vw, 2rem); }
  .hero-headline-em { font-size: clamp(26px, 9vw, 44px); }
  .hero-badge       { font-size: 9px; padding: 4px 10px; }
  .hero-stats       { gap: 12px; padding: 10px 12px; }
  .hero-stat-val    { font-size: 18px; }
  .hero-stat-label  { font-size: 9px; }
  .hero-ctas        { display: none; } /* zu eng */

  .login-float  { padding: 18px 14px 16px; }
  .login-title  { font-size: 18px; }
  .login-sub    { font-size: 12px; margin-bottom: 14px; }
  .login-tabs   { margin-bottom: 14px; }
  .login-tab    { font-size: 10px; padding: 10px 0; }
  .btn-primary  { padding: 13px 16px; font-size: 12px; }

  /* Public */
  .public-main        { padding: 68px 8px 50px; }
  .public-panel-body  { padding: 12px 14px; }
  .public-panel-header { padding: 12px 14px 10px; }

  /* Bestiary-Card: enger */
  .bestiary-card { padding: 8px; gap: 8px; }
  .bestiary-name { font-size: 13px; }
  .bestiary-desc { font-size: 11px; }

  /* HOF-Tabelle: Rang + Name + Kills */
  .hof-table { font-size: 11px; }
  .hof-table th, .hof-table td { padding: 5px 6px; }

  /* Popup: schmaler */
  .popup-overlay .popup-box { width: 98vw; }

  /* Inventar */
  .iv-D { width: 98vw; height: 90vh; }
  .iv-D-foot { flex-direction: column; gap: 6px; align-items: flex-start; }
  .iv-D-foot-money { gap: 12px; }
  .iv-titlebar { flex-wrap: wrap; gap: 4px; padding: 8px 10px; }
  .iv-search   { width: 100%; order: 3; }

  /* Dialog: enger */
  .dlg-avatar { width: 60px; height: 76px; }
  .dlg-avatar--dual { width: 94px; }
  .bubble { max-width: 85%; padding: 9px 12px; }
  .bubble-text { font-size: 15px; }
  .bubble-speaker { font-size: 12px; }
  .choice-btn { font-size: 14px; padding: 8px 10px; }
  .dlg-stage { max-height: 340px; }

  /* Wizard: enger */
  .cs-head { padding: 0 12px; height: 60px; flex-direction: row; }
  .cs-head-center { display: none; }
  .cs-head-meta   { display: none; }
  .wiz-foot { padding: 12px 14px 20px; gap: 10px; }
  .wiz-btn  { padding: 9px 18px; font-size: 11px; }

  /* Combat: noch kompakter */
  .combat-wrap .info-topbar { height: 54px; padding: 0 8px; }
  .combat-topbar-loc { top: 42px; display: none; }
  .combat-frame { height: 160px; }
  .combat-panel-head { padding: 7px 10px 6px; font-size: 9px; }
  .combat-panel-body { padding: 8px 10px 10px; }
  .combat-stat-name { font-size: 14px; }
  .hp-wrap { height: 11px; }
  .combat-action-grid { grid-template-columns: 1fr 1fr; gap: 6px; padding: 6px; }
  .combat-btn { padding: 9px 8px; font-size: 12px; }
  .combat-btn .btn-sub { font-size: 8px; }
  .combat-intro-name { font-size: 20px; }
  .combat-intro-sprite { width: 120px; height: 120px; }
  .combat-end-title  { font-size: 22px; }
  .combat-end-sub    { font-size: 14px; }
  .combat-loot-box   { width: 98vw; padding: 10px 12px; }

  /* Char-Select-Page */
  .cs-head    { height: 60px; padding: 0 12px; }
  .cs-intro   { padding: 6px 12px 4px; }
  .cs-carousel-wrap { padding: 4px; gap: 4px; }
  .cs-arrow   { width: 28px; }
  .char-slot  { min-height: clamp(300px, 65vh, 550px); padding: 0 12px clamp(8px,1vh,12px); }
  .cs-portrait-frame { height: clamp(180px, 38vh, 320px); }

  /* Ticker: ausblenden auf Portrait-Phone — zu wenig Platz */
  .hero .ticker { display: none; }

} /* end @media 480px */


/* ── Landscape-Phone (kurze Höhe) ─────────────────────────────────── */
@media (max-height: 500px) and (orientation: landscape) {

  /* Topbar: flacher */
  .info-topbar   { height: 52px; padding: 0 12px; }
  .info-logo     { height: 38px; }
  .landing-topbar { height: 52px; }
  .topbar-logo   { height: 38px; }
  .cs-head       { height: 52px; }
  .cs-logo       { height: 38px; }

  /* GameTime-Strip: ausblenden */
  .gt-strip { display: none; }

  /* Hero: kürzer */
  .hero-layout { padding: 56px 16px 56px; gap: 12px; flex-direction: row; align-items: center; }
  .hero-content { gap: 8px; }
  .hero-headline { font-size: 1.5rem; }
  .hero-headline-em { font-size: 2rem; }
  .hero-desc  { display: none; }
  .hero-stats { display: none; }
  .hero-ctas  { display: none; }
  .login-float { min-height: auto; padding: 16px 20px 14px; }
  .lf-header  { margin-bottom: 12px; }
  .lf-form    { gap: 8px; }
  .login-sub  { display: none; }

  /* Public-Main: volle Viewport-Höhe nutzen */
  .public-main { padding: 56px 12px 40px; }

  /* Town-Grid */
  .town-grid { padding: 0 12px 20px; gap: 10px; }

  /* Inventar-Popup: kleinere max-height */
  .iv-D { height: min(360px, 88vh); }

  /* Combat: Landschaft → wir haben Breite, nutzen sie */
  body.combat-page .battle-body { flex-direction: row; }
  .battle-nav {
    width: 120px;
    flex-direction: column;
    flex-wrap: nowrap;
    border-right: 1px solid var(--line);
    border-bottom: none;
    padding: 4px 0;
    overflow-y: auto;
    overflow-x: hidden;
  }
  .battle-nav .navhead    { display: block; }
  .battle-nav a.nav,
  .battle-nav span.nav    { display: block; }
  .battle-nav-sep         { display: block; }

  .combat-frame { height: auto; flex: 1; min-height: 0; }
  .combat-wrap  { height: 100vh; overflow: hidden; }
  .battle-body  { overflow: hidden; }

  /* Dock: schmaler am Boden */
  .combat-dock-wrap {
    position: absolute !important;
    left: 120px !important; right: 0 !important;
    bottom: 0 !important;
    width: auto !important;
    height: 180px !important;
  }
  .combat-dock { grid-template-columns: 28% 52% 20%; }

  /* Info-Panels: zurück zu absolute für Landschaft */
  .combat-enemy-info {
    position: absolute !important;
    top: 16px !important; right: 2% !important;
    width: 260px !important;
  }
  .combat-player-info {
    position: absolute !important;
    bottom: 195px !important; left: 2% !important;
    width: 260px !important;
  }
  .portrait-enemy-wrap {
    position: absolute !important;
    top: 20px !important;
    right: calc(2% + 268px + 14px) !important;
    width: 100px !important; height: 100px !important;
  }
  .portrait-player-wrap {
    position: absolute !important;
    bottom: 196px !important;
    left: calc(2% + 268px + 14px) !important;
    width: 92px !important; height: 92px !important;
  }

  /* Topbar-Loc etwas höher wegen kleinerer Topbar */
  .combat-topbar-loc { top: 48px; display: flex; }

  /* Milestone-Overlay: Header kleiner */
  .ms-header { flex-basis: 22vh; }

  /* Wiz */
  .wiz-foot  { padding: 12px 24px 16px; }
  .wiz-stage { padding: 0 24px; }

} /* end landscape */
