/* Breite Desktop-Fenster sinnvoll ausnutzen */
@media(min-width:1180px){
  .app-shell{
    width:min(95vw,1480px);
  }

  .room-scene{
    height:clamp(500px,39vw,650px);
  }

  .plant-list{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }

  .shop-grid{
    grid-template-columns:repeat(4,minmax(0,1fr));
  }

  .mission-grid{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }

  .dashboard-grid{
    grid-template-columns:minmax(0,1.15fr) minmax(360px,.85fr);
  }
}

@media(min-width:1450px){
  .app-shell{
    width:min(94vw,1600px);
  }

  .room-scene{
    height:clamp(540px,36vw,690px);
  }

  .panel,
  .shop-card,
  .plant-card,
  .mission-card{
    padding:clamp(16px,1.15vw,21px);
  }
}

/* Laptop / kleines Desktop */
@media(max-width:1179px) and (min-width:821px){
  .app-shell{
    width:min(97vw,1120px);
  }

  .topbar{
    gap:10px;
  }

  .hud{
    flex-wrap:wrap;
    justify-content:flex-end;
  }

  .plant-list{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .shop-grid{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
}

/* Tablet */
@media(max-width:820px){
  .app-shell{
    width:100%;
    padding-left:12px;
    padding-right:12px;
  }

  .topbar{
    align-items:flex-start;
    flex-wrap:wrap;
  }

  .brand-wrap{
    flex:1 1 auto;
  }

  .hud{
    flex:1 1 100%;
    width:100%;
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:5px;
  }

  .hud-item{
    min-width:0!important;
    text-align:center;
    align-items:center;
  }

  .section-head{
    flex-wrap:wrap;
  }

  .room-scene{
    width:100%;
  }

  .modal{
    width:min(94vw,680px);
    max-height:90vh;
  }
}

/* Smartphone: Lesbarkeit statt bloßem Verkleinern */
@media(max-width:600px){
  body{
    font-size:16px;
  }

  .app-shell{
    padding:8px 9px 102px;
  }

  .topbar{
    top:5px;
    padding:10px;
    border-radius:18px;
  }

  .brand-logo{
    width:40px;
    height:40px;
  }

  .brand{
    font-size:18px!important;
  }

  .hud{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }

  .hud-item{
    padding:7px 5px!important;
  }

  .hud-item span{
    font-size:10px!important;
  }

  .hud-item strong{
    font-size:12px!important;
  }

  .eyebrow{
    font-size:11px!important;
    line-height:1.35;
  }

  .section-head{
    align-items:flex-start!important;
  }

  .section-head h1{
    font-size:clamp(29px,9vw,36px)!important;
    line-height:1.03;
  }

  h2{
    font-size:22px;
  }

  .status-strip{
    font-size:13px;
    flex-wrap:wrap;
  }

  .status-strip strong{
    margin-left:0;
  }

  .room-scene{
    height:clamp(470px,128vw,590px)!important;
    min-height:470px;
    margin:12px 0;
    border-radius:22px;
  }

  .plant-grid.pixi-overlay{
    padding-left:5px;
    padding-right:5px;
    gap:6px;
  }

  .plant-slot.pixi-slot{
    min-height:195px;
  }

  .plant-slot.pixi-slot .plant-tag,
  .plant-tag{
    font-size:11px!important;
  }

  .plant-slot.empty:after{
    font-size:12px!important;
  }

  .progress-ring{
    width:34px;
    height:34px;
    font-size:9px;
  }

  .alert-badge{
    font-size:10px!important;
  }

  .room-stats,
  .dashboard-grid,
  .plant-list,
  .shop-grid,
  .mission-grid,
  .slot-equipment-grid,
  .supply-stock-grid{
    grid-template-columns:1fr!important;
  }

  .stat-card{
    padding:13px;
  }

  .stat-card span,
  .stat-card small,
  .mini-stats span{
    font-size:11px!important;
  }

  .stat-card strong,
  .mini-stats strong{
    font-size:14px!important;
  }

  .panel,
  .plant-card,
  .shop-card,
  .mission-card,
  .settings-card{
    border-radius:17px;
  }

  .panel{
    padding:14px;
  }

  .plant-card{
    grid-template-columns:58px minmax(0,1fr);
    padding:12px;
  }

  .plant-card > :last-child{
    grid-column:2;
    justify-self:start;
  }

  .plant-card h3,
  .shop-card h3,
  .mission-card h3{
    font-size:17px!important;
  }

  .plant-card p,
  .shop-card p,
  .mission-card p,
  .about-box p,
  .setting-row span:not(.pill),
  .event-row,
  .event-empty{
    font-size:12px!important;
    line-height:1.45;
  }

  .card-status,
  .pill,
  .quality{
    font-size:10px!important;
  }

  .filter-btn,
  .shop-tab{
    min-height:42px;
    font-size:13px!important;
    padding:9px 12px;
  }

  .bottom-nav{
    width:calc(100% - 16px);
    bottom:8px;
    padding:5px;
    border-radius:18px;
  }

  .nav-btn{
    min-height:54px;
    padding:6px 3px;
  }

  .nav-btn span{
    font-size:21px!important;
  }

  .nav-btn b{
    font-size:10px!important;
  }

  .primary-btn,
  .secondary-btn,
  .action-btn,
  .equipment-upgrade,
  .equip-mode,
  .text-btn{
    min-height:44px;
  }

  .primary-btn,
  .secondary-btn{
    font-size:13px;
  }

  .action-btn b{
    font-size:13px!important;
  }

  .action-btn span{
    font-size:11px!important;
    line-height:1.4;
  }

  .setting-row{
    align-items:flex-start;
    flex-wrap:wrap;
  }

  .setting-row > button,
  .setting-row > label{
    flex:0 0 auto;
  }

  .modal-backdrop{
    padding:8px;
    align-items:center;
  }

  .modal,
  .detail-modal{
    width:calc(100vw - 16px)!important;
    max-height:91vh;
    border-radius:19px;
    padding:18px 14px;
  }

  .modal-close{
    width:44px;
    height:44px;
    right:8px;
    top:8px;
  }

  .modal-intro,
  .detail-head p{
    font-size:12px!important;
  }

  .detail-head{
    grid-template-columns:56px minmax(0,1fr);
    padding-right:38px;
  }

  .detail-head h2{
    font-size:21px;
  }

  .metric-grid,
  .resource-metrics{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }

  .metric{
    padding:10px;
  }

  .metric span{
    font-size:11px!important;
  }

  .metric strong{
    font-size:14px!important;
  }

  .detail-section h3{
    font-size:15px!important;
  }

  .environment-summary,
  .plant-env-summary{
    grid-template-columns:1fr!important;
  }

  .equipment-card-head span,
  .equipment-info small,
  .equipment-max-note,
  .watering-control-head span,
  .watering-material-preview span,
  .watering-preview,
  .supply-stock-copy small,
  .supply-usage-stats,
  .quality-analysis-head p,
  .quality-factor strong,
  .quality-factor small,
  .quality-impact,
  .quality-tech-modifier,
  .history-row strong,
  .history-row small,
  .history-empty{
    font-size:11px!important;
  }

  .equipment-info b,
  .watering-control-head strong,
  .watering-material-preview strong,
  .supply-stock-copy strong{
    font-size:14px!important;
  }

  .watering-slider{
    min-height:32px;
  }

  .watering-scale{
    font-size:10px!important;
  }

  .quality-analysis-head{
    grid-template-columns:1fr!important;
  }

  .quality-score-box{
    width:100%;
    text-align:left;
  }

  .quality-score-box span,
  .quality-score-box small{
    font-size:10px!important;
  }

  .quality-score-box strong{
    font-size:22px!important;
  }

  .quality-factor{
    grid-template-columns:auto minmax(0,1fr) auto;
    padding:9px;
  }

  .seed-option{
    grid-template-columns:48px minmax(0,1fr);
    padding:11px;
  }

  .seed-option > strong{
    grid-column:2;
    justify-self:start;
  }

  .seed-option b{
    font-size:14px!important;
  }

  .seed-option span{
    font-size:11px!important;
  }

  .auth-gate{
    padding:10px;
  }

  .auth-card{
    width:100%;
    margin-top:8px;
  }

  .auth-brand p,
  .auth-form-head p{
    font-size:12px!important;
  }

  .auth-form label > span{
    font-size:12px!important;
  }

  .auth-form label > small,
  .legacy-claim small,
  .auth-server-message span{
    font-size:11px!important;
  }

  .auth-server-message strong,
  .legacy-claim b,
  .auth-error{
    font-size:12px!important;
  }

  .auth-form input[type="text"],
  .auth-form input[type="password"]{
    min-height:46px;
    font-size:16px!important;
  }
}

/* Sehr schmale Geräte */
@media(max-width:380px){
  .app-shell{
    padding-left:6px;
    padding-right:6px;
  }

  .hud{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .section-head h1{
    font-size:28px!important;
  }

  .room-scene{
    min-height:455px;
  }

  .plant-slot.pixi-slot .plant-tag{
    width:96%;
    padding-left:5px;
    padding-right:5px;
  }

  .metric-grid,
  .resource-metrics{
    grid-template-columns:1fr!important;
  }

  .bottom-nav{
    width:calc(100% - 10px);
  }

  .nav-btn b{
    font-size:9px!important;
  }
}

/* Große Displays: Schrift nicht winzig wirken lassen */
@media(min-width:1600px){
  body{
    font-size:17px;
  }

  .brand{
    font-size:21px;
  }

  .hud-item span{
    font-size:10px;
  }

  .hud-item strong{
    font-size:14px;
  }

  .plant-card p,
  .shop-card p,
  .mission-card p,
  .setting-row span:not(.pill),
  .about-box p{
    font-size:12px;
  }
}




/* CannaGrow 0.14.8 – kompakter, fester Smartphone-HUD */
@media(max-width:600px){
  .app-shell{
    padding-top:8px;
  }

  .topbar{
    position:fixed!important;
    top:max(5px, env(safe-area-inset-top))!important;
    left:max(7px, env(safe-area-inset-left));
    right:max(7px, env(safe-area-inset-right));
    width:auto;
    min-height:54px;
    padding:6px 7px!important;
    border-radius:16px;
    align-items:center!important;
    flex-wrap:nowrap!important;
    gap:6px!important;
    z-index:90;
    box-shadow:0 10px 30px rgba(0,0,0,.36);
  }

  .brand-wrap{
    flex:0 0 auto!important;
    gap:0;
  }

  .brand-logo{
    width:30px!important;
    height:30px!important;
  }

  .brand-copy{
    display:none!important;
  }

  .hud{
    flex:1 1 auto!important;
    width:auto!important;
    display:grid!important;
    grid-template-columns:.72fr 1.35fr 1fr!important;
    gap:4px!important;
  }

  /* Mobil nur die Werte zeigen, die während des Spielens ständig relevant sind. */
  .hud-item:nth-child(1),
  .hud-item:nth-child(2),
  .hud-item:nth-child(6){
    display:none!important;
  }

  .hud-item:nth-child(3),
  .hud-item:nth-child(4),
  .hud-item:nth-child(5){
    display:flex!important;
  }

  .hud-item{
    min-width:0!important;
    padding:4px 5px!important;
    border-radius:10px;
    justify-content:center;
    text-align:center;
    overflow:hidden;
  }

  .hud-item span{
    font-size:7px!important;
    line-height:1.05;
    white-space:nowrap;
  }

  .hud-item strong{
    font-size:10.5px!important;
    line-height:1.15;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    max-width:100%;
  }

  main{
    padding-top:70px!important;
  }
}

@media(max-width:380px){
  .topbar{
    left:max(5px, env(safe-area-inset-left));
    right:max(5px, env(safe-area-inset-right));
  }
  .brand-logo{
    width:27px!important;
    height:27px!important;
  }
  .hud{
    grid-template-columns:.65fr 1.4fr .95fr!important;
  }
  .hud-item{
    padding-left:3px!important;
    padding-right:3px!important;
  }
  .hud-item strong{
    font-size:10px!important;
  }
}
