/* ============ Classroom area ============ */
.podium {
  width: min(440px, 62%);
  padding: 10px 0;
  text-align: center;
  color: #fff;
  font-weight: 600;
  letter-spacing: 12px;
  text-indent: 12px;
  background: var(--podium-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  flex-shrink: 0;
}

.seat-grid {
  display: grid;
  gap: 8px;
  align-content: start;
  /* no flex:1 — the grid sizes to its content; the classroom container scrolls on overflow so content never covers the status bar */
}

.grid-cell.aisle {
  /* aisle placeholder cell: stripes are only a hint, no seat lives here */
  background: repeating-linear-gradient(45deg, transparent 0 6px, var(--grid-line) 6px 8px);
  border-radius: var(--radius-sm);
  opacity: .45;
  min-height: 20px;
}

.seat {
  position: relative;
  width: var(--seat-size, 76px);
  height: calc(var(--seat-size, 76px) * 0.92);
  border-radius: 8px;
  background: var(--seat-empty-bg);
  border: 1.5px dashed var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s;
  user-select: none;
}

.seat:hover { border-color: var(--primary); }
.seat.selected {
  border-style: solid;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.seat.drag-over {
  border-style: solid;
  border-color: var(--success);
  background: var(--success-soft);
}

/* ---- Student card (inside a seat) ---- */
.student-card {
  width: calc(100% - 6px);
  height: calc(100% - 6px);
  border-radius: 6px;
  /* name always perfectly centered: the card body holds only the name; icon row and duty badge are floating overlays */
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--seat-bg);
  border: 2px solid var(--border-strong);
  cursor: grab;
  position: relative;
  overflow: hidden;
  will-change: transform;
}

.student-card.gender-m { border-color: var(--male); background: var(--male-soft); }
.student-card.gender-f { border-color: var(--female); background: var(--female-soft); }

/* annotation colors: left color bar */
.student-card.anno-red    { box-shadow: inset 4px 0 0 var(--anno-red); }
.student-card.anno-orange { box-shadow: inset 4px 0 0 var(--anno-orange); }
.student-card.anno-yellow { box-shadow: inset 4px 0 0 var(--anno-yellow); }
.student-card.anno-green  { box-shadow: inset 4px 0 0 var(--anno-green); }
.student-card.anno-purple { box-shadow: inset 4px 0 0 var(--anno-purple); }

.student-card .sc-name {
  font-weight: 600;
  font-size: calc(var(--seat-size, 76px) * 0.17);
  max-width: 92%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.25;
}

/* icon row: floats at the bottom (doesn't affect name centering). Never wraps — at most 3 attribute icons */
.student-card .sc-meta {
  position: absolute;
  bottom: 3px;
  left: 0;
  right: 0;
  font-size: calc(var(--seat-size, 76px) * 0.13);
  color: var(--text-2);
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  line-height: 1.2;
  padding: 0 4px;
  overflow: hidden;
  white-space: nowrap;
}

/* lock indicator: mini pill at the card's top-left (same visual as the top-right duty badge: same offset / same white rounded background) */
.seat.locked .student-card::after {
  content: '🔒';
  position: absolute;
  top: 3px;
  left: 4px;
  font-size: calc(var(--seat-size, 76px) * 0.105);
  line-height: 1.2;
  padding: 1px 4px;
  border-radius: 7px;
  background: rgba(255, 255, 255, .72);
}

/* shift right when the annotation bar (left inset 4px) is present, to avoid covering it */
.seat.locked .student-card:is(.anno-red, .anno-orange, .anno-yellow, .anno-green, .anno-purple)::after {
  left: 8px;
}

/* locked empty seat: shown as a suffix on the seat number (empty seats have no card, so the number stays visible) */
.seat.locked .seat-no::after {
  content: ' 🔒';
}

.sc-ic { }

/* duty: small badge at top-right (no length cap; ellipsis fallback when too wide) */
.sc-badge {
  position: absolute;
  top: 3px;
  right: 4px;
  font-size: calc(var(--seat-size, 76px) * 0.105);
  line-height: 1.2;
  padding: 1px 5px;
  border-radius: 7px;
  background: rgba(255, 255, 255, .72);
  color: #334155;
  max-width: 88%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seat.locked { border-style: solid; border-color: var(--warning); background: var(--warning-soft); }
.seat.locked.drag-over { border-color: var(--danger); }

.seat .seat-no {
  position: absolute;
  top: 2px;
  left: 4px;
  font-size: 10px;
  color: var(--text-3);
  line-height: 1.2;
}

/* suppress other transitions during FLIP animation */
.seat-grid.flipping .student-card { transition: none !important; }
.student-card.flip-playing { transition: transform .38s cubic-bezier(.2, .8, .2, 1) !important; z-index: 5; }
.student-card.enter-anim { animation: seat-enter .3s ease; }
@keyframes seat-enter {
  from { transform: scale(.5); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* lock-mode hint */
body.lock-mode .seat { border-color: var(--warning); }
body.lock-mode .classroom-wrap { outline: 2px dashed var(--warning); outline-offset: -5px; }

/* ---- Status bar (sticks to bottom: always visible while scrolling, never covered by seat content) ---- */
.status-bar {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
  padding: 8px 14px;
  background: var(--bg-panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 12.5px;
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 3;
  margin-top: auto;
}
.status-bar .sb-item { display: flex; align-items: center; gap: 6px; }
.status-bar .sb-dot { width: 8px; height: 8px; border-radius: 50%; }
.status-bar .sb-save { margin-left: auto; }
