:root{
  --bg:#0f172a;
  --muted:#9aa4b2;
  --text:#e5e7eb;
  --gold:#d6a84a;
  --ok:#22c55e;
  --shadow:0 10px 30px rgba(0,0,0,.25);
  --radius:18px
}

*{box-sizing:border-box}

html,body{
  margin:0;
  padding:0;
  background:linear-gradient(180deg,#0b1224,var(--bg));
  color:var(--text);
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,"Helvetica Neue",Arial,sans-serif
}

a{color:inherit;text-decoration:none}

.container{max-width:980px;margin:0 auto;padding:18px}

.topbar{
  position:sticky;
  top:0;
  backdrop-filter:blur(10px);
  background:rgba(11,18,36,.7);
  border-bottom:1px solid rgba(255,255,255,.08);
  z-index:20
}

.topbar-inner{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px
}

.brand{
  display:flex;
  align-items:center;
  gap:10px
}

/* Logo retangular (assets/logo_med.png) */
.brand img{
  height:38px;
  width:auto;
  max-width:150px;
  object-fit:contain;
  border-radius:10px;
  box-shadow:var(--shadow)
}

.brand .title{font-weight:800}
.brand .subtitle{font-size:12px;color:var(--muted);margin-top:2px}

.header{
  margin-top:14px;
  padding:18px;
  border:1px solid rgba(255,255,255,.10);
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(214,168,74,.25), transparent 60%),
    radial-gradient(900px 500px at 120% 30%, rgba(34,197,94,.14), transparent 55%),
    rgba(17,28,54,.55);
  border-radius:var(--radius);
  box-shadow:var(--shadow)
}

.header h1{margin:0 0 6px 0;font-size:22px}
.header p{margin:0;color:var(--muted);line-height:1.35}

.grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
  margin-top:14px
}

@media(min-width:720px){
  .grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}

.card{
  border:1px solid rgba(255,255,255,.10);
  background:rgba(17,28,54,.62);
  border-radius:var(--radius);
  padding:14px;
  box-shadow:var(--shadow);
  display:flex;
  gap:12px;
  align-items:flex-start
}

.icon{
  width:42px;
  height:42px;
  border-radius:14px;
  background:rgba(214,168,74,.16);
  border:1px solid rgba(214,168,74,.35);
  display:grid;
  place-items:center;
  flex:0 0 auto;
  font-size:20px
}

.card h3{margin:0;font-size:16px}
.card p{margin:4px 0 0 0;color:var(--muted);font-size:13px;line-height:1.25}

.btnrow{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px}

.button{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(17,28,54,.75);
  box-shadow:var(--shadow);
  font-weight:650
}

.button.primary{
  border-color:rgba(214,168,74,.5);
  background:linear-gradient(180deg, rgba(214,168,74,.25), rgba(17,28,54,.75))
}

.small{font-size:12px;color:var(--muted)}
.footer{margin:18px 0 28px 0;color:var(--muted);font-size:12px}

/* Bingo */
.bingo-board{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:10px;
  margin-top:12px
}

.cell{
  height:62px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(17,28,54,.62);
  box-shadow:var(--shadow);
  display:grid;
  place-items:center;
  font-weight:900;
  font-size:18px;
  user-select:none
}

.cell.marked{
  background:rgba(34,197,94,.18);
  border-color:rgba(34,197,94,.45)
}

.tools{display:flex;gap:10px;flex-wrap:wrap;margin-top:12px}
.notice{margin-top:10px;color:var(--muted);font-size:13px}

/* Flashcards (base) */
.lessonbar{display:flex;gap:10px;flex-wrap:wrap;margin-top:12px}

.select{
  background:rgba(17,28,54,.62);
  border:1px solid rgba(255,255,255,.12);
  color:var(--text);
  padding:10px 12px;
  border-radius:14px
}

.cards{
  margin-top:12px;
  display:grid;
  grid-template-columns:repeat(1, minmax(0, 1fr));
  gap:12px
}

@media(min-width:720px){
  .cards{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(min-width:980px){
  .cards{grid-template-columns:repeat(3,minmax(0,1fr))}
}

.flip{perspective:1000px}

.flip-inner{
  position:relative;
  width:100%;
  min-height:132px;
  transform-style:preserve-3d;
  transition:transform .45s ease
}

.flip.is-flipped .flip-inner{transform:rotateY(180deg)}

.face{
  position:absolute;
  inset:0;
  border-radius:var(--radius);
  border:1px solid rgba(255,255,255,.10);
  background:rgba(17,28,54,.62);
  box-shadow:var(--shadow);
  padding:14px;
  backface-visibility:hidden;
  display:flex;
  flex-direction:column;
  justify-content:center
}

.face.back{transform:rotateY(180deg)}

.badge{display:inline-flex;align-items:center;gap:8px;font-size:12px;color:var(--muted);margin-bottom:8px}
.word{font-size:18px;font-weight:900;margin:0}
.muted{color:var(--muted)}
hr.sep{border:none;border-top:1px solid rgba(255,255,255,.10);margin:14px 0}

/* =========================================
   Flashcards estilo “cartela física roxa”
   ========================================= */
.survive-face{
  background:linear-gradient(180deg, rgba(140,75,220,.92), rgba(110,45,190,.92));
  border:1px solid rgba(255,255,255,.14)
}

.survive-card{
  min-height:240px;
}

.paper-label{
  width:74%;
  margin:0 auto;
  background:rgba(245,245,245,.98);
  border-radius:10px;
  padding:18px 14px;
  text-align:center;
  box-shadow:0 10px 25px rgba(0,0,0,.25)
}

.paper-main{
  color:#2b2b2b;
  font-weight:900;
  font-size:42px;
  line-height:1.05
}

.paper-main.paper-back{
  font-size:22px;
  line-height:1.15;
  letter-spacing:.2px
}

.paper-hint{
  margin-top:12px;
  text-align:center;
  font-size:12px;
  color:rgba(255,255,255,.85)
}

/* Barra de lições (tabs) */
.tabs{
  display:flex;
  gap:8px;
  overflow-x:auto;
  padding:6px 2px;
  flex:1 1 auto;
  -webkit-overflow-scrolling: touch;
}
.tabs::-webkit-scrollbar{height:6px}
.tabs::-webkit-scrollbar-thumb{background:rgba(255,255,255,.15);border-radius:999px}

.tab{
  border:1px solid rgba(255,255,255,.14);
  background:rgba(17,28,54,.55);
  color:var(--text);
  padding:8px 12px;
  border-radius:999px;
  font-weight:800;
  cursor:pointer;
  white-space:nowrap;
}
.tab.active{
  border-color: rgba(214,168,74,.55);
  background: linear-gradient(180deg, rgba(214,168,74,.22), rgba(17,28,54,.55));
}

/* ==============================
   DICA DO DIA (Home)
   ============================== */
.tipbox{
  margin-top:14px;
  padding:16px;
  border:1px solid rgba(255,255,255,.10);
  background:
    radial-gradient(900px 420px at 20% 0%, rgba(214,168,74,.14), transparent 60%),
    radial-gradient(700px 380px at 100% 60%, rgba(34,197,94,.10), transparent 55%),
    rgba(17,28,54,.55);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.tipbox-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}

.tipbox-title{font-weight:900;font-size:16px}

.tipbox-pill{
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(214,168,74,.35);
  background: rgba(214,168,74,.12);
  font-size:12px;
  font-weight:900;
  color: var(--text);
}

.tipbox-body{
  display:flex;
  gap:14px;
  align-items:stretch;
}

.tipbox-image{
  width:140px;
  height:140px;
  border-radius:16px;
  object-fit:cover;
  border:1px solid rgba(255,255,255,.12);
  box-shadow: var(--shadow);
  flex:0 0 auto;
}

.tipbox-content{flex:1}

.tipbox-h2{
  font-weight:900;
  font-size:18px;
  margin-bottom:6px;
}

.tipbox-text{
  color:var(--muted);
  line-height:1.35;
}

.tipbox-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:12px;
}

@media(max-width:720px){
  .tipbox-body{flex-direction:column}
  .tipbox-image{width:100%; height:180px}
}

/* ==============================
   Página dica-do-dia
   ============================== */
.tipdetail{
  margin-top:14px;
  padding:16px;
  border:1px solid rgba(255,255,255,.10);
  background:
    radial-gradient(900px 420px at 20% 0%, rgba(214,168,74,.12), transparent 60%),
    rgba(17,28,54,.55);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.tipdetail-image{
  width:100%;
  max-height:280px;
  object-fit:cover;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.12);
  box-shadow: var(--shadow);
  margin-bottom:14px;
}

.tipdetail-block{
  margin-top:12px;
  padding:14px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(17,28,54,.45);
}

.tipdetail-label{
  font-weight:900;
  margin-bottom:8px;
  color: var(--text);
}

.tipdetail-text{color: var(--text); line-height:1.4}
.tipdetail-example{font-weight:900; margin-bottom:6px}
.tipdetail-pt{color: var(--muted)}
.tipdetail-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px}