:root {
    --font-hand: "Comic Sans MS", "Trebuchet MS", cursive;
    --card-paper: #fbf4df;
    --stamp-locked: rgba(84, 98, 112, 0.36);
    --stamp-unlocked: #253f8f;
    --tree-w: 390px;
    --tree-h: 620px;
}

.notebook-page {
    width: 100%;
    max-width: 1040px;
    padding: 0 16px var(--notebook-grid);
}

.notebook-summary {
    display: block;
    margin: 0 0 10px;
}

.summary-board {
    align-self: center;
    min-width: 0;
}

.summary-board .gamestat-row {
    min-height: 64px;
}

.focus-link {
    display: inline;
    color: var(--page-blue);
    font-weight: 700;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.notebook-games-list a {
    color: var(--page-blue);
    font-weight: 700;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.record-game {
    font-weight: 700 !important;
}

.record-level {
    padding-left: 18px;
    color: var(--ink-soft) !important;
}

.notebook-screen-sheet {
    padding: 8px 8px 0;
}

.tree-scroll {
    width: 100vw;
    max-width: none;
    height: auto;
    min-height: 0;
    margin-right: calc(50% - 50vw);
    margin-left: calc(50% - 50vw);
    overflow: hidden;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.tree-map {
    position: relative;
    width: var(--tree-w);
    height: var(--tree-h);
    margin: 0;
}

.tree-map-inner {
    position: absolute;
    left: 0;
    top: 0;
    width: var(--tree-w);
    height: var(--tree-h);
    transform-origin: 0 0;
}

.tree-brain-field {
    position: absolute;
    inset: 1px;
    z-index: 0;
    width: auto;
    height: auto;
    background:
        linear-gradient(rgba(247, 241, 223, 0.64), rgba(247, 241, 223, 0.64)),
        var(--brain-gradient, var(--page-blue));
    mask: url("./brain-silhouette-field.svg") center / 100% 100% no-repeat;
    -webkit-mask: url("./brain-silhouette-field.svg") center / 100% 100% no-repeat;
    opacity: 0.2;
    pointer-events: none;
}

.tree-lines {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.tree-line {
    fill: none;
    stroke: var(--branch-color, rgba(82, 98, 118, 0.46));
    opacity: 0.42;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 3;
}

.tree-line--active {
    opacity: 0.88;
    stroke-width: 4;
}

.tree-core {
    position: absolute;
    left: 198px;
    top: 315px;
    z-index: 3;
    display: grid;
    width: 132px;
    height: 132px;
    place-items: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: #263241;
    filter: drop-shadow(0 5px 0 rgba(82, 69, 49, 0.12)) drop-shadow(0 0 8px rgba(255, 255, 255, 0.75));
    transform: translate(-50%, -50%) rotate(-1deg);
}

.tree-core__brain {
    display: block;
    width: 126px;
    height: 126px;
    background:
        linear-gradient(rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.24)),
        var(--brain-gradient, var(--page-blue));
    mask: url("./brain-silhouette.svg") center / contain no-repeat;
    -webkit-mask: url("./brain-silhouette.svg") center / contain no-repeat;
    opacity: 0.96;
}

.tree-core__percent {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 1;
    display: grid;
    width: max-content;
    min-width: 0;
    height: auto;
    place-items: center;
    padding: 5px 8px 4px;
    border: 1px solid rgba(17, 24, 33, 0.58);
    background: rgba(247, 241, 223, 0.9);
    box-shadow:
        -1px 1px 0 rgba(82, 69, 49, 0.14),
        inset 0 -3px 0 rgba(17, 24, 33, 0.12);
    color: #111821;
    font-family: var(--font-main);
    font-size: 11px;
    font-weight: 700;
    line-height: 13px;
    letter-spacing: 0;
    text-align: center;
    text-shadow: none;
    text-transform: uppercase;
    transform: translate(-50%, -50%);
}

.tree-node {
    position: absolute;
    z-index: 2;
    width: 24px;
    height: 24px;
    border: 2px solid rgba(82, 69, 49, 0.28);
    border-radius: 50%;
    background:
        radial-gradient(circle at 38% 30%, rgba(255, 255, 255, 0.72), transparent 34%),
        #f3ecdc;
    color: transparent;
    cursor: help;
    box-shadow:
        -1px 2px 0 rgba(82, 69, 49, 0.16),
        inset 0 0 0 1px rgba(255, 255, 255, 0.42);
    transform: translate(-50%, -50%);
}

.tree-node--seed {
    width: 18px;
    height: 18px;
}

.tree-node--minor {
    width: 22px;
    height: 22px;
}

.tree-node--standard {
    width: 25px;
    height: 25px;
}

.tree-node--major {
    width: 28px;
    height: 28px;
}

.tree-node--epic {
    width: 30px;
    height: 30px;
    border-width: 2.5px;
}

.tree-node--secondary {
    opacity: 0.62;
    transform: translate(-50%, -50%) scale(0.86);
}

.tree-node--secondary.tree-node--unlocked,
.tree-node--secondary.tree-node--focus {
    opacity: 0.86;
}

.tree-node::after {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #aaa393;
    content: "";
    transform: translate(-50%, -50%);
}

.tree-node--seed::after {
    width: 5px;
    height: 5px;
}

.tree-node--major::after {
    width: 7px;
    height: 7px;
}

.tree-node--epic::after {
    width: 8px;
    height: 8px;
}

.tree-node--unlocked {
    border-color: color-mix(in srgb, var(--branch-color, #263241) 78%, #263241);
    background:
        radial-gradient(circle at 36% 28%, rgba(255, 255, 255, 0.34), transparent 30%),
        color-mix(in srgb, var(--branch-color, #253f8f) 88%, #f3ecdc);
    box-shadow:
        0 0 0 3px color-mix(in srgb, var(--branch-color, transparent) 18%, transparent),
        -1px 2px 0 rgba(82, 69, 49, 0.18),
        inset 0 0 0 2px rgba(255, 255, 255, 0.32);
}

.tree-node--unlocked::after {
    width: 45%;
    height: 45%;
    background: rgba(255, 250, 231, 0.92);
    box-shadow: 0 0 0 1px rgba(38, 50, 65, 0.12);
}

.tree-node--seed.tree-node--unlocked::after {
    width: 42%;
    height: 42%;
}

.tree-node--major.tree-node--unlocked::after {
    width: 46%;
    height: 46%;
}

.tree-node--epic.tree-node--unlocked::after {
    width: 48%;
    height: 48%;
}

.tree-node--focus {
    z-index: 5;
    border-color: color-mix(in srgb, var(--branch-color, #263241) 88%, #263241);
    background:
        radial-gradient(circle at 38% 30%, rgba(255, 255, 255, 0.78), transparent 34%),
        #f7f1df;
    box-shadow:
        0 0 0 4px rgba(247, 241, 223, 0.9),
        0 0 0 7px color-mix(in srgb, var(--branch-color, transparent) 54%, transparent),
        0 0 16px color-mix(in srgb, var(--branch-color, transparent) 30%, transparent),
        -1px 2px 0 rgba(82, 69, 49, 0.18);
}

.tree-node--focus::after {
    width: 34%;
    height: 34%;
    background: color-mix(in srgb, var(--branch-color, #263241) 82%, #263241);
    box-shadow: none;
}

.tree-node--selected {
    z-index: 6;
    outline: 2px solid color-mix(in srgb, var(--branch-color, #263241) 76%, #263241);
    outline-offset: 3px;
}

.stamp-detail-card {
    position: absolute;
    top: var(--stamp-card-top, 390px);
    left: var(--stamp-card-left, 50%);
    z-index: 12;
    width: min(360px, calc(100vw - 28px));
    max-width: 360px;
    padding: 10px 36px 10px 12px;
    border: 1px solid color-mix(in srgb, var(--branch-color, var(--ink-soft)) 72%, rgba(82, 69, 49, 0.28));
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.18) 1px, transparent 1px),
        linear-gradient(0deg, rgba(82, 69, 49, 0.06) 1px, transparent 1px),
        rgba(247, 241, 223, 0.96);
    background-size: 17px 19px, 23px 29px, auto;
    box-shadow:
        -1px 2px 0 rgba(82, 69, 49, 0.2),
        -4px 5px 0 rgba(200, 188, 168, 0.78),
        inset 0 -4px 0 color-mix(in srgb, var(--branch-color, transparent) 14%, transparent);
    color: var(--ink);
    transform: translateX(-50%);
}

.stamp-detail-card[hidden] {
    display: none;
}

.stamp-detail-status {
    display: block;
    color: color-mix(in srgb, var(--branch-color, var(--page-blue)) 78%, #263241);
    font-size: 11px;
    font-weight: 800;
    line-height: 14px;
    text-transform: uppercase;
}

.stamp-detail-card h3,
.stamp-detail-card p {
    margin: 0;
}

.stamp-detail-card h3 {
    color: var(--ink);
    font-family: var(--font-hand);
    font-size: 18px;
    font-weight: 600;
    line-height: 22px;
}

.stamp-detail-card p {
    color: var(--ink);
    font-size: 13px;
    line-height: 18px;
}

.stamp-detail-link {
    display: inline-block;
    margin-top: 6px;
    color: color-mix(in srgb, var(--branch-color, var(--page-blue)) 78%, #263241);
    font-size: 13px;
    font-weight: 800;
    line-height: 18px;
    text-decoration-line: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.stamp-detail-close {
    position: absolute;
    top: 7px;
    right: 7px;
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(82, 69, 49, 0.26);
    border-radius: 50%;
    background: rgba(255, 250, 231, 0.74);
    color: var(--ink-soft);
    cursor: pointer;
    line-height: 1;
}

.tree-label {
    position: absolute;
    z-index: 4;
    display: inline-grid;
    width: max-content;
    min-width: 0;
    padding: 5px 8px 4px;
    border: 1px solid color-mix(in srgb, var(--branch-color, var(--ink-soft)) 72%, rgba(82, 69, 49, 0.26));
    background: rgba(247, 241, 223, 0.9);
    box-shadow:
        -1px 1px 0 rgba(82, 69, 49, 0.14),
        inset 0 -3px 0 color-mix(in srgb, var(--branch-color, transparent) 18%, transparent);
    color: color-mix(in srgb, var(--branch-color, var(--ink-soft)) 82%, #263241);
    font-size: 11px;
    font-weight: 700;
    line-height: 13px;
    text-align: center;
    text-transform: uppercase;
    transform: translate(-50%, -50%);
    white-space: nowrap;
}

.tree-label span {
    display: block;
}

.stamp-line--locked {
    opacity: 0.62;
}

.empty-state {
    color: var(--ink-soft);
}

@media (max-width: 760px) {
    .notebook-page {
        padding-right: 12px;
        padding-left: 12px;
    }

}
