/* Poštár – vzhľad: poštový papier, atrament, letecká obálka */
:root {
  --paper: #f5efe3; --card: #fffdf8; --ink: #1c2a4a; --mute: #6b7389; --line: #e2d9c6;
  --red: #cf4330; --blue: #2c5aa8; --green: #2c8558; --gold: #d99a1c; --bad: #b3261e;
  --serif: Georgia, 'Times New Roman', serif; --sans: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --stripes: repeating-linear-gradient(-45deg, var(--red) 0 12px, #fff 12px 24px, var(--blue) 24px 36px, #fff 36px 48px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.45 var(--sans); color: var(--ink); background: var(--paper); }
h1, h2, h3 { font-family: var(--serif); margin: 0 0 .4em; line-height: 1.2; }
h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
a { color: var(--blue); }
code { background: #efe7d6; padding: 1px 5px; border-radius: 4px; font-size: .92em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: .4em .8em; }
button:hover { border-color: var(--ink); }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid #f0b94b; outline-offset: 1px; }
button.primary { background: var(--ink); color: #fff; border-color: var(--ink); font-weight: 600; }
button.primary:hover { background: #0f1930; }
button.primary.sm { padding: .3em .7em; margin-top: .4em; font-size: .9em; }
button.danger { color: var(--bad); border-color: #e6b9b5; }
button:disabled { opacity: .5; cursor: wait; }
input, select, textarea { border: 1px solid var(--line); border-radius: 8px; padding: .45em .6em; background: #fff; }
.addr { color: var(--mute); font-size: .88em; }
.stamp { display: inline-grid; place-items: center; width: 2em; height: 2em; background: var(--red); color: #fff; border-radius: 6px;
  outline: 2px dashed #fff; outline-offset: -5px; font-size: 1.1em; transform: rotate(-6deg); }
.note { background: #eef4ff; border-left: 4px solid var(--blue); padding: .6em .8em; border-radius: 6px; margin: 0 0 .8em; }
.note.bad { background: #fdecea; border-color: var(--bad); }
.note.warn { background: #fff5dc; border-color: var(--gold); }
.empty { color: var(--mute); padding: 1em; }
.chip { display: inline-block; border: 1px solid var(--line); background: #f3ecdc; border-radius: 99px; padding: 0 .6em; font-size: .8em; line-height: 1.6; }
button.chip { padding: .1em .7em; font-size: .85em; }
.chip.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.av { flex: none; display: inline-grid; place-items: center; width: 2em; height: 2em; border-radius: 50%; color: #fff; font-weight: 700;
  background: hsl(var(--h, 210) 45% 42%); }
.av.big { width: 2.6em; height: 2.6em; font-size: 1.05em; }

/* ---------- prihlásenie ---------- */
body.login { display: grid; place-items: center; padding: 1rem;
  background: radial-gradient(circle at 20% 10%, #fff8e8, var(--paper) 60%); }
.card { position: relative; width: min(430px, 100%); background: var(--card); border-radius: 14px; padding: 2rem 1.8rem 1.4rem;
  box-shadow: 0 12px 40px rgba(28, 42, 74, .18); overflow: hidden; }
.airmail { position: absolute; inset: 0 0 auto 0; height: 10px; background: var(--stripes); }
.card .logo { display: flex; align-items: center; gap: .7rem; margin: .4rem 0 .6rem; }
.card h1 { font-size: 2.2rem; margin: 0; }
.lead { color: var(--mute); margin: 0 0 1.2rem; }
.card label { display: block; margin-bottom: .8rem; }
.card label span { display: block; font-size: .85em; font-weight: 600; margin-bottom: .2rem; }
.card input { width: 100%; padding: .65em .7em; font-size: 1.05rem; }
.card input.code { text-transform: uppercase; letter-spacing: .25em; font-weight: 700; }
.card .primary { width: 100%; padding: .75em; font-size: 1.05rem; margin-top: .3rem; }
.foot { text-align: center; font-size: .85em; margin: 1.1rem 0 0; }

/* ---------- hra ---------- */
body.game { display: flex; flex-direction: column; overflow: hidden; }
.top { display: flex; align-items: center; gap: 1rem; padding: .55rem 1rem; background: var(--ink); color: #fff; position: relative; }
.top::after { content: ''; position: absolute; left: 0; right: 0; bottom: -5px; height: 5px; background: var(--stripes); z-index: 2; }
.top .logo { display: flex; align-items: center; gap: .55rem; font-family: var(--serif); font-size: 1.25rem; }
.top .logo small { font: .75rem var(--sans); opacity: .7; }
.top input[type=search] { flex: 1; max-width: 560px; border: 0; border-radius: 99px; padding: .5em 1em; }
.me { margin-left: auto; display: flex; align-items: center; gap: .6rem; white-space: nowrap; }
.me .addr { color: #c9d2ea; }
.score { background: var(--gold); color: #1c1400; font-weight: 800; border-radius: 99px; padding: .15em .8em; }
.out { color: #c9d2ea; font-size: .85em; }
.layout { flex: 1; min-height: 0; display: grid; grid-template-columns: 185px minmax(260px, 1fr) minmax(340px, 1.35fr) 330px; margin-top: 5px; }
.layout > * { overflow-y: auto; min-height: 0; }
.side { padding: .8rem .5rem; border-right: 1px solid var(--line); }
.side a { display: flex; align-items: center; gap: .5rem; padding: .42em .7em; border-radius: 99px; cursor: pointer; color: inherit; text-decoration: none; }
.side a:hover { background: #ebe2cf; }
.side a.on { background: #dfe8fa; font-weight: 700; }
.side a i { font-style: normal; width: 1.3em; text-align: center; }
.side h4 { margin: 1em .7em .3em; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
.badge { margin-left: auto; background: var(--red); color: #fff; border-radius: 99px; font-size: .75em; padding: 0 .55em; font-weight: 700; }
.compose-btn { width: 100%; margin-bottom: .7rem; padding: .7em; background: var(--red); color: #fff; border: 0; font-weight: 700; border-radius: 12px; font-size: 1rem; }
.compose-btn:hover { background: #b7361f; }
.list { background: var(--card); border-right: 1px solid var(--line); }
.list-head { display: flex; align-items: baseline; gap: .6rem; padding: .7rem .9rem .3rem; position: sticky; top: 0; background: var(--card); z-index: 1; }
.list-head h2 { margin: 0; font-size: 1.05rem; }
.count { color: var(--mute); font-size: .85em; }
.row { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: 'av who meta' 'av subj subj'; column-gap: .6rem; padding: .5rem .9rem;
  border-top: 1px solid #efe8d8; cursor: pointer; color: inherit; text-decoration: none; }
.row:hover { background: #f8f2e4; }
.row.sel { background: #e7eefb; }
.row .av { grid-area: av; align-self: center; }
.row .who { grid-area: who; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--mute); font-size: .88em; }
.row .subj { grid-area: subj; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .subj b { font-weight: 500; }
.row .snip { color: var(--mute); }
.row.unread .who { color: var(--ink); font-weight: 700; }
.row.unread .subj b { font-weight: 800; }
.row.unread { box-shadow: inset 3px 0 0 var(--red); }
.row .meta { grid-area: meta; display: flex; gap: .3rem; align-items: center; font-size: .82em; color: var(--mute); }
.star.on, button.on { color: var(--gold); }
.pane { padding: 1rem 1.2rem; }
.blank { height: 100%; display: grid; place-content: center; justify-items: center; color: var(--mute); gap: .6rem; }
.blank .stamp { font-size: 2.2rem; opacity: .5; }
.msg .tools { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .9rem; }
.msg h2 { font-size: 1.4rem; }
.msg .from { display: flex; gap: .7rem; align-items: center; margin: .6rem 0; }
.msg .from .when { margin-left: auto; color: var(--mute); font-size: .85em; white-space: nowrap; }
.labels { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; font-size: .88em; color: var(--mute); margin-bottom: .8rem; }
button.link { border: 0; background: none; color: var(--blue); padding: 0 .3em; margin-left: auto; }
.msg .body { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.1rem; white-space: normal; overflow-wrap: anywhere; }
.fake-link { color: var(--blue); text-decoration: underline; cursor: pointer; font-weight: 600; }
.attach { margin-top: .6rem; padding: .5em .8em; border: 1px dashed var(--line); border-radius: 8px; background: #fbf6ea; }
.linkbar { margin-top: .6rem; font: .82rem ui-monospace, Consolas, monospace; color: var(--mute); background: #ece5d5; border-radius: 6px; padding: .35em .7em; }
.linkbar.show { background: var(--ink); color: #ffe9a8; }
.verdict { margin-top: 1rem; padding: .9rem 1rem; border-radius: 10px; background: #fff7df; border: 1px solid #ecd9a0; }
.verdict p { margin: 0 0 .6em; }
.verdict button { margin-right: .4rem; font-weight: 700; padding: .5em 1em; }
.v-ok { border-color: var(--green); color: var(--green); } .v-spam { border-color: var(--gold); color: #8a5f00; } .v-phish { border-color: var(--bad); color: var(--bad); }
.verdict.good { background: #e8f6ee; border-color: #a9d8bd; } .verdict.bad { background: #fdecea; border-color: #f0b8b2; }
.compose label { display: grid; grid-template-columns: 9.5em 1fr; align-items: center; gap: .5rem; margin-bottom: .45rem; }
.compose label span { color: var(--mute); font-size: .9em; }
.compose textarea { width: 100%; margin-top: .3rem; resize: vertical; font-family: var(--sans); line-height: 1.5; }
.compose .bar, .result .bar { display: flex; gap: .5rem; margin-top: .6rem; }
.ctc-row { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin: 0 0 .5rem 10em; font-size: .88em; }
.result { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 1.1rem 1.2rem; margin-bottom: 1rem; }
.sent-ok { font: 700 1.2rem var(--serif); margin-bottom: .6rem; color: var(--green); }
.tasktext { color: var(--mute); }
.crit { list-style: none; padding: 0; margin: .6rem 0; }
.crit li { padding: .25em 0; } .crit .ok { color: var(--green); } .crit .no { color: var(--bad); font-weight: 600; }
.big { font: 700 1.15rem var(--serif); } .good { color: var(--green); } .bad { color: var(--bad); }
.panel .ctc { display: flex; align-items: center; gap: .7rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.panel .ctc > div { flex: 1; }
form.inline { margin-top: 1.2rem; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: .9rem; }
form.inline h3 { width: 100%; margin: 0; }
.tasks { background: #efe7d6; border-left: 1px solid var(--line); padding: .8rem; }
.tasks-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.tasks-head h2 { margin: 0; }
.total { background: var(--gold); border-radius: 99px; padding: .1em .8em; font-weight: 800; }
.lvl { background: var(--card); border-radius: 10px; margin-bottom: .6rem; border: 1px solid var(--line); }
.lvl.locked { padding: .6em .8em; color: var(--mute); background: transparent; border-style: dashed; }
.lvl summary { display: flex; justify-content: space-between; gap: .5rem; padding: .6em .8em; cursor: pointer; font-weight: 700; list-style: none; }
.lvl summary::-webkit-details-marker { display: none; }
.lvl.full summary { color: var(--green); }
.lp { font-weight: 600; color: var(--mute); white-space: nowrap; }
.lvl .bar { height: 4px; background: #e9e0cc; margin: 0 .8em .3em; border-radius: 9px; overflow: hidden; }
.lvl .bar i { display: block; height: 100%; background: var(--green); transition: width .4s; }
.task { display: flex; gap: .5rem; padding: .5em .8em; border-top: 1px solid #f0e9d9; font-size: .9rem; }
.task.done { color: var(--mute); } .task.done .tick { color: var(--green); }
.tick { font-weight: 800; }
.pts { white-space: nowrap; color: var(--mute); font-size: .85em; }
.cnt { margin-top: .3em; font-weight: 600; color: var(--blue); }
.ans { display: flex; gap: .3rem; margin-top: .4em; } .ans input { flex: 1; min-width: 0; padding: .3em .5em; }
.flash { color: var(--bad); font-weight: 600; margin-top: .3em; }
.partner { margin: 0 .8em .5em; padding: .5em .7em; background: #e7eefb; border-radius: 8px; font-size: .9rem; }
.modal-bg { position: fixed; inset: 0; background: rgba(15, 22, 40, .6); display: grid; place-items: center; z-index: 50; padding: 1rem; }
.modal { background: #fff; border-radius: 14px; padding: 1.4rem 1.5rem; width: min(480px, 100%); border-top: 8px solid var(--blue); }
.modal.bad { border-top-color: var(--bad); }
.modal code { display: block; padding: .5em .7em; margin: .5em 0; overflow-wrap: anywhere; }
#toasts { position: fixed; top: 64px; right: 350px; z-index: 60; display: grid; gap: .4rem; }
.toast { font: 800 1.5rem var(--serif); padding: .2em .7em; border-radius: 12px; color: #fff; animation: toast 2.6s forwards; }
.toast.plus { background: var(--green); } .toast.minus { background: var(--bad); }
@keyframes toast { 0% { transform: translateY(20px) scale(.6); opacity: 0; } 15% { transform: none; opacity: 1; } 80% { opacity: 1; } 100% { transform: translateY(-30px); opacity: 0; } }
@media (max-width: 1150px) {
  body.game { overflow: auto; }
  .layout { grid-template-columns: 170px 1fr; }
  .layout > * { overflow: visible; }
  .pane, .tasks { grid-column: 1 / -1; }
  #toasts { right: 1rem; }
}

/* ---------- učiteľ ---------- */
body.teacher { background: var(--paper); }
.t-wrap { max-width: 1180px; margin: 0 auto; padding: 1.2rem 1rem 3rem; }
.t-top { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.t-top h1 { font-size: 1.6rem; margin: 0; }
.t-top .sp { margin-left: auto; }
.box { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.2rem; margin-bottom: 1rem; }
.box h2 { display: flex; align-items: center; gap: .6rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }
.tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.tabs a { padding: .4em 1em; border-radius: 99px; background: #e9e0cc; color: var(--ink); text-decoration: none; font-weight: 600; }
.tabs a.on { background: var(--ink); color: #fff; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: .4em .6em; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--mute); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.bigcode { font: 800 2rem ui-monospace, Consolas, monospace; letter-spacing: .2em; background: var(--ink); color: #ffe9a8; padding: .1em .5em; border-radius: 8px; }
.row-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .5rem 0; }
.fgrid { display: grid; grid-template-columns: 11em 1fr; gap: .5rem .8rem; align-items: center; max-width: 560px; }
.fgrid input, .fgrid select { width: 100%; }
.pips { display: inline-flex; gap: 3px; vertical-align: middle; }
.pips i { width: 16px; height: 8px; border-radius: 3px; background: #e2d9c6; position: relative; overflow: hidden; }
.pips i b { position: absolute; inset: 0 auto 0 0; background: var(--green); }
.pips i.off { opacity: .35; }
.lvl-checks { display: grid; gap: .3rem; }
.mailview { border: 1px solid var(--line); border-radius: 8px; padding: .6rem .8rem; margin-bottom: .6rem; background: #fff; }
.mailview pre { white-space: pre-wrap; font: inherit; margin: .4em 0 0; }
small.hint { color: var(--mute); display: block; margin-top: .2em; }
