:root {
    --bg: #0f1724;
    --card: #0b1220;
    --accent: #60a5fa;
    --muted: #9aa8bf
}

* {
    box-sizing: border-box
}

body {
    font-family: Inter, system-ui, Segoe UI, Roboto, Arial;
    line-height: 1.4;
    margin: 0;
    color: #e6eef8;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    background: var(--bg);
}

.app {
    display: flex;
    flex: 1;
    flex-direction: row;
    width: 100%;
}


aside.menu {
    width: 220px;
    background: var(--card);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: calc(100vh - 50px);
}


.game-name {
    font-weight: 700;
    font-size: 22px;
    color: var(--accent);
    margin-bottom: 6px;
}


.tabs {
    display: flex;
    flex-direction: column;
    gap: 6px
}

.tab-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    color: var(--muted);
    font-weight: 600;
    text-align: left
}

.tab-btn:hover {
    background-color: #444;
}

.tab-btn.active {
    background: linear-gradient(90deg, rgba(96, 165, 250, 0.12), rgba(96, 165, 250, 0.06));
    color: var(--accent);
    border-color: rgba(96, 165, 250, 0.16);
    box-shadow: 0 6px 18px rgba(2, 6, 23, 0.6);
}

main {
    flex: 1;
    overflow: hidden;
    position: relative;
    /*background-image: url(https://cdn.mos.cms.futurecdn.net/kvRimKWowJ84VfeBBj6r9j-878-80.jpg.webp);*/
    /*background-size: 100% 100%;*/
    /*background-position: center;*/
    background: var(--bg);
    height: calc(100vh - 50px);
}

section {
    position: absolute;
    top: 0;
    left: 0;
    height: 100vh;
    width: 25%;
    background-color: color(from var(--card) srgb r g b / 0.85);
    box-shadow: 2px 0 0 rgba(180, 180, 180, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 0 10px 10px 0;
    padding: 20px;
    z-index: 1;
    transform: translateX(-110%);
    transition: transform .3s ease-in-out;
}

section.open {
    transform: translateX(0);
}

.text-muted {
    color: var(--muted);
    font-size: 13px
}

/* Générateurs - barre latérale droite */
aside.generators {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 3px solid silver;
    box-shadow: 0 0 10px rgba(192, 192, 192, 0.3);
    z-index: 3;
}

/* Les boutons générateurs */
button.generator {
    background: linear-gradient(180deg, #b30000 0%, #7a0000 100%);
    color: #ffd700;
    border: 2px solid #daa520;
    width: 180px;
    padding: 10px 16px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
    font-weight: bold;
    text-shadow: 0 0 5px #000;
    box-shadow: 0 0 6px rgba(218, 165, 32, 0.4);
}

button.generator:hover {
    background: linear-gradient(180deg, #ff0000 0%, #b30000 100%);
    border-color: #ffd700;
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.6);
}

button.generator:active {
    background: linear-gradient(180deg, #a00000 0%, #600000 100%);
}

button.generator:disabled {
    background: linear-gradient(180deg, #3a3a3a 0%, #222 100%);
    border-color: #555;
    color: #888;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    opacity: 0.7;
}

button.generator:disabled:hover {
    background: linear-gradient(180deg, #3a3a3a 0%, #222 100%);
    transform: none;
    box-shadow: none;
}


/* Barre de compteur en bas */
#bottom-bar {
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 50px;
    background-color: rgba(86, 86, 74, 1);
    color: white;
    display: flex;
    align-items: center;
    font-weight: bold;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.5);
    z-index: 5;
    padding: 9px 20px 0;
}

#bottom-bar::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 9px;
    background: linear-gradient(to top, rgba(123, 124, 127, 1) 33%, rgba(215, 216, 218, 1) 66%);
}

#goldLabel {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* in-game Tooltip */

.game-tooltip {
    position: absolute;
    padding: 8px 12px;
    background-color: #1a1a1a;
    color: #e6eef8;
    border: 1px solid rgba(96,165,250,0.3);
    border-radius: 8px;
    font-size: 12px;
    display: none;
    pointer-events: none;
    z-index: 1000;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
    white-space: nowrap;
    line-height: 1.5;
}

.game-tooltip .tooltip-title {
    font-weight: 700;
    color: #ffd700;
    font-size: 13px;
    margin-bottom: 2px;
}

.game-tooltip .tooltip-line {
    color: var(--muted);
}



/* Effet de clic */
div.clickEffect {
    position: fixed;
    box-sizing: border-box;
    border-style: solid;
    border-color: purple;
    border-radius: 50%;
    animation:
        clickEffect 0.4s ease-out,
        clickEffect2 0.4s ease-out 0.3s;
    z-index: 99999;
    pointer-events: none;
}

@keyframes clickEffect {
    0% {
        opacity: 1;
        width: 10px;
        height: 10px;
        margin: -5px;
        border-width: 10px;
    }

    100% {
        opacity: 0.2;
        width: 100px;
        height: 100px;
        margin: -50px;
        border-width: 5px;
    }
}

@keyframes clickEffect2 {
    0% {
        opacity: 1;
        width: 5px;
        height: 5px;
        margin: -2.5px;
        border-width: 10px;
        border-color: white;
    }

    100% {
        opacity: 0.2;
        width: 100px;
        height: 100px;
        margin: -50px;
        border-width: 5px;
        border-color: white;
    }
}

/* Boutons de sauvegarde */

#saveButtons {
    position: absolute;
    right: 50px;
    bottom: 2px;
    display: flex;
    gap: 10px; /* 👈 this creates spacing */
}

.save-buttons {
    background-color: rgba(66, 66, 54, 1);
    border: 3px solid rgb(192, 192, 192);
    color: red;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.save-buttons:hover {
    background-color: rgba(90, 90, 73, 1);
}

.save-buttons:active {
    background-color: rgba(109, 109, 90, 1);
    border-color: #fff;
}

/* Orbe magique */
.orb {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid goldenrod;
    overflow: hidden;
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgb(11 18 32 / 40%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* Interieur de l'orbe qui se rempli */

#fullOrb {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0;
    background : linear-gradient(to top, #60a5fa, #1e3a8a);
    transition: height 0.2s ease-in-out;
}

/* Magic Label */

#magicLabel {
    display: inline-flex;
    align-items: center;
    font-weight: 700;
    font-size: 14px;
    color: goldenrod;
    text-shadow: 0 0 6px rgba(96, 165, 250, 0.25);
    z-index: 5;
}

/* Magic Rate */

#magicRateLabel {
    position: relative;
    z-index: 5;
    font-size: 10px;
    font-weight: 600;
    color: white;
}


/* Shop pannel : toogle  */


.shop-section {
    margin-top: 12px;
}

.shop-section-toggle-btn {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(96,165,250,0.08);
    border: 1px solid rgba(96,165,250,0.18);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--accent);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
}

.shop-section-toggle-btn:hover {
    background: rgba(96,165,250,0.14);
}

.shop-section-body {
    max-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: row;
    gap: 10px;
    padding: 0 4px;
    transition: max-height 0.3s ease-in-out, padding 0.3s ease-in-out;
    flex-wrap: wrap;
}

.shop-section-body.open {
    max-height: 600px;
    padding: 10px 4px 4px;
}

/* Button unlock generators */

.shop-card-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 10px;
    border: 2px solid #2563eb;
    background: #2a2a2a;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(96, 165, 250, 0.4);
    transition: border-color 0.2s, box-shadow 0.2s, filter 0.2s;
    position: relative;
}

.shop-card-btn img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    pointer-events: none;
}

.shop-card-btn:hover {
    box-shadow: 0 0 14px rgba(96, 165, 250, 0.6);
}

.shop-card-btn:disabled {
    border-color: #444;
    filter: grayscale(100%);
    cursor: not-allowed;
    box-shadow: none;
}

.shop-card-btn.bought {
    border-color: #16a34a;
    filter: grayscale(0%);
    cursor: default;
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.3);
}

.shop-card-btn.bought::after {
    content: '✔';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 4px;
    color: #8af3af;
    font-size: 14px;
}

/* Tier badge on upgrade buttons */

.tier-badge {
    position: absolute;
    top: 2px;
    right: 3px;
    font-size: 9px;
    font-weight: 700;
    color: #93c5fd;
    line-height: 1;
    pointer-events: none;
}

.tier-badge.tier-2 { color: #c4b5fd; }
.tier-badge.tier-3 { color: #fde68a; }




/* Power button : First the containers */

.powers-bar {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    justify-content: center;
    /*background: rgba(5, 10, 20, 0.6);*/
    z-index: 2;
    width: fit-content;
    padding: 10px 10px 10px;
}

.power-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

/* Power button : Second the button */

.parchment {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 70px;
    padding: 10px 6px 8px;
    border-radius: 3px 3px 5px 5px;
    cursor: pointer;
    border: 1px solid #a07c3a;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    background: #d4b87a;
    );
}

.parchment:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.6);
}

/* Power button : Third transformations depending on logic */

/* while the button is being clicked it moves the button 1px downward, giving a small "press" tactile feel. So smooooth :D */
.parchment:active { transform: translateY(-1px); }

.parchment:disabled {
    filter: saturate(0.3) brightness(0.65);
    cursor: not-allowed;
}

/* Power button : Lastly inside the button */

.parchment-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.parchment-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.parchment-cost {
    font-size: 10px;
    font-weight: 700;
    color: #1a3a7a;
    letter-spacing: 0.02em;
}

/* Power timer */

.power-timer {
    position: relative;
    width: 70px;
    height: 15px;
    border: 2px solid silver;
    border-radius: 3px;
    overflow: hidden;
    visibility: hidden;
}

.power-timer.active {
    visibility: visible;
}

.power-timer-fill {
    position: absolute;
    top: 0; left: 0;
    height: 100%;
    width: 100%;
    background: #7c3aed;
    transform-origin: left;
    transition: width 0.9s linear;
}

.power-timer-label {
    position: absolute;
    width: 100%;
    text-align: center;
    font-size: 8px;
    font-weight: 700;
    color: white;
    line-height: 10px;
    z-index: 1;
}