/* ==========================================================================
   DINO DEUTSCH — giao diện v2
   ========================================================================== */
* { box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(16, 185, 129, 0.18), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(245, 158, 11, 0.12), transparent 60%),
    #0b1120;
  background-attachment: fixed;
  overflow-x: hidden;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }

.card {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.82), rgba(15, 23, 42, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.1rem;
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
}

.btn-ghost {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .4rem .7rem; border-radius: .75rem;
  background: rgba(30, 41, 59, 0.9); border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: .78rem; font-weight: 700; color: #e2e8f0;
  transition: background .15s, transform .1s;
}
.btn-ghost:hover { background: #334155; }
.btn-ghost:active { transform: scale(0.97); }

.pill {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .38rem .8rem; border-radius: 999px;
  background: rgba(30, 41, 59, 0.9); border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: .75rem; font-weight: 700;
}
.pill.on { border-color: rgba(52, 211, 153, 0.5); background: rgba(6, 78, 59, 0.5); }

.chip {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .15rem .55rem; border-radius: 999px; border: 1px solid;
  font-size: .7rem; font-weight: 800; letter-spacing: .02em;
}

.label { display: block; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: #94a3b8; margin-bottom: .45rem; }

.input {
  padding: .55rem .75rem; border-radius: .75rem;
  background: #0b1222; border: 1px solid rgba(255, 255, 255, 0.12); color: #f1f5f9;
  font-size: .82rem; outline: none;
}
.input:focus { border-color: #fbbf24; box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.15); }
select.input optgroup { background: #0f172a; color: #fbbf24; font-weight: 800; }
select.input option { color: #e2e8f0; }

.seg {
  padding: .55rem 1rem; border-radius: .75rem; font-size: .8rem; font-weight: 800;
  background: #1e293b; border: 1px solid rgba(255, 255, 255, 0.1); color: #cbd5e1;
}
.seg.active { background: #fbbf24; color: #0f172a; border-color: #fbbf24; }

.opt {
  display: flex; gap: .55rem; align-items: center;
  padding: .65rem .75rem; border-radius: .9rem;
  background: rgba(2, 6, 23, 0.45); border: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 700; color: #e2e8f0; cursor: pointer;
}
.opt small { display: block; font-weight: 500; color: #94a3b8; font-size: .7rem; }
.opt input[type=checkbox] { width: 1.05rem; height: 1.05rem; accent-color: #fbbf24; }

.mode-card {
  text-align: left; padding: 1.1rem; border-radius: 1.1rem;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.85), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex; flex-direction: column; gap: .35rem;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.mode-card:hover { transform: translateY(-3px); border-color: rgba(251, 191, 36, 0.5); box-shadow: 0 14px 30px -14px rgba(251, 191, 36, 0.35); }
.mode-card h3 { font-weight: 900; font-size: 1rem; color: #fff; }
.mode-card p { font-size: .78rem; color: #94a3b8; line-height: 1.45; flex: 1; }
.mode-card .go { font-size: .78rem; font-weight: 800; margin-top: .4rem; }
.mode-icon { width: 2.6rem; height: 2.6rem; border-radius: .8rem; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; margin-bottom: .3rem; }

.kbd { padding: .05rem .35rem; border-radius: .35rem; background: #1e293b; color: #fcd34d; font-weight: 700; }

.stat { padding: .6rem; border-radius: .8rem; background: #0b1222; border: 1px solid rgba(255, 255, 255, 0.08); }
.stat span { display: block; font-size: .62rem; color: #94a3b8; font-weight: 800; }
.stat b { font-family: ui-monospace, monospace; font-size: 1.05rem; }

/* Karaoke */
.karaoke { display: flex; flex-wrap: wrap; gap: .35rem; padding: .7rem; border-radius: .9rem; background: rgba(2, 6, 23, 0.55); border: 1px solid rgba(255, 255, 255, 0.08); }
.kw {
  display: inline-block; padding: .2rem .5rem; border-radius: .5rem;
  font-size: 1.05rem; font-weight: 700; color: #cbd5e1;
  background: rgba(30, 41, 59, 0.7); border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all .18s ease;
}
.kw.dim { opacity: .38; }
.kw.active { border-color: rgba(251, 191, 36, 0.55); background: rgba(120, 53, 15, 0.35); color: #fff; }
.kw.next { box-shadow: inset 0 -3px 0 #fbbf24; }
.kw.ok { background: rgba(34, 197, 94, 0.22); border-color: rgba(34, 197, 94, 0.55); color: #86efac; transform: translateY(-1px); }
.kw.slot { border-style: dashed; border-color: rgba(251, 191, 36, 0.7); color: #fde68a; }
.chunk-sep { width: 1px; align-self: stretch; background: rgba(251, 191, 36, 0.4); margin: 0 .15rem; }

/* Mic ring */
@keyframes listening-ring { 0% { transform: scale(.9); opacity: .9; } 70%, 100% { transform: scale(1.6); opacity: 0; } }
.listening-ring::before {
  content: ''; position: absolute; inset: -3px; border-radius: 999px;
  border: 2px solid #22c55e; animation: listening-ring 1.4s ease-out infinite;
}

@keyframes heart-beat { 50% { transform: scale(1.35); } }
.heart-pop { animation: heart-beat .3s ease-in-out; }

@keyframes flash-ok { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .7); } 100% { box-shadow: 0 0 0 14px rgba(34, 197, 94, 0); } }
.flash-ok { animation: flash-ok .6s ease-out; }

.vocab-card { padding: .8rem; border-radius: .9rem; background: #0f172a; border: 1px solid rgba(255, 255, 255, 0.08); }
.g-der { color: #60a5fa; } .g-die { color: #f87171; } .g-das { color: #34d399; }

/* Ưu tiên lớp ẩn của Tailwind hơn các lớp nút ở trên */
.hidden { display: none !important; }
.opt.col { flex-direction: column; align-items: stretch; }
.mode-icon.wide { width: auto; padding: 0 .5rem; font-size: .95rem; }

/* Màn chọn chế độ đơn giản */
.mode-card.big { flex-direction: row; align-items: center; gap: 1rem; padding: 1.25rem 1.4rem; }
.mode-card.big h3 { font-size: 1.15rem; }
.mode-card.big p { font-size: .85rem; margin-top: .15rem; }
.mode-emoji { font-size: 2rem; width: 3.4rem; height: 3.4rem; border-radius: 1rem; display: flex; align-items: center; justify-content: center; background: rgba(251, 191, 36, 0.12); flex-shrink: 0; }
.row-opt { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .7rem .9rem; border-radius: .9rem; background: rgba(2, 6, 23, 0.45); border: 1px solid rgba(255, 255, 255, 0.07); font-weight: 600; font-size: .9rem; }
.row-opt select { min-width: 9rem; }
.toggle { width: 1.2rem; height: 1.2rem; accent-color: #fbbf24; }
