@layer app {
/* ============================================================
   Split-flap animation engine (3-layer)
   ============================================================ */
.sf-cell {
  position: relative;
  flex-shrink: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--cell-bg);
  border: 1px solid var(--cell-brd);
}

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

.sf-layer {
  position: absolute;
  left: 0; right: 0;
  overflow: hidden;
}

.sf-back {
  top: 0; bottom: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sf-flap {
  top: 0;
  height: 50%;
  z-index: 3;
  transform-origin: bottom center;
  background: inherit;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.sf-front {
  bottom: 0;
  height: 50%;
  z-index: 3;
  transform-origin: top center;
  background: inherit;
  box-shadow: 0 -1px 3px rgba(0,0,0,0.10);
}

.sf-glyph {
  position: absolute;
  left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-flap);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  white-space: nowrap;
}

.sf-back .sf-glyph {
  position: static;
  width: 100%;
  height: 100%;
}

.sf-flap .sf-glyph {
  top: 0;
  bottom: auto;
}

.sf-front .sf-glyph {
  bottom: 0;
  top: auto;
}

@keyframes sf-fold-out {
  from { transform: scaleY(1); }
  to   { transform: scaleY(0); }
}

@keyframes sf-drop-in {
  from { transform: scaleY(0); }
  to   { transform: scaleY(1); }
}

.sf-folding {
  animation: sf-fold-out 80ms cubic-bezier(0.55, 0, 1, 1) forwards;
}

.sf-dropping {
  animation: sf-drop-in 95ms cubic-bezier(0, 0, 0.3, 1) forwards;
}

.sf-split-line {
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  height: 1px;
  margin-top: 0;
  background: rgba(0,0,0,0.06);
  z-index: 20;
  pointer-events: none;
}

.word-status {
  font-size: 12px;
  font-family: var(--font-body);
  color: var(--page-sub);
  letter-spacing: 0.5px;
  margin-left: 6px;
}

.word-status-theme {
  color: var(--orange);
  font-weight: 700;
}

.theme-words-panel {
  background: var(--board-bg);
  border: 1px solid var(--cell-brd);
  border-radius: var(--radius);
  padding: 12px;
  margin-top: 12px;
  max-height: 200px;
  overflow-y: auto;
}

.theme-words-panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.theme-words-panel-title {
  font-family: var(--font-flap);
  font-size: 16px;
  color: var(--orange);
}

.theme-words-panel-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1px 5px;
  border-radius: var(--radius);
  background: var(--orange);
  color: #fff;
}

.word-suggest-link {
  font-size: 12px;
  font-family: var(--font-body);
  color: var(--page-sub);
  margin-left: 4px;
  text-decoration: underline;
  cursor: pointer;
}

.word-suggest-link.suggested {
  text-decoration: none;
  pointer-events: none;
  opacity: 0.7;
}

.btn.word-valid {
  background: var(--green);
  border-color: var(--green-dim);
}

.btn.word-invalid {
  opacity: 0.4;
}

}
