/* Fine tuning for full-viewport workspaces and the ClassFlow ribbon. */

/* Sitzplan-Geometrie springt direkt an die berechnete Position. Dadurch gibt es
   beim Laden oder nach Drag & Drop keine sichtbare Einflug-/Transform-Animation. */
.desk-board-stage,
.desk-pair,
.desk-guide,
.teacher-desk-original {
  transition: none !important;
}

/* Namen bleiben unabhängig von der dynamischen Schriftgrösse immer in ihrer Tischhälfte.
   Die zusätzliche Unterlängen-Reserve verhindert, dass g/j/p/q/y bei ein- oder
   mehrzeiligen Namen am unteren Rand des Textkastens abgeschnitten werden. */
.seat-slot {
  overflow: hidden;
}
.seat-slot__name {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: 100%;
  overflow: visible;
  padding-bottom: .14em;
  line-height: 1.2;
  text-align: center;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
  font-weight: 500;
}

@media (min-width: 900px) and (min-height: 600px) {
  :root {
    --compact-header-h: 44px;
    --compact-footer-h: 26px;
    --compact-page-gap: 2px;
  }

  .app-body .page-shell {
    position: relative;
  }

  .site-header__inner,
  .site-footer__inner {
    width: calc(100% - 12px);
  }

  .brand__logo {
    height: 28px;
  }

  .site-footer__logo {
    height: 18px;
  }

  .site-footer__meta {
    font-size: 8px;
  }

  /* Meldungen dürfen die feste Viewport-Geometrie nicht nach unten verschieben. */
  .app-body .page-shell > .flash-stack {
    position: absolute;
    top: 4px;
    left: 50%;
    z-index: 50;
    width: min(560px, calc(100% - 20px));
    margin: 0;
    transform: translateX(-50%);
    pointer-events: none;
  }

  .app-body .page-shell > .flash-stack .flash {
    pointer-events: auto;
  }

  /* ---------- Klassenspiegel: nahezu die komplette Browserfläche nutzen ---------- */
  .original-workspace-page .page-shell {
    width: 100%;
    max-width: none;
    padding: 2px 3px 1px;
    gap: 3px;
  }

  /* Im Klassenspiegel liegt die Systemmeldung mittig auf Höhe der Titelzeile
     (z. B. "L23c – Reihen") statt über den Ribbon-Schaltflächen. */
  .original-workspace-page .page-shell > .flash-stack {
    top: 74px;
  }

  /* Word-artiges Ribbon, aber mit ClassFlow-Farben und besser lesbaren Beschriftungen. */
  .original-workspace-page .desktop-toolbar {
    gap: 0;
    padding: 3px 4px 2px;
    margin: 0;
    border: 1px solid #d7e1ef;
    border-radius: 9px;
    background: linear-gradient(180deg, #fbfdff 0%, #f0f5fb 100%);
    box-shadow: 0 3px 10px rgba(34, 58, 94, .07);
  }

  .original-workspace-page .desktop-toolbar__group,
  .original-workspace-page .desktop-toolbar__group:nth-child(n) {
    min-height: 60px;
    max-height: 64px;
    padding: 3px 7px 2px;
    gap: 3px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    justify-content: flex-start;
  }

  .original-workspace-page .desktop-toolbar__group:not(:last-child) {
    border-right: 1px solid #d6dfeb;
  }

  .original-workspace-page .desktop-toolbar__title {
    order: 20;
    width: 100%;
    margin-top: auto;
    padding-top: 3px;
    border-top: 1px solid rgba(195, 207, 224, .65);
    color: #52627a;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.05;
    text-align: center;
    letter-spacing: .01em;
  }

  .original-workspace-page .desktop-toolbar label {
    font-size: 9.5px;
    line-height: 1.05;
    color: #3f5069;
    font-weight: 650;
  }

  .original-workspace-page .desktop-toolbar select,
  .original-workspace-page .desktop-toolbar .button {
    min-height: 30px;
    height: 30px;
    border-radius: 6px;
    font-size: clamp(9.5px, .72vw, 11.5px);
  }

  .original-workspace-page .desktop-toolbar__group:last-child .button {
    font-size: clamp(10.5px, .8vw, 12.5px);
    font-weight: 650;
  }

  .original-workspace-page .desktop-toolbar select,
  .original-workspace-page .desktop-toolbar .button--secondary {
    border-color: #c7d4e6;
    background: linear-gradient(180deg, #ffffff 0%, #f5f8fc 100%);
    color: #172940;
    box-shadow: none;
  }

  .original-workspace-page .desktop-toolbar .button--secondary:hover,
  .original-workspace-page .desktop-toolbar select:hover {
    border-color: #8a76ef;
    background: #f2efff;
  }

  .original-workspace-page .desktop-toolbar .button--primary {
    background: linear-gradient(180deg, #7458ff 0%, #5c40e9 100%);
    box-shadow: 0 2px 6px rgba(92, 64, 233, .2);
  }

  .classroom-canvas-card {
    border-radius: 9px;
    box-shadow: 0 3px 12px rgba(34, 58, 94, .08);
  }

  .classroom-canvas-card__meta {
    min-height: 34px;
    padding: 3px 7px;
  }

  .classroom-canvas-card__meta > div {
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 10px;
  }

  .classroom-canvas-card__meta h1 {
    flex: 0 0 auto;
    font-size: clamp(16px, 1.28vw, 22px);
  }

  .classroom-canvas-card__meta p {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    color: #52647d;
    font-size: clamp(10px, .72vw, 12px);
    font-weight: 500;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .view-mode-badge {
    flex: 0 0 auto;
    padding: 4px 8px;
    font-size: clamp(10.5px, .75vw, 12px);
    font-weight: 700;
  }

  .desk-board {
    border-radius: 0 0 8px 8px;
    background-size: 30px 30px;
  }

  /* viewport.js positioniert die 1000x680-Bühne direkt anhand des echten Inhalts. */
  .desk-board-stage {
    inset: auto !important;
    left: 0 !important;
    top: 0 !important;
    width: 1000px;
    height: 680px;
  }

  .desk-pair {
    border-width: 1.5px;
    border-radius: 7px;
    box-shadow: 0 4px 11px rgba(49, 50, 110, .08);
  }

  .seat-slot {
    padding: 5px 4px;
  }

  .seat-slot__name {
    font-weight: 500;
  }

  .seat-slot__number {
    left: 3px;
    top: 2px;
    font-size: 7px;
  }

  .teacher-desk-original {
    border-width: 1.5px;
    font-size: 18px;
  }

  .drag-help {
    left: 4px;
    bottom: 4px;
    padding: 3px 5px;
    border-radius: 6px;
    font-size: 7px;
  }

  /* Bei exakt 900 px überschreibt die alte Responsive-Regel sonst auf zwei Spalten. */
  .group-card-grid-original {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }

  /* ---------- Glücksrad ---------- */
  .wheel-canvas {
    transition: none !important;
  }

  /* Dreieck zeigt mit seiner Spitze nach unten direkt auf das ausgewählte Segment. */
  .wheel-pointer {
    top: .4%;
    border-left-width: 14px;
    border-right-width: 14px;
    border-top: 31px solid #3478ee;
    border-bottom: 0;
  }

  .wheel-is-spinning .wheel-center:after {
    content: none;
  }

  .wheel-wrap {
    border: 1px solid #dce5f0;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.8), 0 4px 16px rgba(34,58,94,.08);
  }
}

@media (min-width: 900px) and (max-width: 1100px) and (min-height: 600px) {
  .site-footer__meta span:first-child {
    display: none;
  }

  .site-header__inner {
    gap: 7px;
  }

  .main-navigation__link {
    padding-inline: 6px;
  }

  .classroom-canvas-card__meta p {
    display: block;
    font-size: 9.5px;
  }
}
