*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #050505;
  --bg2: #0E0E10;
  --bg3: #18191B;
  --card: #121214;
  --border: #1A1A1C;
  --accent: #00A3FF;
  --accent2: #60CFFF;
  --gold: #F5A623;
  --green: #25D366;
  --red: #FF3333;
  --yellow: #F5A623;
  --text: #FFFFFF;
  --text2: #A0A0A5;
  --nav-h: 72px;
  --r: 20px;
  --shadow: 0 10px 40px rgba(0,0,0,0.6);
}

html, body { 
    height: 100%; 
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden; 
    position: fixed; /* Previne deslize lateral no iOS/Android */
    overscroll-behavior: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

body { 
    max-width: 480px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg); 
    color: var(--text); 
    font-family: 'Inter', sans-serif; 
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
    -webkit-tap-highlight-color: transparent;
}

/* ==========================================================================
   AUTH PAGES (LOGIN/REGISTER)
   ========================================================================== */
.auth-body { display: flex; align-items: center; justify-content: center; overflow: hidden; }
.auth-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--bg); max-width: 480px; margin: 0 auto; }
.auth-blob { position: absolute; filter: blur(80px); opacity: 0.4; border-radius: 50%; }
.blob1 { top: -10%; left: -10%; width: 50vw; height: 50vw; background: var(--accent); animation: float 15s ease-in-out infinite alternate; }
.blob2 { bottom: -10%; right: -10%; width: 60vw; height: 60vw; background: var(--accent2); animation: float 18s ease-in-out infinite alternate-reverse; }
.blob3 { top: 40%; left: 60%; width: 40vw; height: 40vw; background: #ec4899; animation: float 20s ease-in-out infinite alternate; }
@keyframes float { 0% { transform: translateY(0) scale(1); } 100% { transform: translateY(-50px) scale(1.1); } }

.auth-container { width: 100%; max-width: 400px; padding: 24px; z-index: 10; display: flex; flex-direction: column; gap: 32px; }
.auth-logo { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.logo-icon { width: 64px; height: 64px; border-radius: 20px; background: var(--accent); display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 30px rgba(229,46,45,0.3); }
.logo-icon .material-icons-round { font-size: 36px; color: #fff; }
.logo-text { font-size: 28px; font-weight: 900; letter-spacing: 2px; color: #fff; }

.auth-card { background: rgba(20, 20, 20, 0.85); backdrop-filter: blur(20px); border: 1px solid var(--border); border-radius: 24px; padding: 24px; box-shadow: 0 20px 40px rgba(0,0,0,0.4); }
.auth-tabs { display: flex; background: var(--bg2); border-radius: 12px; padding: 4px; margin-bottom: 24px; }
.auth-tab { flex: 1; padding: 12px; background: none; border: none; color: var(--text2); font-weight: 600; font-size: 14px; border-radius: 10px; cursor: pointer; transition: all 0.3s; }
.auth-tab.active { background: var(--card); color: var(--text); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }

.auth-form { display: flex; flex-direction: column; gap: 16px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text2); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .material-icons-round { position: absolute; left: 14px; color: var(--text2); font-size: 20px; pointer-events: none; transition: color 0.2s; }
.input-wrap input, .input-wrap select { width: 100%; background: var(--bg2); border: 1px solid var(--border); color: var(--text); font-family: inherit; font-size: 15px; padding: 14px 14px 14px 44px; border-radius: 12px; outline: none; transition: all 0.2s; }
.input-wrap input:focus, .input-wrap select:focus { border-color: var(--accent); background: var(--card); box-shadow: 0 0 0 4px rgba(229,46,45,0.1); }
.input-wrap input:focus + .material-icons-round { color: var(--accent); }
.toggle-pass { position: absolute; right: 14px; background: none; border: none; color: var(--text2); cursor: pointer; display: flex; padding: 4px; border-radius: 50%; }

.btn-auth { margin-top: 8px; width: 100%; padding: 16px; border: none; border-radius: 12px; background: linear-gradient(90deg, var(--accent), var(--accent2)); color: #fff; font-size: 16px; font-weight: 700; cursor: pointer; font-family: inherit; transition: all 0.2s; display: flex; justify-content: center; align-items: center; }
.btn-auth:active { transform: scale(0.98); opacity: 0.9; }
.btn-loader { display: none; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { 100% { transform: rotate(360deg); } }

.auth-error { background: rgba(239,68,68,0.1); color: var(--red); padding: 12px; border-radius: 8px; font-size: 13px; font-weight: 500; text-align: center; border: 1px solid rgba(239,68,68,0.2); }
.auth-footer { text-align: center; color: var(--text2); font-size: 13px; font-weight: 500; }

/* ==========================================================================
   MAIN APP STRUCTURE
   ========================================================================== */
.page { position: fixed; inset: 0; bottom: var(--nav-h); max-width: 480px; margin: 0 auto; display: none; overflow: hidden; }
.page.active { display: block; }
.scroll { height: 100%; overflow-y: auto; padding-bottom: 24px; scrollbar-width: none; }
.scroll::-webkit-scrollbar { display: none; }

/* HERO (Dashboard) */
.hero { background: var(--bg); padding: 54px 20px 28px; position: relative; overflow: hidden; }
.hero-bg-blob { position:absolute; top:-80px; right:-60px; width:240px; height:240px; background:radial-gradient(circle, rgba(229,46,45,0.15) 0%, transparent 70%); pointer-events:none; }
.hero-top { display:flex; justify-content:space-between; align-items:center; margin-bottom:16px; position: relative; z-index: 2; }
.avatar-row { display:flex; align-items:center; gap:12px; }
.av { width:46px; height:46px; border-radius:50%; background:linear-gradient(135deg,var(--accent),var(--accent2)); display:flex; align-items:center; justify-content:center; font-weight:800; font-size:16px; flex-shrink:0; text-transform: uppercase; border: 2px solid rgba(255,255,255,0.1); }
.greet { color:var(--text2); font-size:13px; margin-bottom:2px; font-weight: 500; }
.uname { font-size:18px; font-weight:700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.ibtn { background:rgba(255,255,255,0.07); border:1px solid var(--border); color:var(--text); border-radius:12px; width:42px; height:42px; cursor:pointer; display:flex; align-items:center; justify-content:center; transition:background .2s; }
.ibtn:active { background:rgba(255,255,255,0.12); }
.hbadge { display:inline-flex; align-items:center; gap:6px; background:rgba(16,185,129,0.15); border:1px solid rgba(16,185,129,0.3); padding:5px 14px; border-radius:100px; font-size:12px; font-weight: 600; color:var(--green); margin-bottom:14px; position: relative; z-index: 2; }
.sdot { width:8px; height:8px; border-radius:50%; background:var(--green); animation: pulse 2s infinite; flex-shrink:0; }
.tagline { font-size:34px; font-weight:900; line-height:1.1; letter-spacing:-1.5px; position: relative; z-index: 2; text-transform: uppercase; }
.gt { color: var(--accent); }

/* STATS ROW */
.stats-row { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; padding:16px 16px 0; }
.sc { background:var(--card); border:1px solid var(--border); border-radius:var(--r); padding:16px 10px; text-align:center; display:flex; flex-direction:column; align-items:center; gap:6px; transition:transform .2s; }
.sc:active { transform:scale(0.96); }
.sc .material-icons-round { font-size:24px; padding: 6px; border-radius: 12px; background: rgba(255,255,255,0.03); }
.sc b { font-size:18px; font-weight:800; }
.sc small { font-size:11px; color:var(--text2); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.s-fire { color:#f97316; } .s-blue { color:#3b82f6; } .s-teal { color:#14b8a6; }

/* HEADERS & TYPOGRAPHY */
.shdr { display:flex; justify-content:space-between; align-items:center; padding:24px 16px 12px; }
.shdr h3 { font-size:17px; font-weight:700; letter-spacing: -0.5px; }
.lbtn { background:none; border:none; color:var(--accent2); font-size:13px; font-weight:600; cursor:pointer; font-family:inherit; padding: 4px 8px; border-radius: 6px; transition: background 0.2s;}
.lbtn:active { background: rgba(168,85,247,0.1); }
.lbtn.danger { color: var(--red); }

.phdr { padding:54px 16px 16px; display:flex; justify-content:space-between; align-items:flex-end; border-bottom: 1px solid var(--border); background: rgba(0,0,0,0.85); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 50; max-width: 480px; margin: 0 auto; }
.phdr h2 { font-size:28px; font-weight:800; letter-spacing:-1px; }
.hdr-sub { font-size:13px; color:var(--accent); font-weight: 600; margin-top: 4px; }

/* BUTTONS */
.btn-primary, .btn-outline { display:flex; align-items:center; justify-content:center; gap:8px; padding:16px 20px; border-radius:100px; font-size:16px; font-weight:800; text-transform:uppercase; cursor:pointer; font-family:inherit; transition:all .2s; border: none; letter-spacing: 0.5px; }
.btn-primary { background:var(--accent); color:#fff; }
.btn-primary:active { opacity:.82; transform:scale(0.98); }
.btn-outline { background: transparent; border: 2px solid var(--accent); color: var(--accent2); }
.full { width: 100%; }

/* CHART CARD */
.chart-card { margin:0 16px 8px; background:var(--card); border:1px solid var(--border); border-radius:var(--r); padding:16px; }
.bars { display:flex; align-items:flex-end; gap:6px; height:80px; margin-bottom:8px; }
.bar { flex:1; border-radius:4px 4px 0 0; min-height:4px; max-height: 100%; transition:height .6s cubic-bezier(.4,0,.2,1); }
.blbls { display:flex; gap:6px; }
.blbls span { flex:1; text-align:center; font-size:10px; color:var(--text2); font-weight: 600; }

/* SETS DE PROGRAMA DIÁRIO (Carousel) */
.program-carousel { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; gap: 16px; margin: 0 -16px 24px; padding: 0 16px; }
.program-carousel::-webkit-scrollbar { display: none; }
.dw-card { position: relative; border-radius: 20px; overflow: hidden; background: #141414; box-shadow: 0 15px 40px rgba(0,0,0,0.8); flex: 0 0 92%; scroll-snap-align: center; }
.dw-bg { position: absolute; inset: 0; background-position: center; background-size: cover; background-repeat: no-repeat; opacity: 0.6; }
.dw-overlay { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,1) 100%); }
.dw-content { position: relative; z-index: 2; padding: 24px; padding-top: 160px; display: flex; flex-direction: column; gap: 12px; }
.dw-title { font-size: 26px; font-weight: 900; line-height: 1.1; text-transform: uppercase; color: #fff; margin-bottom: 4px; }
.dw-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.dw-badge { background: rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.2); color: #fff; padding: 6px 12px; border-radius: 100px; font-size: 11px; font-weight: 700; display: flex; align-items: center; gap: 4px; backdrop-filter: blur(8px); text-transform: uppercase; letter-spacing: 0.5px; }
.dw-badge .material-icons-round { font-size: 14px; color: var(--accent); }
.dw-btn { margin-top: 8px; width: 100%; box-shadow: 0 10px 20px rgba(229,46,45,0.5); }

/* VÍDEO NO MODAL */
.exercise-media { 
    width: 100%; 
    height: 280px; 
    border-radius: 16px; 
    overflow: hidden; 
    margin-top: 16px; 
    margin-bottom: 20px; 
    background: #000; 
    position: relative; 
    border: 1px solid var(--border); 
}
.exercise-media iframe, #yt-player { width: 100%; height: 100%; border: none; }


.m-yt-fallback:hover {
  background: rgba(255,255,255,0.1);
  transform: translateY(-2px);
}
.m-yt-fallback.pulse {
  animation: pulse-border 2s infinite;
  background: rgba(255,59,48,0.2) !important;
  border-color: var(--red) !important;
  display: flex !important;
}
@keyframes pulse-border {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.4); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(255, 59, 48, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 59, 48, 0); }
}
.m-info-box {
    background: rgba(255,255,255,0.03);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    border: 1px solid rgba(255,255,255,0.05);
}
.m-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--accent2);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.m-stat .material-icons-round { font-size: 18px; color: var(--accent); }
.m-desc {
    font-size: 14px;
    color: rgba(255,255,255,0.7);
    line-height: 1.5;
    font-weight: 400;
}

.m-badge {
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 1px;
}

#yt-player {
    border-radius: 12px;
    overflow: hidden;
}




/* SESSION REGISTRY (REGISTO) */
.scard { margin:16px 16px 0; background:var(--bg2); border:none; border-radius:var(--r); padding:20px; box-shadow: 0 8px 30px rgba(0,0,0,0.5); }
.scard-top { display:flex; justify-content:space-between; align-items:center; margin-bottom:16px; }
.sname-wrap { display: flex; align-items: center; gap: 6px; }
.session-name-inp { background: transparent; border: none; color: var(--text); font-size: 18px; font-weight: 800; font-family: inherit; outline: none; width: 100%; max-width: 180px;}
.edit-icon { font-size: 16px; color: var(--text2); }
.scard-sub { color:var(--text2); font-size:11px; display: block; margin-top: 2px;}
.timer-wrap { text-align: right; }
.timer { font-size:36px; font-weight:900; font-variant-numeric:tabular-nums; color:var(--accent2); letter-spacing:-1px; line-height: 1; }
.timer-label { font-size: 10px; color: var(--text2); text-transform: uppercase; font-weight: 700; letter-spacing: 1px; }

.tctrls { display:flex; gap:10px; }
.tcb { flex:1; padding:12px; border:none; border-radius:12px; cursor:pointer; display:flex; flex-direction: column; align-items:center; justify-content:center; color:#fff; transition:all .2s; font-family: inherit; }
.tcb span:last-child { font-size: 10px; font-weight: 700; margin-top: 4px; text-transform: uppercase; letter-spacing: 0.5px;}
.tcgreen { background:rgba(16,185,129,0.2); color: var(--green); border: 1px solid rgba(16,185,129,0.3); }
.tcyellow { background:rgba(234,179,8,0.2); color: var(--yellow); border: 1px solid rgba(234,179,8,0.3); }
.tcred { background:rgba(239,68,68,0.2); color: var(--red); border: 1px solid rgba(239,68,68,0.3); }
.tcb:active { filter: brightness(1.2); transform: scale(0.95); }

/* EXERCISE LIST IN SESSION */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text2); display: flex; flex-direction: column; align-items: center; gap: 16px; }
.empty-state .material-icons-round { font-size: 48px; opacity: 0.5; }
.empty-state p { font-size: 14px; font-weight: 500; }

.sex-row { margin:8px 16px; background:var(--bg2); border:1px solid var(--border); border-radius:16px; padding:16px; display:flex; justify-content:space-between; align-items:center; gap:12px; transition: opacity 0.3s;}
.sex-row.done { opacity: 0.4; }
.sex-row.done .sex-name { text-decoration: line-through; }
.sex-info { flex:1; }
.sex-name { font-size:15px; font-weight:700; margin-bottom:4px; }
.sex-detail { font-size:13px; color:var(--text2); font-weight: 500; }
.sex-row button { border:none; border-radius:10px; padding:8px; cursor:pointer; display:flex; align-items:center; justify-content:center; transition: background 0.2s; }
.btn-del { background:rgba(239,68,68,0.1); color:var(--red); }
.btn-del:active { background:rgba(239,68,68,0.2); }
.btn-check { background:rgba(16,185,129,0.1); color:#10b981; margin-left: 4px; }
.btn-check:active { background:rgba(16,185,129,0.2); }
.btn-check.done { background:#10b981; color:#fff; }

.save-area { padding: 16px; background: var(--bg2); border-top: 1px solid var(--border); margin-top: 16px; display: flex; flex-direction: column; gap: 16px; }

/* EXERCISES DB (Search & Filter) */
.srch { margin:16px 16px 12px; background:var(--bg2); border:1px solid var(--border); border-radius:12px; display:flex; align-items:center; gap:10px; padding:12px 16px; }
.srch .material-icons-round { color:var(--text2); }
.srch input { flex:1; background:none; border:none; color:var(--text); font-size:15px; outline:none; font-family:inherit; }
.srch-clear { background: rgba(255,255,255,0.1); border: none; color: #fff; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.srch-clear .material-icons-round { font-size: 16px; color: #fff; }

.cats { display:flex; gap:8px; padding:0 16px 16px; overflow-x:auto; scrollbar-width:none; }
.cats::-webkit-scrollbar { display:none; }
.cat { padding:8px 16px; border-radius:100px; border:1px solid var(--border); background:var(--bg2); color:var(--text2); font-size:13px; font-weight:600; cursor:pointer; white-space:nowrap; flex-shrink:0; font-family:inherit; transition:all .2s; }
.cat.active { background:var(--accent); border-color:var(--accent); color:#fff; }

.ex-grid { display: grid; gap: 10px; padding: 0 16px 24px; }
.ex-card { background:var(--bg2); border:1px solid var(--border); border-radius:16px; padding:12px 16px; display:flex; justify-content:space-between; align-items:center; cursor:pointer; transition:all .2s; }
.ex-card:active { transform:scale(0.98); border-color:var(--accent); background: var(--card); }
.ex-left { display:flex; align-items:center; gap:14px; }
.ex-icon { width:48px; height:48px; border-radius:14px; display:flex; align-items:center; justify-content:center; font-size:24px; flex-shrink:0; }
.ex-name { font-size:15px; font-weight:700; margin-bottom:4px; }
.ex-cat { font-size:11px; font-weight:600; color:var(--text2); text-transform:uppercase; letter-spacing:.5px; }
.ex-card > .material-icons-round { color:var(--accent); }

/* CALENDAR & HISTORY */
.calcard { margin:16px 16px 24px; background:var(--card); border:1px solid var(--border); border-radius:20px; padding:20px; }
.calnav { display:flex; justify-content:space-between; align-items:center; margin-bottom:20px; }
.cal-title { font-size:16px; font-weight:700; text-transform: capitalize;}
.cwdays { display:grid; grid-template-columns:repeat(7,1fr); text-align:center; font-size:12px; font-weight:600; color:var(--text2); margin-bottom:12px; }
.cdays { display:grid; grid-template-columns:repeat(7,1fr); gap:4px; }
.cday { aspect-ratio:1; display:flex; align-items:center; justify-content:center; font-size:14px; font-weight: 500; border-radius:10px; cursor:default; position:relative; }
.cday.today { background: rgba(255,255,255,0.1); font-weight:700; color: #fff; border: 1px solid rgba(255,255,255,0.2);}
.cday.has-workout { position: relative; font-weight: 700; }
.cday.has-workout::after { content: ''; position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); width: 4px; height: 4px; background: var(--accent); border-radius: 50%; }
.cday.has-workout.today { background: var(--accent); color: #fff; border: none; }
.cday.has-workout.today::after { background: #fff; }
.cday.empty { pointer-events:none; }

.control-table { width: 100%; border-collapse: collapse; font-size: 13px; }
/* ── REST TIMER ── */
.rest-timer {
  background: rgba(0, 163, 255, 0.05);
  border: 1px solid var(--border);
  border-color: rgba(0, 163, 255, 0.15);
  border-radius: 16px;
  padding: 16px;
  margin: 0 16px 20px 16px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}
.rt-label { font-size: 10px; font-weight: 700; color: var(--blue); letter-spacing: 1px; margin-bottom: 4px; }
.rt-num { font-size: 28px; font-weight: 800; color: #fff; text-shadow: 0 0 10px rgba(0, 163, 255, 0.5); }
.rt-bar { 
  position: absolute; bottom: 0; left: 0; height: 4px; 
  background: var(--blue); width: 100%; transition: width 0.1s linear;
  box-shadow: 0 0 10px var(--blue);
}

/* ── RECENT CARDS ── */
.recent-card {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px; margin-bottom: 10px;
  transition: transform 0.2s; cursor: pointer;
}
.recent-card:active { transform: scale(0.98); }
.rc-left { display: flex; align-items: center; gap: 14px; }
.rc-date {
  background: #151520; width: 44px; height: 44px; border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,0.05);
}
.rc-date b { font-size: 14px; line-height: 1; }
.rc-date small { font-size: 8px; text-transform: uppercase; color: var(--blue); }
.rc-name { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.rc-met { font-size: 11px; color: #888; }
.recent-card span { color: #555; }

.control-table th { text-align: left; padding: 12px 16px; color: var(--text2); font-weight: 600; border-bottom: 1px solid var(--border); font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;}
.control-table td { padding: 16px; border-bottom: 1px solid rgba(255,255,255,0.05); vertical-align: top; }
.control-table .th-date { font-weight: 800; color: var(--accent); font-size: 14px; white-space: nowrap; }
.control-table .th-name { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.control-table .th-dur { font-size: 12px; color: var(--text2); display: flex; align-items: center; gap: 4px; }
.view-details-btn { background: var(--bg2); border: 1px solid var(--border); color: var(--text); padding: 6px 12px; border-radius: 8px; font-size: 12px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 4px; width: max-content; margin-top: 8px;}
.sd-loading { padding: 16px; text-align: center; color: var(--text2); }
.sd-ex { display: flex; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,0.05); padding: 12px 16px; font-size: 13px; }
.sd-ex:last-child { border-bottom: none; }
.sd-ex-name { font-weight: 600; color: #fff; }
.sd-ex-det { color: var(--text2); }
.del-btn { background: none; border: none; color: var(--red); opacity: 0.5; padding: 6px; cursor: pointer; transition: opacity 0.2s; border-radius: 8px; }
.del-btn:active { opacity: 1; background: rgba(239,68,68,0.1); }

.loading-state { display: flex; justify-content: center; padding: 40px; color: var(--accent); }

/* PROFILE PAGE */
.profile-hero { display: flex; flex-direction: column; align-items: center; padding: 20px 16px 32px; border-bottom: 1px solid var(--border); }
.profile-av { width: 80px; height: 80px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 800; margin-bottom: 16px; border: 4px solid var(--bg2); box-shadow: 0 0 0 2px var(--accent); }
.profile-name { font-size: 24px; font-weight: 800; margin-bottom: 4px; }
.profile-since { font-size: 13px; color: var(--text2); }

.profile-form { padding: 0 16px 24px; display: flex; flex-direction: column; gap: 16px; }
.sel-wrap { position: relative; }
.sel-wrap select { appearance: none; padding-right: 40px; }
.sel-wrap::after { content: 'expand_more'; font-family: 'Material Icons Round'; position: absolute; right: 14px; color: var(--text2); pointer-events: none; }

/* BOTTOM NAV */
.bnav { position:fixed; bottom:0; left:0; right:0; max-width: 480px; margin: 0 auto; height:var(--nav-h); background:rgba(10,10,15,0.85); backdrop-filter:blur(20px); border-top:1px solid var(--border); display:flex; align-items:center; justify-content:space-around; padding:0 6px; z-index:100; }
.nb { display:flex; flex-direction:column; align-items:center; justify-content: center; gap:4px; background:none; border:none; color:var(--text2); font-size:10px; font-weight:600; cursor:pointer; padding:8px 0; border-radius:12px; transition:all .2s; width: 60px; height: 100%; font-family:inherit; }
.nb.active { color:var(--accent2); }
.nb.active .material-icons-round { color:var(--accent2); transform: translateY(-2px); }
.nb .material-icons-round { font-size:24px; transition:transform .2s; }
.ncenter { width:56px; height:56px; border-radius:50%; background:var(--accent); border:none; color:#fff; cursor:pointer; display:flex; align-items:center; justify-content:center; box-shadow:0 8px 24px rgba(229,46,45,0.4); transition:transform .2s, box-shadow .2s; flex-shrink:0; transform: translateY(-10px); }
.ncenter:active { transform:translateY(-10px) scale(0.9); box-shadow:0 4px 12px rgba(229,46,45,0.3); }
.ncenter .material-icons-round { font-size:32px; }

/* MODAL: ADD SET */
.mbg { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.8); backdrop-filter:blur(4px); z-index:200; align-items:flex-end; max-width: 480px; margin: 0 auto; }
.mbg.open { display:flex; }
.mbox { background:var(--bg); border-radius:24px 24px 0 0; padding:24px 20px 40px; width:100%; border:1px solid var(--border); border-bottom:none; animation:slideUp .3s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes slideUp { from{transform:translateY(100%)} to{transform:translateY(0)} }
.mhdr { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:24px; }
.mhdr h3 { font-size:20px; font-weight:800; line-height: 1.2;}
.msub { font-size: 13px; color: var(--text2); margin-top: 4px; font-weight: 500;}

.modal-sets-row { display: flex; flex-direction: column; gap: 16px; background: var(--bg2); padding: 16px; border-radius: 16px; border: 1px solid var(--border); }
.mset-group { display: flex; justify-content: space-between; align-items: center; }
.mset-group label { font-size: 14px; font-weight: 600; color: var(--text); }
.num-ctrl { display: flex; align-items: center; background: var(--bg3); border-radius: 12px; overflow: hidden; border: 1px solid var(--border);}
.num-ctrl button { width: 40px; height: 40px; background: none; border: none; color: var(--accent2); font-size: 20px; font-weight: 300; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.num-ctrl button:active { background: rgba(255,255,255,0.05); }
.num-ctrl input { width: 50px; text-align: center; background: none; border: none; border-left: 1px solid var(--border); border-right: 1px solid var(--border); color: #fff; font-size: 16px; font-weight: 700; font-family: inherit; -moz-appearance: textfield; appearance: textfield; }
.num-ctrl input::-webkit-outer-spin-button, .num-ctrl input::-webkit-inner-spin-button { -webkit-appearance: none; appearance: none; margin: 0; }

.m-yt-fallback {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  color: #fff;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255,255,255,0.1);
  transition: all 0.2s;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.m-yt-fallback:active {
  transform: scale(0.95);
  background: var(--accent);
  border-color: var(--accent);
}
.m-yt-fallback span { font-size: 16px; color: var(--accent2); }
.m-yt-fallback:active span { color: #fff; }

/* TOAST */
.toast { position: fixed; bottom: -100px; left: 50%; transform: translateX(-50%); background: var(--card); border: 1px solid var(--accent); color: #fff; padding: 14px 24px; border-radius: 100px; font-weight: 600; font-size: 14px; z-index: 999; box-shadow: 0 10px 30px rgba(0,0,0,0.5); transition: bottom 0.3s cubic-bezier(0.16, 1, 0.3, 1); display: flex; align-items: center; gap: 8px; white-space: nowrap; max-width: 440px; }
.toast.show { bottom: 90px; }
.toast.error { border-color: var(--red); }
.toast span { color: var(--accent2); }
.toast.error span { color: var(--red); }
