/* Învață cu mine: the study room page. Warm lamp-light tones over the 3D stage; the timer is a glass card, the
   panels slide in from the right, and the controls fade while you study. */
:root {
    --iv-amber: #f0c27a;
    --iv-amber-2: #ffe0a8;
    --iv-ink: #14110d;
    --iv-text: #f3ece0;
    --iv-muted: #b9ad9a;
    --iv-glass: rgba(20, 16, 12, .78);
    --iv-line: rgba(240, 194, 122, .28);
    --iv-sage: #9fbf94;
    --iv-break: #8fc3d8;
}
body.invata-page { background: #120f0c; color: var(--iv-text); overflow-x: clip; }
.iv-main { width: min(100% - 32px, 1120px); margin: 0 auto; padding-top: 96px; padding-bottom: 46px; }
.iv-intro { margin-bottom: 18px; }
.iv-eyebrow { margin: 0 0 4px; color: var(--iv-amber); font: 700 .78rem/1.2 system-ui, sans-serif; letter-spacing: .14em; }
.iv-intro h1 { margin: 0 0 6px; font: 700 clamp(2rem, 4vw, 3rem)/1.05 Georgia, "Times New Roman", serif; color: #fff4e2; }
.iv-intro p { margin: 0; max-width: 62ch; color: var(--iv-muted); }

/* the stage */
.iv-stage {
    position: relative; overflow: hidden; width: 100%; aspect-ratio: 16 / 9; min-height: 420px; max-height: 82vh;
    border-radius: 18px; border: 1px solid var(--iv-line); background: #0d0b09; box-shadow: 0 24px 70px #000a;
    color: var(--iv-text); font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; outline: none;
}
.iv-stage:focus-visible { box-shadow: 0 0 0 2px var(--iv-amber), 0 24px 70px #000a; }
.iv-stage:fullscreen, .iv-stage:-webkit-full-screen { width: 100%; height: 100%; max-height: none; border-radius: 0; border: 0; aspect-ratio: auto; }
.iv-stage.is-max { position: fixed; inset: 0; z-index: 1052; width: 100vw; height: 100vh; max-height: none; border-radius: 0; border: 0; aspect-ratio: auto; }
.iv-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.iv-fade { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; z-index: 1; }
.iv-fade.is-on { animation: iv-cut 1.4s ease; }
@keyframes iv-cut { 0% { opacity: .85; } 100% { opacity: 0; } }
.iv-loading { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--iv-amber); letter-spacing: .06em; z-index: 1; }
.iv-stage:not([data-mode="loading"]) .iv-loading { display: none; }

/* the timer card */
.iv-hud {
    position: absolute; left: 18px; bottom: 18px; z-index: 3; display: grid; gap: 10px; padding: 14px 16px 12px;
    background: var(--iv-glass); border: 1px solid var(--iv-line); border-radius: 18px; backdrop-filter: blur(8px);
    min-width: 248px; transition: opacity .6s ease, transform .6s ease;
}
.iv-clock { display: grid; grid-template-columns: 74px 1fr; align-items: center; gap: 14px; }
.iv-ring {
    --k: 0; width: 74px; height: 74px; border-radius: 50%;
    background: conic-gradient(var(--iv-ring, var(--iv-amber)) calc(var(--k) * 360deg), rgba(255, 255, 255, .1) 0);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px));
            mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px));
}
.iv-stage[data-phase="short"] .iv-ring, .iv-stage[data-phase="long"] .iv-ring { --iv-ring: var(--iv-break); }
.iv-clock-text { display: grid; gap: 2px; }
.iv-phase { font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--iv-amber); }
.iv-stage[data-phase="short"] .iv-phase, .iv-stage[data-phase="long"] .iv-phase { color: var(--iv-break); }
.iv-time { font: 700 2.6rem/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .02em; color: #fff7ea; font-variant-numeric: tabular-nums; }
.iv-dots { display: flex; gap: 6px; }
.iv-dot { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--iv-muted); }
.iv-dot.is-now { border-color: var(--iv-amber); box-shadow: 0 0 0 3px rgba(240, 194, 122, .2); }
.iv-dot.is-done { background: var(--iv-amber); border-color: var(--iv-amber); }
.iv-ctl { display: flex; gap: 8px; }
.iv-today { margin: 0; font-size: .8rem; color: var(--iv-muted); }

.iv-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 14px;
    border-radius: 12px; border: 1px solid var(--iv-line); background: rgba(255, 255, 255, .06); color: var(--iv-text);
    font-weight: 600; cursor: pointer; transition: background .2s, transform .1s;
}
.iv-btn:hover { background: rgba(255, 255, 255, .12); }
.iv-btn:active { transform: translateY(1px); }
.iv-btn:focus-visible, .iv-round:focus-visible, .iv-place:focus-visible, .iv-avatar:focus-visible, .iv-preset:focus-visible { outline: 2px solid var(--iv-amber); outline-offset: 2px; }
.iv-btn-main { flex: 1; background: linear-gradient(135deg, #f0c27a, #d99a4e); color: #2a1a08; border-color: transparent; }
.iv-btn-main:hover { background: linear-gradient(135deg, #ffd697, #e6a95c); }

/* the tools on the right */
.iv-tools { position: absolute; top: 14px; right: 14px; z-index: 4; display: grid; gap: 8px; transition: opacity .6s ease; }
.iv-round {
    position: relative; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--iv-line);
    background: var(--iv-glass); color: var(--iv-text); display: grid; place-items: center; cursor: pointer;
}
.iv-round:hover, .iv-round[aria-pressed="true"] { background: rgba(240, 194, 122, .22); color: #fff; }
.iv-round.is-muted { color: var(--iv-muted); text-decoration: line-through; }
.iv-round[data-count]:not([data-count=""])::after {
    content: attr(data-count); position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px;
    border-radius: 9px; background: var(--iv-amber); color: #2a1a08; font: 700 .7rem/18px system-ui, sans-serif; text-align: center;
}

/* the panels */
.iv-panel {
    position: absolute; top: 14px; right: 66px; bottom: 14px; z-index: 5; width: min(340px, calc(100% - 82px)); overflow: auto;
    padding: 14px 16px; background: var(--iv-glass); border: 1px solid var(--iv-line); border-radius: 16px; backdrop-filter: blur(10px);
    animation: iv-in .25s ease;
}
.iv-panel-wide { width: min(460px, calc(100% - 82px)); }
@keyframes iv-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.iv-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.iv-panel h2 { margin: 0; font: 700 1.15rem/1.2 Georgia, serif; color: #fff4e2; }
.iv-panel h3 { margin: 14px 0 6px; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--iv-amber); }
.iv-panel h3 small { text-transform: none; letter-spacing: 0; color: var(--iv-muted); }
.iv-x { border: 0; background: none; color: var(--iv-muted); font-size: 1.5rem; line-height: 1; cursor: pointer; }
.iv-x:hover { color: #fff; }
.iv-muted { color: var(--iv-muted); font-size: .85rem; margin: 10px 0 0; }
.iv-link { margin-top: 10px; border: 0; background: none; padding: 0; color: var(--iv-amber); text-decoration: underline; cursor: pointer; font-size: .85rem; }
.iv-task-form { display: flex; gap: 8px; }
.iv-task-form input, .iv-select select {
    flex: 1; min-width: 0; min-height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--iv-line);
    background: rgba(0, 0, 0, .35); color: var(--iv-text);
}
.iv-task-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.iv-task-list li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, .05); }
.iv-task-list label { flex: 1; display: flex; align-items: center; gap: 10px; margin: 0; cursor: pointer; }
.iv-task-list input { width: 18px; height: 18px; accent-color: var(--iv-amber); }
.iv-task-list li.is-done span { color: var(--iv-muted); text-decoration: line-through; }
.iv-task-x { border: 0; background: none; color: var(--iv-muted); font-size: 1.2rem; cursor: pointer; }
.iv-switch { display: flex; align-items: center; gap: 10px; margin: 10px 0 0; cursor: pointer; }
.iv-switch input { width: 18px; height: 18px; accent-color: var(--iv-amber); }
.iv-range { display: grid; gap: 4px; margin: 12px 0 0; }
.iv-range input { accent-color: var(--iv-amber); }
.iv-select { display: flex; align-items: center; gap: 10px; margin: 12px 0 0; }
.iv-stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.iv-stats li { display: grid; place-items: center; padding: 8px 4px; border-radius: 10px; background: rgba(255, 255, 255, .05); text-align: center; }
.iv-stats b { font-size: 1.3rem; color: #fff4e2; }
.iv-stats span { font-size: .72rem; color: var(--iv-muted); }

/* choices: places, avatars, presets (on the cover and in the settings) */
.iv-places { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.iv-place {
    display: grid; gap: 2px; text-align: left; padding: 12px; border-radius: 14px; border: 1px solid var(--iv-line);
    background: rgba(255, 255, 255, .05); color: var(--iv-text); cursor: pointer;
}
.iv-place .iv-ico { font-size: 1.6rem; }
.iv-place b { font-size: 1rem; }
.iv-place small { color: var(--iv-muted); font-size: .78rem; line-height: 1.3; }
.iv-place[aria-pressed="true"], .iv-avatar[aria-pressed="true"], .iv-preset[aria-pressed="true"] { border-color: var(--iv-amber); background: rgba(240, 194, 122, .16); box-shadow: 0 0 0 1px var(--iv-amber) inset; }
.iv-place.is-small small { display: none; }
.iv-avatars { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
/* "make your own": the tiles for your own partner and your own rhythm look like an invitation, dashed */
.iv-avatar.is-mine, .iv-preset.is-mine { border-style: dashed; }
.iv-avatar-edit { display: grid; gap: 10px; margin-top: 10px; padding: 12px; border-radius: 12px; border: 1px dashed var(--iv-line); background: rgba(240, 194, 122, .06); }
.iv-avatar-edit[hidden] { display: none; }
.iv-ed-name { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 10px; margin: 0; }
.iv-ed-name span, .iv-ed-row > span { font-size: .8rem; font-weight: 600; color: var(--iv-text); }
.iv-ed-name input { min-height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--iv-line); background: rgba(0, 0, 0, .35); color: var(--iv-text); }
.iv-ed-row { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 6px 10px; }
.iv-ed-row > .iv-sws:nth-child(3), .iv-ed-row > .iv-chips + .iv-sws { grid-column: 2; }
.iv-sws, .iv-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.iv-swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .25); background: var(--c); cursor: pointer; }
.iv-swatch[aria-pressed="true"] { border-color: var(--iv-amber); box-shadow: 0 0 0 2px rgba(240, 194, 122, .35); }
.iv-chip { min-height: 30px; padding: 0 10px; border-radius: 15px; border: 1px solid var(--iv-line); background: rgba(255, 255, 255, .05); color: var(--iv-text); font-size: .8rem; cursor: pointer; }
.iv-chip[aria-pressed="true"] { border-color: var(--iv-amber); background: rgba(240, 194, 122, .2); }
.iv-swatch:focus-visible, .iv-chip:focus-visible { outline: 2px solid var(--iv-amber); outline-offset: 2px; }
.iv-avatar { display: grid; justify-items: center; gap: 4px; padding: 8px 4px; border-radius: 12px; border: 1px solid var(--iv-line); background: rgba(255, 255, 255, .05); color: var(--iv-text); cursor: pointer; }
.iv-avatar b { font-size: .82rem; }
/* a little face: hair, skin, the top's colour at the collar */
.iv-face { position: relative; width: 40px; height: 44px; }
.iv-face::before { content: ""; position: absolute; left: 6px; top: 2px; width: 28px; height: 30px; border-radius: 50% 50% 46% 46%; background: var(--skin); box-shadow: inset 0 9px 0 var(--hair); }
.iv-face::after { content: ""; position: absolute; left: 4px; bottom: 0; width: 32px; height: 12px; border-radius: 12px 12px 4px 4px; background: var(--top); }
.iv-glasses { position: absolute; left: 11px; top: 16px; width: 18px; height: 6px; border: 2px solid #222; border-radius: 3px; z-index: 1; }
.iv-presets { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
/* your own rhythm: four small number fields under the choices */
.iv-custom { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; padding: 10px; border-radius: 12px; border: 1px dashed var(--iv-line); background: rgba(240, 194, 122, .06); }
.iv-custom[hidden] { display: none; }
.iv-custom label { display: grid; gap: 3px; margin: 0; font-size: .78rem; color: var(--iv-muted); }
.iv-custom label span { color: var(--iv-text); font-weight: 600; }
.iv-custom input { width: 100%; min-height: 38px; padding: 0 8px; border-radius: 10px; border: 1px solid var(--iv-line); background: rgba(0, 0, 0, .35); color: var(--iv-text); font: 700 1rem ui-monospace, Menlo, Consolas, monospace; }
.iv-custom input:focus-visible { outline: 2px solid var(--iv-amber); outline-offset: 1px; }
.iv-custom small { font-size: .68rem; }
.iv-preset { display: grid; gap: 2px; padding: 8px; border-radius: 12px; border: 1px solid var(--iv-line); background: rgba(255, 255, 255, .05); color: var(--iv-text); cursor: pointer; }
.iv-preset b { font: 700 1.05rem/1.1 ui-monospace, Menlo, Consolas, monospace; }
.iv-preset small { font-size: .72rem; color: var(--iv-muted); }

/* the music: where it comes from, and YouTube's small player in a corner of the stage */
.iv-src { display: flex; flex-wrap: wrap; gap: 6px; }
.iv-yt { margin-top: 10px; }
.iv-yt-picks { margin-top: 8px; }
.iv-ytmini { position: absolute; right: 70px; bottom: 18px; z-index: 4; width: 240px; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; border: 1px solid var(--iv-line); background: #000; box-shadow: 0 10px 30px #0008; transition: opacity .6s ease; }
.iv-ytmini[hidden] { display: none; }
.iv-ytmini-frame, .iv-ytmini-frame iframe { width: 100%; height: 100%; display: block; border: 0; }
.iv-ytmini-x { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .7); color: #fff; font-size: 1rem; line-height: 1; cursor: pointer; }
.iv-stage.is-idle .iv-ytmini { opacity: .55; }
.iv-stage.is-cover .iv-ytmini { display: none; }

/* the cover */
.iv-cover { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; padding: 16px; background: linear-gradient(180deg, rgba(12, 10, 8, .35), rgba(12, 10, 8, .7)); overflow: auto; }
.iv-cover-card { width: min(640px, 100%); padding: 18px 20px; border-radius: 18px; background: var(--iv-glass); border: 1px solid var(--iv-line); backdrop-filter: blur(10px); }
.iv-cover-card h2 { margin: 0 0 12px; font: 700 1.7rem/1.1 Georgia, serif; color: #fff4e2; }
.iv-cover-card h3 { margin: 16px 0 8px; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--iv-amber); }
.iv-go { width: 100%; margin-top: 18px; min-height: 48px; font-size: 1.05rem; }
.iv-restart { display: block; margin: 10px auto 0; }
.iv-restart[hidden] { display: none; }
.iv-stage.is-cover .iv-hud, .iv-stage.is-cover .iv-tools > :not(#iv-t-full) { display: none; }
/* on the start menu: only the fullscreen button, so a tall menu can have the whole screen */
.iv-stage.is-cover .iv-tools { z-index: 7; }

/* studying: the controls step back */
.iv-stage.is-idle .iv-tools { opacity: 0; }
.iv-stage.is-idle .iv-hud { opacity: .55; }
.iv-stage.is-zen .iv-tools > :not(#iv-t-zen) { display: none; }
.iv-stage.is-zen .iv-ctl, .iv-stage.is-zen .iv-today { display: none; }
.iv-stage.is-zen .iv-hud { min-width: 0; }
.iv-stage.is-idle { cursor: none; }

.iv-toast {
    position: absolute; left: 18px; top: 16px; z-index: 7; max-width: min(460px, calc(100% - 90px));
    padding: 10px 16px; border-radius: 12px; background: var(--iv-glass); border: 1px solid var(--iv-line); color: var(--iv-text); text-align: center;
}
.iv-toast.is-on { animation: iv-toast 4.2s ease forwards; }
@keyframes iv-toast { 0% { opacity: 0; transform: translateY(-8px); } 8%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; } }

.iv-about { margin-top: 18px; padding: 14px 18px; border-radius: 14px; border: 1px solid var(--iv-line); background: rgba(255, 255, 255, .03); }
.iv-about summary { cursor: pointer; font-weight: 700; color: var(--iv-amber); }
.iv-about li { margin: 8px 0; color: var(--iv-muted); }
.iv-about strong { color: var(--iv-text); }
.iv-about kbd { background: #2a241c; color: var(--iv-amber-2); border: 1px solid var(--iv-line); }
.iv-powered { margin: 14px 0 0; color: var(--iv-muted); font-size: .9rem; }
.iv-powered a { color: var(--iv-amber); }

/* phones: the stage grows taller, the timer card spans the bottom, panels cover the stage */
@media (max-width: 720px) {
    .iv-main { width: 100%; padding-left: 16px; padding-right: 16px; }
    .iv-stage { aspect-ratio: 3 / 4; min-height: 0; max-height: none; }
    .iv-hud { left: 10px; right: 10px; bottom: 10px; min-width: 0; }
    .iv-time { font-size: 2.2rem; }
    .iv-tools { top: 10px; right: 10px; grid-auto-flow: column; }
    .iv-round { width: 38px; height: 38px; }
    .iv-panel, .iv-panel-wide { top: 58px; right: 10px; left: 10px; bottom: 10px; width: auto; }
    .iv-places { grid-template-columns: 1fr; }
    .iv-presets { grid-template-columns: repeat(2, 1fr); }
    .iv-custom { grid-template-columns: repeat(2, 1fr); }
    .iv-ed-name, .iv-ed-row { grid-template-columns: 1fr; }
    .iv-ytmini { right: 10px; bottom: auto; top: 58px; width: 168px; }
    .iv-ed-row > .iv-sws:nth-child(3), .iv-ed-row > .iv-chips + .iv-sws { grid-column: 1; }
    .iv-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .iv-fade.is-on, .iv-panel, .iv-toast.is-on { animation: none; } }
