﻿.pred-board {
    --pb-gold: #d5a642;
    --pb-cream: #f7ead0;
    --pb-light: #4a4136;
    --pb-dark: #241d15;
    width: 100%;
    max-width: 360px;
    background: linear-gradient(180deg, rgba(213,166,66,0.05), rgba(0,0,0,0));
    border: 1px solid rgba(213,166,66,0.18);
    border-radius: 12px;
    padding: 12px;
    color: var(--pb-cream);
    box-sizing: border-box;
}

    .pred-board *, .pred-board *::before, .pred-board *::after {
        box-sizing: border-box;
    }

.pred-board__title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Cinzel',serif;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(247,234,208,0.55);
    margin-bottom: 8px;
}

    .pred-board__title span:first-child {
        color: var(--pb-gold);
    }

.pred-board__grid-wrap {
    position: relative;
    padding-left: 16px;
    padding-bottom: 16px;
}

.pred-board__grid {
    display: grid;
    grid-template-columns: repeat(8,1fr);
    aspect-ratio: 1;
    border: 1px solid rgba(213,166,66,0.3);
    border-radius: 4px;
    overflow: hidden;
}

.pb-sq {
    position: relative;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    cursor: default;
}

.pb-sq--light {
    background: var(--pb-light);
}

.pb-sq--dark {
    background: var(--pb-dark);
}

.pb-sq--placeable {
    cursor: pointer;
    box-shadow: inset 0 0 0 2px rgba(213,166,66,0.19);
    overflow: visible;
}

@keyframes pbFogFlow {
    0% {
        background-position: 0px 0px, 0px 0px, 0px 0px, 0px 0px;
    }

    100% {
        background-position: 45px 35px, 55px 45px, 65px 55px, 0px 0px;
    }
}

/* Known enemy piece — locked */
.pb-known-enemy {
    z-index: 6;
}

.pb-sq--needs-guess {
    box-shadow: inset 0 0 0 2px rgba(224,144,46,0.7);
}

.pb-known {
    width: 60%;
    height: 60%;
    border-radius: 50%;
    background: rgba(120,120,130,0.25);
    border: 1px solid rgba(200,200,210,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pb-known__glyph {
    font-family: 'Cinzel',serif;
    font-weight: 700;
    font-size: 0.7rem;
    color: rgba(230,230,240,0.75);
}

/* Player's PRIMARY guess */
.pb-guess {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 59%;
    height: 59%;
    border-radius: 50%;
    display: flex;
    z-index: 100;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.35);
}
    .pb-guess.pb-guess__dark,
    .pb-guess-alt.pb-guess__dark {
        background: rgba(166,120,67,0.40);
        border: 2px solid #a67843;
    }
    .pb-guess.pb-guess__light,
    .pb-guess-alt.pb-guess__light {
        background: rgba(224, 210, 180, 0.55);
        border: 2px solid #6b5a3f;
    }

.pb-guess__glyph {
    font-family: 'Cinzel',serif;
    font-weight: 700;
    font-size: 0.87rem;
    color: #2a1e08;
}

/* SECONDARY hedge — miniature lower-left */
.pb-guess-alt {
    position: absolute;
    left: 3px;
    bottom: 3px;
    width: 35%;
    height: 35%;
    border-radius: 50%;
    background: rgba(213,166,66,0.55);
    border: 1px solid #6b4f16;
    display: flex;
    z-index: 108;
    align-items: center;
    justify-content: center;
}

.pb-guess-alt__glyph {
    font-family: 'Cinzel',serif;
    font-weight: 700;
    font-size: 0.6rem;
    color: #2a1e08;
}

/* Empty specter prompt */
.pb-specter-empty {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 66%;
    height: 66%;
    border-radius: 50%;
    border: 2px dashed rgba(224,144,46,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cinzel',serif;
    font-weight: 700;
    font-size: 1.2rem;
    color: rgba(224,144,46,0.7);
    z-index: 6;
}

/* Hover controls */
.pb-plus, .pb-alt-del, .pb-alt-swap, .pb-remove {
    position: absolute;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 0.55rem;
    font-weight: 900;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: rgba(8,6,3,0.85);
    color: var(--pb-gold);
    z-index: 159;
    opacity: 1.0;
}

.pb-plus {
    left: 1px;
    bottom: 1px;
}

.pb-alt-del {
    left: 1px;
    bottom: 1px;
    color: #e06a5a;
}

.pb-alt-swap {
    left: 23px;
    bottom: 1px;
}

.pb-remove {
    right: 1px;
    top: 1px;
    color: #e06a5a;
    font-size: 0.5rem;
}

.pb-altmenu {
    --pb-gold: #d5a642;
    --pb-cream: #f7ead0;
    --pb-light: #4a4136;
    --pb-dark: #241d15;
    position: fixed;
    z-index: 1000;
    background: #1c160f;
    border: 1px solid rgba(213,166,66,0.4);
    border-radius: 6px;
    padding: 3px;
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 80px;
    box-shadow: 0 6px 14px rgba(0,0,0,0.6);
    opacity: 1 !important; /* defeat any inherited dimming */
    filter: none !important; /* defeat any inherited brightness filter */
}

.pb-altmenu__item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px 6px;
    background: transparent;
    border: none;
    color: var(--pb-cream);
    cursor: pointer;
    font-size: 0.58rem;
    border-radius: 4px;
    text-align: left;
    opacity: 1;
}

    .pb-altmenu__item:hover {
        background: rgba(213,166,66,0.15);
    }

.pb-altmenu__glyph {
    font-family: 'Cinzel',serif;
    font-weight: 700;
    color: var(--pb-gold);
}

/* Coordinates */
.pred-board__files {
    display: grid;
    grid-template-columns: repeat(8,1fr);
    position: absolute;
    bottom: 0;
    left: 16px;
    right: 0;
    font-size: 0.5rem;
    color: rgba(247,234,208,0.4);
    text-align: center;
    font-family: 'Cinzel',serif;
}

.pred-board__ranks {
    position: absolute;
    top: 0;
    bottom: 16px;
    left: 0;
    width: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    font-size: 0.5rem;
    color: rgba(247,234,208,0.4);
    text-align: center;
    font-family: 'Cinzel',serif;
}

/* Census tray */
.pred-board__tray {
    position: relative;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(213,166,66,0.15);
}

.pred-board__tray-title {
    font-family: 'Cinzel',serif;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(247,234,208,0.5);
    margin-bottom: 6px;
}

.pred-board__tray-items {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pb-tray-item {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(213,166,66,0.1);
    border: 1px solid rgba(213,166,66,0.25);
    cursor: pointer;
    color: var(--pb-cream);
}

.pb-tray-item--selected {
    background: rgba(213,166,66,0.3);
    border-color: var(--pb-gold);
}

.pb-tray-item--empty {
    opacity: 0.35;
    cursor: not-allowed;
}

.pb-tray-glyph {
    font-family: 'Cinzel',serif;
    font-weight: 700;
    font-size: 0.79rem;
}

.pb-tray-count {
    font-size: 0.74rem;
    color: rgba(247,234,208,0.65);
}

.pred-board__tray-hint {
    margin-top: 6px;
    font-size: 0.64rem;
    color: rgba(247,234,208,0.6);
}

    .pred-board__tray-hint b {
        color: var(--pb-gold);
    }

/* Commit + grade */
.pred-board__commit {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(213,166,66,0.15);
}

.pb-commit {
    width: 100%;
    padding: 8px;
    border-radius: 8px;
    background: var(--pb-gold);
    border: none;
    cursor: pointer;
    font-family: 'Cinzel',serif;
    font-weight: 700;
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #2a1e08;
}

    .pb-commit:disabled {
        opacity: 0.4;
        cursor: not-allowed;
    }

.pb-grade {
    margin-top: 10px;
}

.pb-grade__meter {
    height: 10px;
    border-radius: 6px;
    background: rgba(255,255,255,0.08);
    overflow: hidden;
}

.pb-grade__fill {
    height: 100%;
    border-radius: 6px;
    background: linear-gradient(90deg, #e0902e, #d5a642, #5fd98a);
    transition: width 500ms ease;
}

.pb-grade__label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-top: 5px;
}

.pb-grade__band {
    font-family: 'Cinzel',serif;
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--pb-cream);
}

.pb-grade__num {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--pb-gold);
}

.pb-grade__den {
    font-size: 0.5rem;
    color: rgba(247,234,208,0.5);
}

.grade-history {
    position: relative;
    margin-top: 14px;
    padding: 12px;
    background: linear-gradient(180deg, rgba(213,166,66,0.04), rgba(0,0,0,0));
    border: 1px solid rgba(213,166,66,0.15);
    border-radius: 10px;
    width: 350px !important;
    max-width: 350px !important;
    min-width: 350px !important;
}

.grade-history__title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Cinzel', serif;
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(247,234,208,0.5);
    margin-bottom: 8px;
}

    .grade-history__title i {
        color: #d5a642;
    }

/* The stack. Scrolls when history exceeds ~14 rows; newest pinned at top. */
.grade-history__stack {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 360px; /* ~14 rows before scroll */
    overflow-y: auto;
    padding-right: 4px;
}

    .grade-history__stack::-webkit-scrollbar {
        width: 5px;
    }

    .grade-history__stack::-webkit-scrollbar-thumb {
        background: rgba(213,166,66,0.3);
        border-radius: 3px;
    }

.gh-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* The bar. Length is the LOUD signal — read the trend from the silhouette. */
.gh-row__track {
    flex: 1;
    height: 9px;
    background: rgba(255,255,255,0.06);
    border-radius: 5px;
    overflow: hidden;
}

.gh-row__fill {
    height: 100%;
    border-radius: 5px;
    transition: width 480ms cubic-bezier(0.3,0.9,0.3,1); /* new bar grows in */
}

.gh-row__fill--low {
    background: linear-gradient(90deg, #c0562e, #e0902e);
}

.gh-row__fill--mid {
    background: linear-gradient(90deg, #e0902e, #d5a642);
}

.gh-row__fill--high {
    background: linear-gradient(90deg, #d5a642, #5fd98a);
}

/* Meta: number quiet, kudos only on the latest row. */
.gh-row__meta {
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 30px;
}

.gh-row__num {
    font-family: 'Cinzel', serif;
    font-size: 0.62rem;
    font-weight: 700;
    color: rgba(247,234,208,0.55);
    width: 22px;
    text-align: right;
}

/* The latest row gets emphasis — it's the moment that just happened. */
.gh-row--latest .gh-row__num {
    color: #f7ead0;
}

.gh-row--latest .gh-row__track {
    height: 11px;
}
/* slightly taller = "this is now" */

.gh-row__kudos {
    font-family: 'Cinzel', serif;
    font-size: 0.6rem;
    font-weight: 700;
    color: #d5a642;
    white-space: nowrap;
    animation: gh-kudos-in 400ms ease-out both;
}

.gh-row__kudos--improve {
    color: #5fd98a;
}
/* improvement = green, distinct from gold excellence */

@keyframes gh-kudos-in {
    from {
        opacity: 0;
        transform: translateX(-4px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@media (min-width: 1920px) {
    .grade-history {
        width: 377px !important;
        max-width: 377px !important;
        min-width: 377px !important;
    }
}