:root {
    --panel: #151823;
    --text: #e6e8ef;
}

* {
    box-sizing: border-box;
}

.t-center {
    text-align: center;
}

.t-right {
    text-align: right;
}

.fc-red {
    color: red;
}

.fw-bold {
    font-weight: bold;
}

@keyframes slide-left {
    0% {
        left: 100%;
        transform: translateX(0) translateY(-50%);
    }

    100% {
        left: 0%;
        transform: translateX(-100%) translateY(-50%);
    }
}

.mini-egg-main {
    display: grid;
    gap: 1rem;
    padding: 1rem;
    grid-template-columns: 1fr 2fr;
    align-items: start;
    max-width: 1200px;
    margin: 0 auto;

    grid-template-areas: "score egg""game game";
}

.mini-egg-main .card {
    background: var(--mini-game-main-window);
    border-radius: 1rem;
    padding: 1.5rem;
}

#scoreboard .totals {
    display: grid;
    gap: 1rem;
}

@media (max-width: 768px) {
    .mini-egg-main {
        grid-template-columns: 1fr 1fr;
    }

    .mini-egg-main .card {
        padding: 1rem;
    }

    .termsDiv {
        padding: 1rem;
    }

    #game {
        order: 1;
        grid-column: 1 / -1;
    }

    #scoreboard {
        order: 2;
    }

    #hammerSelection {
        order: 2;
    }
}

.terms {
    padding: 1rem 1rem 0;
    max-width: 1200px;
    margin: 0 auto;
}

.termsDiv {
    background: rgba(13, 15, 21, 0.8);
    border: 1px solid #222738;
    color: #ffffff;
    border-radius: 16px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

.termsDiv ol {
    list-style: none;
    margin: 0;
    padding-left: 0;
}

.termsDiv ol li {
    margin-bottom: 0.3125;
}

.backbar {
    max-width: 1200px;
    margin: 0.5rem auto 0;
    padding: 0.5rem 1rem;
}

.backbar .backlink {
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

.backbar .backlink:active {
    opacity: .8;
}

.btn-red {
    appearance: none;
    border: none;
    width: 100%;
    border-radius: 0.5rem;
    padding: 0.75rem;
    font-weight: 900;
    /* color: #ffffff;
    background: #FF0000; */
    /* box-shadow: 0 6px 18px rgba(176, 0, 0, .35); */
    cursor: pointer;
    width: 100%;
    border-width: 1px;
    border-style: solid;
    /* transition: color .15s ease, background .15s ease; */
}

.btn-red-secondary {
    appearance: none;
    border: none;
    width: 100%;
    border-radius: 0.5rem;
    padding: 0.75rem;
    font-weight: 900;
    /* color: #ffffff;
    background: transparent;
    border-color: #FF0000; */
    border-width: 1px;
    border-style: solid;
    /* box-shadow: 0 6px 18px rgba(176, 0, 0, .35); */
    cursor: pointer;
    width: 100%;
    /* transition: color .15s ease, background .15s ease; */
}

.btn-red:active {
    transform: translateY(1px);
}

.btn-red:hover {
    background: #ffffff;
    color: #FF0000;
}

#scoreboard .totals.stacked {
    display: grid;
    gap: 1rem;
}

#scoreboard .totals.stacked .metric {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

#scoreboard .totals.stacked .metric .label {
    color: var(--mini-game-font-color);
    font-weight: 600;
    font-size: 1.125rem;
}

#scoreboard .totals.stacked .full {
    /* margin-top: 4px; */
}

#scoreboard .totals.stacked .metric .value {
    background-color: #1C1F27;
    font-size: 1.25rem;
    padding: 0.875rem 1rem;
    font-weight: 800;
    border-radius: 0.5rem;
    color: var(--mini-game-font-color);

}

#scoreboard {
    grid-area: score;
}

#hammerSelection {
    grid-area: egg;
    height: 100%;
    display: flex;
    justify-content: center;
}

#game {
    grid-area: game;
    background-image: url();
    cursor: url('../../img/mini-game/mini-egg/cursor-hammer-c.png'), auto;
    /* default */
}

#game:active {
    cursor: url('../../img/mini-game/mini-egg/cursor-hammer-c-clicked.png'), auto;
    /* default */
}

#game.hammer-c {
    cursor: url('../../img/mini-game/mini-egg/cursor-hammer-c.png'), auto;
}

#game.hammer-c:active {
    cursor: url('../../img/mini-game/mini-egg/cursor-hammer-c-clicked.png'), auto;
}

#game.hammer-b {
    cursor: url('../../img/mini-game/mini-egg/cursor-hammer-b.png'), auto;
}

#game.hammer-b:active {
    cursor: url('../../img/mini-game/mini-egg/cursor-hammer-b-clicked.png'), auto;
}

#game.hammer-a {
    cursor: url('../../img/mini-game/mini-egg/cursor-hammer-a.png'), auto;
}

#game.hammer-a:active {
    cursor: url('../../img/mini-game/mini-egg/cursor-hammer-a-clicked.png'), auto;
}

#hammerSelection .hammer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

@media (max-width: 768px) {
    .mini-egg-main {
        grid-template-columns: 1fr !important;
        grid-template-areas:
            "scoreboard"
            "egg"
            "game";
    }

    #scoreboard {
        grid-area: scoreboard;
    }

    #hammerSelection {
        grid-area: egg;
    }

    #game {
        grid-area: game;
        grid-column: auto;
    }
}

#game .game-grid {
    display: grid !important;
    grid-auto-flow: row !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 12px;
}

.hammer-cell {
    padding: 1.5625rem 2.1875rem;
    background-color: #232736;
    border: 2px solid #232736;
    border-radius: 10px;
    cursor: pointer;
}

.hammer-cell:hover {
    background: rgba(255, 0, 0, 0.2);
    transition: all 400ms ease-in;
}

.hammer-cell img {
    /* height: 120px; */
    width: 100%;
    aspect-ratio: 1;
}

.hammer-label {
    color: var(--mini-game-font-color);
    font-size: 1.125rem;
    font-weight: 500;
}

.hammer-cost {
    color: var(--mini-game-font-color);
    font-size: 1.125rem;
    font-weight: 800;
}

@media (max-width: 768px) {

    .hammer-cell {
        padding: 0.75rem 1rem;
    }

    .hammer-cell img {
        /* height: auto; */
        aspect-ratio: 1;
        width: 100%;
    }

    .hammer-label {
        color: var(--mini-game-font-color);
        font-size: 1rem;
        font-weight: 500;
    }

    .hammer-cost {
        color: var(--mini-game-font-color);
        font-size: 1rem;
        font-weight: 800;
    }
}

#overlay,
#statusOverlay,
#historyOverlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .6);
    z-index: 9999;
    padding: 16px;
}

#overlay .dialog {
    background: var(--mini-game-main-window);
    color: var(--mini-game-font-color);
    /*border: 1px solid rgba(255, 255, 255, .1);*/
    border: 2px solid var(--mini-game-border-color);
    border-radius: 1.5rem;
    width: min(430px, 90vw);
    padding: 1.875rem 2.5rem;
    text-align: center;
}

#statusOverlay .dialog {
    background: var(--mini-game-main-window);
    color: var(--mini-game-font-color);
    /*border: 1px solid rgba(255, 255, 255, .1);*/
    border: 2px solid var(--mini-game-border-color);
    border-radius: 0.75rem;
    width: min(520px, 90vw);
    padding: 1.875rem 1.625rem;
    text-align: center;
}

#overlay img {
    max-width: 180px;
    height: auto;
    display: block;
    margin: 0 auto;
}

#statusOverlay img {
    max-width: 130px;
    height: auto;
    display: block;
    margin: 0 auto;
}

#overlay .dialogTitle {
    color: var(--mini-game-button-color);
    font-size: 1.125rem;
    font-weight: 500;
    text-align: center;
    margin: 1rem 0 0;
}

#statusOverlay .dialogTitle {
    color: var(--mini-game-font-color);
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    margin: 1.375rem 0 0.5rem;
}

#overlay .dialogDesc {
    color: var(--mini-game-font-color);
    font-size: 3rem;
    font-weight: 700;
    text-align: center;
    margin: 0 0 1.25rem;
}

#statusOverlay .dialogDesc {
    color: var(--mini-game-font-color);
    font-size: 1rem;
    line-height: 1.5rem;
    font-weight: 400;
    text-align: center;
    margin: 0 0 2.875rem;
}

#overlay button,
#statusOverlay button,
#historyOverlay button {
    width: 100%;
    border-radius: 0.5rem;
    padding: 0.75rem;
    font-weight: 900;
    appearance: none;
    border: none;
    cursor: pointer;
    color: white;
    background: #FF0000;
    /* box-shadow: 0 6px 18px rgba(255, 122, 24, .35); */
    /*transition: transform .05s ease;*/
    transition: color .15s ease, background .15s ease;
}

#overlay button:hover,
#statusOverlay button:hover,
#historyOverlay button:hover {
    /* background: #ffffff;
    color: #FF0000; */
}

#historyOverlay .history-close-btn {
    width: auto;
    padding: 0.45rem 1rem;
    margin-left: auto;
}

#historyOverlay .theLTBPTableWrapper {
    position: relative;
}

#historyOverlay .history-loader {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

#historyOverlay .history-loader.is-active {
    display: flex;
}

#historyOverlay .history-loader .spinner {
    width: 100px;
    aspect-ratio: 3/1.2;
    z-index: 1;
    position: relative;
    background-repeat: no-repeat;
    background-size: contain;
}
#historyOverlay .history-loader .spinner:after {
    content: "";
    position: absolute;
    width: 140px;
    aspect-ratio: 1;
    background-color: rgba(0, 0, 0, 0);
    border-radius: 100%;
    box-shadow: 0 4px 0 0 var(--mini-game-button-color);
    transition: all 1s linear;
    margin: -50px -20px;
    animation: lds-eclipse 1s linear infinite;
}
@keyframes lds-eclipse {
    0% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(180deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.hammer-cell.selected {
    border: 2px solid red;
    background: rgba(255, 0, 0, 0.2);
    transition: all 400ms ease-in;
}

.game-egg {
    transition: transform 150ms ease;
    will-change: transform;
}

.game-egg:hover {
    transform: scale(0.95);
    filter: drop-shadow(0px 1px 12px #fdecc4);
}

@keyframes egg-bounce-in {
    0% {
        opacity: 0;
        transform: translateY(14px) scale(0.92);
    }

    60% {
        opacity: 1;
        transform: translateY(-6px) scale(1.04);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1.00);
    }
}

@keyframes egg-fade-in {
    from {
        opacity: 0;
        transform: none;
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.bounce-in {
    animation: egg-bounce-in 420ms ease-out both;
}

@media (prefers-reduced-motion: reduce) {
    .bounce-in {
        animation: egg-fade-in 160ms ease-out both;
    }
}
