@layer app {
/* ============================================================
   The Cell — fundamental split-flap unit
   ============================================================ */
.cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: calc((100% - 6 * var(--cell-gap)) / 7);
  height: var(--cell-size);
  flex-shrink: 0;
  background: var(--cell-bg);
  border: 1px solid var(--cell-brd);
  border-radius: var(--radius);
  position: relative;
  cursor: default;
  overflow: hidden;
}

/* Split-flap horizontal line */
.cell::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: rgba(0,0,0,0.06);
  pointer-events: none;
  z-index: 2;
}

/* Bottom shadow gradient */
.cell-shadow {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.07));
  pointer-events: none;
  z-index: 3;
}

.cell-letter {
  font-size: 28px;
  font-weight: 700;
  color: var(--flap-text);
  font-family: var(--font-flap);
  z-index: 1;
  line-height: 1;
}

.cell-value {
  position: absolute;
  bottom: 2px;
  right: 3px;
  font-size: var(--cell-sub-font);
  font-family: var(--font-mono);
  color: var(--flap-val);
  z-index: 5;
  line-height: 1;
  pointer-events: none;
}

.cell-penalty {
  position: absolute;
  bottom: 2px;
  right: 3px;
  font-size: var(--cell-sub-font);
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--red, #c0392b);
  z-index: 5;
  line-height: 1;
  pointer-events: none;
}

.cell-empty:has(.cell-penalty) {
  background: rgba(192, 57, 43, 0.08);
}

.cell-mod-badge {
  position: absolute;
  top: 2px;
  left: 3px;
  font-size: var(--cell-sub-font);
  font-family: var(--font-mono);
  font-weight: bold;
  z-index: 4;
  line-height: 1;
}

/* Modifier cells */
.modifier-letter .cell-mod-badge,
.cell-mod-l .cell-mod-badge { color: var(--mod-l-badge); }

.cell-mod-l {
  background: var(--mod-l-bg);
  border-color: var(--mod-l-brd);
}

.cell-mod-w {
  background: var(--mod-w-bg);
  border-color: var(--mod-w-brd);
}

.cell-mod-w .cell-mod-badge { color: var(--orange); }

/* Empty cell (no letter placed) */
.cell-empty {
  background: var(--cell-empty-bg);
  border-color: var(--cell-empty-brd);
}

/* Hand cells are slightly larger */
.hand-cell-unit {
  width: 40px;
  height: 48px;
}

/* Read-only trains (swap phase, swap waiting) */
.trains-readonly {
  pointer-events: none;
  -webkit-tap-highlight-color: transparent;
}

/* Played train (prior round) */
.train-row.played {
  pointer-events: none;
  cursor: default;
}

.train-row.played .train-cell {
  background: var(--cell-bg);
  border-color: var(--cell-brd);
}

}
