/* BINA Til — indigo-white glass studio */
.til-modal { background: rgba(15, 23, 42, 0.45); touch-action: pan-y; }
.til-card {
  width: 100%; max-width: 100%; height: 100dvh; max-height: 100%;
  margin: 0; border-radius: 0; border: 0; box-shadow: none;
  color: #0f172a;
  background: linear-gradient(180deg, #e0e7ff 0%, #eef2ff 18%, #ffffff 46%, #f8fafc 100%);
  padding: max(12px, env(safe-area-inset-top, 0px)) 16px calc(22px + env(safe-area-inset-bottom, 0px));
  overflow: auto; display: flex; flex-direction: column; gap: 10px;
}
.til-card .mod-x { background: #eef2ff; color: #312e81; border: 0; }
.til-head h2 { margin: 0; font-size: 1.25rem; letter-spacing: -0.02em; color: #1e1b4b; }
.til-sub { color: #4338ca; font-size: 0.82rem; font-weight: 600; }
.til-progress { background: #e0e7ff; border-radius: 999px; height: 8px; overflow: hidden; }
.til-progress > i { display: block; height: 100%; background: linear-gradient(90deg, #6366f1, #22c55e); border-radius: inherit; }
.til-meta { display: flex; justify-content: space-between; font-size: 0.78rem; color: #475569; margin-top: 4px; }
.til-tabs { display: flex; gap: 4px; overflow-x: auto; background: rgba(255,255,255,0.7); backdrop-filter: blur(10px); border-radius: 16px; padding: 4px; box-shadow: 0 6px 20px rgba(49,46,129,0.06); }
.til-tabs button {
  flex: 1 0 auto; border: 0; background: transparent; color: #4338ca; font: 700 0.72rem/1.1 system-ui,sans-serif;
  padding: 9px 10px; border-radius: 12px; cursor: pointer; white-space: nowrap;
}
.til-tabs button.on { background: #312e81; color: #fff; }
.til-body { flex: 1; min-height: 0; }
.til-card-box, .letter-card, .word-card, .gram-card, .dlg-card, .game-card {
  background: #fff; border-radius: 18px; padding: 14px; box-shadow: 0 10px 28px rgba(15,23,42,0.06);
}
.letter-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-bottom: 12px; }
.letter-grid button {
  aspect-ratio: 1; border: 0; border-radius: 14px; background: #eef2ff; color: #1e1b4b;
  font-weight: 800; font-size: 1.05rem; cursor: pointer;
}
.letter-grid button.on { background: #4f46e5; color: #fff; box-shadow: 0 6px 16px rgba(79,70,229,0.35); }
.letter-hero { display: flex; align-items: center; gap: 14px; }
.letter-big { font-size: 3.2rem; font-weight: 800; color: #312e81; line-height: 1; min-width: 1.4em; text-align: center; }
.spk {
  width: 42px; height: 42px; border: 0; border-radius: 50%; cursor: pointer;
  background: linear-gradient(180deg, #818cf8, #4f46e5); color: #fff; font-size: 1.05rem;
  box-shadow: 0 6px 14px rgba(79,70,229,0.3);
}
.spk:active { transform: scale(0.96); }
.cat-pills { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; }
.cat-pills button { border: 0; background: #eef2ff; color: #3730a3; border-radius: 999px; padding: 7px 12px; font: 650 0.75rem system-ui; cursor: pointer; white-space: nowrap; }
.cat-pills button.on { background: #4f46e5; color: #fff; }
.word-card { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 8px; text-align: left; width: 100%; border: 0; }
.word-main { flex: 1; min-width: 0; }
.word-main b { font-size: 1.12rem; color: #1e1b4b; }
.word-main small { display: block; color: #64748b; margin-top: 2px; }
.word-ex { margin-top: 6px; font-size: 0.86rem; color: #334155; }
.mark {
  flex-shrink: 0; border: 0; border-radius: 12px; padding: 8px 10px; cursor: pointer;
  background: #f1f5f9; color: #334155; font-weight: 700; font-size: 0.75rem;
}
.mark.on { background: #dcfce7; color: #166534; }
.gram-nav { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 10px; }
.gram-nav button { border: 0; background: #eef2ff; color: #3730a3; border-radius: 12px; padding: 8px 11px; font: 650 0.74rem system-ui; cursor: pointer; white-space: nowrap; }
.gram-nav button.on { background: #312e81; color: #fff; }
.gram-card h3 { margin: 0 0 8px; color: #1e1b4b; }
.gram-card .lead { color: #4338ca; font-weight: 600; margin: 0 0 10px; }
.gram-card li { margin: 0 0 8px; line-height: 1.45; }
.ex-pair { background: #eef2ff; border-radius: 12px; padding: 10px 12px; margin-top: 8px; }
.ex-pair b { display: block; }
.game-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.game-tile {
  border: 0; border-radius: 18px; padding: 16px 12px; text-align: left; cursor: pointer;
  background: #fff; box-shadow: 0 8px 22px rgba(15,23,42,0.06); color: inherit; font: inherit;
}
.game-tile b { display: block; font-size: 1rem; color: #1e1b4b; }
.game-tile small { color: #64748b; }
.match-board { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.match-board button, .quiz-opts button, .build-cloud button {
  border: 0; border-radius: 14px; padding: 12px 10px; background: #eef2ff; color: #1e1b4b;
  font-weight: 700; cursor: pointer;
}
.match-board button.on, .build-cloud button.on { background: #4f46e5; color: #fff; }
.match-board button.ok, .quiz-opts button.ok { background: #dcfce7; color: #166534; }
.match-board button.bad, .quiz-opts button.bad { background: #fee2e2; color: #991b1b; }
.build-line { min-height: 48px; background: #fff; border-radius: 14px; padding: 8px; margin-bottom: 10px; display: flex; flex-wrap: wrap; gap: 6px; box-shadow: inset 0 0 0 2px #e0e7ff; }
.quiz-q { font-size: 1.15rem; font-weight: 800; color: #1e1b4b; margin: 8px 0 12px; }
.dlg-line { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 10px; }
.dlg-line .spk { flex-shrink: 0; width: 36px; height: 36px; font-size: 0.9rem; }
.pink-btn.til-btn { background: linear-gradient(180deg, #818cf8, #4f46e5); color: #fff; border: 0; border-radius: 14px; padding: 11px 16px; font-weight: 700; cursor: pointer; }
.ghost-btn.til-btn { background: #eef2ff; color: #312e81; border: 0; border-radius: 14px; padding: 11px 16px; font-weight: 700; cursor: pointer; }
.score-banner { text-align: center; padding: 20px 10px; }
.score-banner .big { font-size: 2.4rem; font-weight: 800; color: #4f46e5; }
