:root {
    --bg: #0a090a;
    --card: rgba(20, 17, 20, .72);
    --line: rgba(255, 255, 255, .08);
    --ink: #e8e6e6;
    --ink2: #a5a0a0;
    --muted: #6f6a6a;
    --red: #e42320;
    --red-deep: #a31612;
}

* { box-sizing: border-box; }

html { height: 100%; }

body {
    background: var(--bg);
    color: var(--ink);
    margin: 0;
    overflow: hidden;
    height: 100%;
    font-family: ParagraphFont, Arial, Helvetica, sans-serif;
    user-select: none;
    -webkit-user-select: none;
}

#canvas {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    vertical-align: top;
    transition: opacity .6s;
}

.fill {
    width: 100%;
    height: 100%;
    position: absolute;
    z-index: 1;
    pointer-events: none;
}

#hud { opacity: 0; transition: opacity .6s; }

.container {
    width: 100%;
    height: 100%;
    max-width: 1060px;
    margin: auto;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0 22px;
}

/* ── header ─────────────────────────────── */
/* [EMBED980 2026-07-23] duas linhas próprias: linha 1 = marca + controles
   (sem wrap em iframe largo), linha 2 = subtexto. Antes o subtexto alargava
   a .brand, os controles desciam e caíam EM CIMA do teclado renderizado. */
.topbar {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 12px 0 6px;
    pointer-events: auto;
}

.topRow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

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

.dragon { width: 34px; height: 34px; border-radius: 8px; filter: drop-shadow(0 0 8px rgba(228, 35, 32, .35)); }

h1 {
    font-family: TitleFont, Arial, sans-serif;
    font-size: 22px;
    font-weight: 400;
    margin: 0;
    letter-spacing: .04em;
    text-transform: uppercase;
}

h1 span { color: var(--red); }

/* título + sub, sempre (pedido do mestre 23/07); alinhado com o título */
.subline {
    margin: 2px 0 0 46px;
    font-size: 12.5px;
    line-height: 1.35;
    color: var(--muted);
}

.controls {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.fxButton {
    cursor: pointer;
    opacity: .6;
    user-select: none;
    font-size: 13px;
    color: var(--ink2);
}

.fxButton:hover { opacity: 1; }
.fxButton:active { opacity: .75; }

.tipKey {
    display: inline-block;
    min-width: 22px;
    padding: 1px 3px 3px;
    border: 1px solid #565056;
    border-width: 1px 1px 3px;
    text-align: center;
    vertical-align: middle;
    border-radius: 4px;
    font-size: 11px;
}

/* checkbox */
.cbContainer {
    display: flex;
    align-items: center;
    gap: 7px;
    user-select: none;
    cursor: pointer;
    color: var(--ink2);
    font-size: 13px;
}

.cbContainer:hover { color: var(--ink); }

.cbContainer input { position: absolute; opacity: 0; height: 0; width: 0; }

.checkmark {
    position: relative;
    height: 15px;
    width: 15px;
    border-radius: 4px;
    border: solid 1px rgba(228, 35, 32, .6);
    flex: none;
}

.cbContainer input:focus ~ .checkmark { border-color: var(--red); }

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 4px;
    top: 0;
    width: 4px;
    height: 9px;
    border: solid var(--red);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.cbContainer input:checked ~ .checkmark:after { display: block; }

/* ── bottom panel ───────────────────────── */
/* [RODADA3 2026-07-23] teclado do render encolheu (main.js *.8): os cards
   ganham o respiro que o mestre pediu */
.bottomPanel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 12px;
    pointer-events: auto;
}

.row1 {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

/* missão */
.missionCard {
    flex: 1.35;
    min-width: 0;
    background: var(--card);
    border: 1px solid rgba(228, 35, 32, .35);
    border-left: 3px solid var(--red);
    border-radius: 12px;
    padding: 10px 14px 12px;
    transition: box-shadow .3s, border-color .3s;
}

.missionCard.complete {
    border-color: var(--red);
    box-shadow: 0 0 24px rgba(228, 35, 32, .35);
}

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

.missionTag {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--red);
}

.missionTrail { display: inline-flex; gap: 4px; flex: 1; }

.dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    color: transparent;
}

.dot.cur { border-color: var(--red); box-shadow: 0 0 6px rgba(228, 35, 32, .5); }
.dot.ok { background: var(--red); border-color: var(--red); color: #fff; }

.missionSkip {
    background: none;
    border: 0;
    color: var(--muted);
    font-family: ParagraphFont, Arial, sans-serif;
    font-size: 12px;
    cursor: pointer;
    padding: 2px 4px;
}

.missionSkip:hover { color: var(--ink); }

.missionName {
    font-family: TitleFont, Arial, sans-serif;
    font-size: 21px;
    margin-top: 4px;
    line-height: 1.15;
}

.missionCard.complete .missionName::after { content: " ✓"; color: var(--red); }

.missionHint { color: var(--muted); font-size: 12.5px; margin-top: 1px; }

.missionKeys {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    align-items: center;
    min-height: 30px;
}

.kcap {
    display: inline-block;
    min-width: 30px;
    text-align: center;
    padding: 4px 8px 6px;
    border: 1px solid #565056;
    border-width: 1px 1px 3px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--ink2);
    transition: all .1s;
}

.kcap.on {
    background: rgba(228, 35, 32, .22);
    border-color: var(--red);
    color: #fff;
    transform: translateY(1px);
    border-bottom-width: 2px;
}

.countGoal { font-size: 13.5px; color: var(--ink2); }
.countGoal b { color: var(--ink); font-size: 15px; }

.countBar {
    flex: 1;
    min-width: 90px;
    height: 6px;
    border-radius: 3px;
    background: rgba(228, 35, 32, .16);
    overflow: hidden;
}

.countFill {
    display: block;
    height: 100%;
    background: var(--red);
    border-radius: 3px;
    transition: width .12s;
}

/* coluna direita */
.rightCol {
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: space-between;
}

.tiles { display: flex; gap: 8px; flex-wrap: wrap; }

.tile {
    background: var(--card);
    border: 1px solid var(--line);
    border-left: 3px solid var(--red);
    border-radius: 10px;
    padding: 7px 12px;
    min-width: 108px;
}

.tileLabel {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--muted);
    white-space: nowrap;
}

.tileValue {
    font-family: TitleFont, Arial, sans-serif;
    font-size: 24px;
    margin-top: 2px;
    line-height: 1.1;
}

.tileValue.small { font-size: 16px; font-family: ParagraphFont, Arial, sans-serif; padding-top: 5px; }

.actions { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }

.chipsRow {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 28px;
    align-items: center;
}

.chipsHint { color: var(--muted); font-size: 12.5px; }

.chip {
    background: rgba(228, 35, 32, .14);
    border: 1px solid rgba(228, 35, 32, .4);
    color: var(--ink);
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 12px;
    animation: chipIn .12s ease-out;
}

@keyframes chipIn { from { transform: scale(.7); opacity: 0; } }

/* botões */
.redBtn {
    background: var(--red);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 9px 16px;
    font-family: ParagraphFont, Arial, sans-serif;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.redBtn:hover { background: #f03330; }
.redBtn:active { background: var(--red-deep); }

.ghostBtn {
    background: transparent;
    color: var(--ink2);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 14px;
    font-family: ParagraphFont, Arial, sans-serif;
    font-size: 13px;
    cursor: pointer;
}

.ghostBtn:hover { color: var(--ink); border-color: rgba(255, 255, 255, .2); }

.iDot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid currentColor;
    font-size: 11px;
    font-style: normal;
    margin-right: 4px;
    vertical-align: -3px;
}

/* ── footer ─────────────────────────────── */
.foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 2px 0 4px;
    font-size: 12.5px;
    color: var(--muted);
    flex-wrap: wrap;
}

.footBrand { font-family: TitleFont, Arial, sans-serif; letter-spacing: .18em; }

.tm { font-size: 8px; vertical-align: super; }

.foot a { color: var(--ink2); text-decoration: none; }
.foot a:hover { color: var(--red); }
.sep { margin: 0 8px; }

/* ── focus prompt ───────────────────────── */
.centerFill { display: flex; align-items: center; justify-content: center; }

#clickHere {
    text-align: center;
    background: rgba(24, 20, 20, .92);
    border: 1px solid rgba(228, 35, 32, .35);
    color: var(--ink);
    padding: 12px 22px;
    max-width: 420px;
    border-radius: 10px;
    opacity: 0;
    transition: opacity .6s;
    font-size: 14.5px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, .55);
}

/* ── mobile note ────────────────────────── */
.mobileNote {
    position: fixed;
    inset: 0;
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(10, 9, 10, .82);
    backdrop-filter: blur(4px);
}

.mobileCard {
    background: #141114;
    border: 1px solid var(--line);
    border-top: 3px solid var(--red);
    border-radius: 14px;
    padding: 22px;
    max-width: 380px;
    text-align: center;
    color: var(--ink2);
    font-size: 14.5px;
    line-height: 1.5;
}

.mobileCard h2 {
    font-family: TitleFont, Arial, sans-serif;
    font-weight: 400;
    font-size: 19px;
    color: var(--ink);
    margin: 0 0 8px;
}

.mobileCard .redBtn { margin-top: 8px; }

/* ── modal ──────────────────────────────── */
.modalBack {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .65);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    padding: 20px;
}

.modal {
    position: relative;
    background: #141114;
    border: 1px solid var(--line);
    border-top: 3px solid var(--red);
    border-radius: 14px;
    max-width: 520px;
    max-height: 86vh;
    overflow-y: auto;
    padding: 20px 24px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink2);
}

.modal h2 {
    font-family: TitleFont, Arial, sans-serif;
    font-weight: 400;
    font-size: 18px;
    color: var(--ink);
    margin: 13px 0 5px;
}

.modal h2:first-of-type { margin-top: 0; }
.modal b { color: var(--ink); }

.modalClose {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: 0;
    color: var(--muted);
    font-size: 26px;
    cursor: pointer;
    line-height: 1;
}

.modalClose:hover { color: var(--ink); }

/* tooltips dos cards de métrica */
[data-tip] { position: relative; cursor: help; }

[data-tip]:hover::after {
    content: attr(data-tip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 9px);
    /* --tipfix (extra.js) desloca pra tooltip nunca vazar da janela/iframe */
    transform: translateX(calc(-50% + var(--tipfix, 0px)));
    background: #1c191c;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 8px;
    padding: 8px 11px;
    font-size: 12.5px;
    font-family: ParagraphFont, Arial, sans-serif;
    text-transform: none;
    letter-spacing: normal;
    color: var(--ink);
    width: min(210px, calc(100vw - 30px));
    white-space: normal;
    line-height: 1.45;
    text-align: left;
    z-index: 30;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .55);
    pointer-events: none;
}

[data-tip]:hover::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: calc(100% + 4px);
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1c191c;
    z-index: 31;
    pointer-events: none;
}

/* scrollbar tematizada */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(228, 35, 32, .4); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: rgba(228, 35, 32, .65); }
html { scrollbar-width: thin; scrollbar-color: rgba(228, 35, 32, .4) transparent; }

/* ── responsive ─────────────────────────── */
@media (max-height: 700px) {
    .missionName { font-size: 18px; }
    .missionHint { display: none; }
    .chipsRow { min-height: 24px; }
    .tileValue { font-size: 20px; }
}

@media (max-width: 760px) {
    .container { padding: 0 14px; }
    .row1 { flex-direction: column; }
    .tile { min-width: 92px; padding: 6px 10px; }
    .tileValue { font-size: 20px; }
    .actions { justify-content: flex-start; }
}

[hidden] { display: none !important; }
