@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&family=Pirata+One&display=swap');

:root {
    --gold: #ffcc00;
    /* Brighter Gold */
    --gold-glow: #ffeebb;
    --gold-shadow: #b8860b;

    --bg-dark: #120a1f;
    --panel-bg: rgba(20, 10, 30, 0.85);
    /* Semi-transparent dark panel */
    --card-bg: linear-gradient(145deg, #2a1535, #1a0b25);

    --accent-red: #ff3333;
    --accent-green: #33ff33;

    --text-main: #f0e6d2;
    /* Parchment white */
    --text-dim: #a090b0;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

body {
    background-color: var(--bg-dark);
    /* High-quality generated fantasy shop background */
    background-image: url('bg_shop.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-main);
    font-family: 'Cinzel', serif;
    margin: 0;
    padding: 0;
    overflow: hidden;
    height: 100vh;
}

/* Vignette & Overlay */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.8) 90%);
    pointer-events: none;
    z-index: 1;
    /* Below UI but above BG */
}

/* Loading Screen */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease;
}

/* Header - RPG Coin Display */
header {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 450px;
    z-index: 100;
    text-align: center;
}

.gold-sign {
    background: linear-gradient(to bottom, #4a3b2a, #2a2015);
    border: 2px solid var(--gold-shadow);
    border-radius: 50px;
    /* Pill shape */
    padding: 10px 30px;
    box-shadow:
        0 0 15px rgba(0, 0, 0, 0.8),
        inset 0 2px 5px rgba(255, 255, 255, 0.1),
        0 0 20px rgba(255, 204, 0, 0.1);
    display: inline-block;
    position: relative;
    min-width: 200px;
}

/* Decorative Gold Trim */
.gold-sign::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 54px;
    padding: 2px;
    background: linear-gradient(180deg, var(--gold), var(--gold-shadow));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

#gold-display {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 1.8rem;
    color: var(--gold);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

#gold-display::before {
    content: '🪙';
    /* Or use an image icon if available */
    filter: drop-shadow(0 0 5px orange);
    font-size: 1.5rem;
}

.revenue-label {
    font-size: 0.7rem;
    letter-spacing: 2px;
    color: var(--text-dim);
    margin-top: 2px;
    text-transform: uppercase;
}

/* Main Layout */
main {
    margin-top: 150px;
    height: calc(100vh - 230px);
    overflow-y: scroll;
    padding: 0 15px 100px 15px;
    /* Bottom padding for nav */
    scrollbar-width: none;
    z-index: 10;
    position: relative;
}

main::-webkit-scrollbar {
    display: none;
}

section.hidden {
    display: none;
}

/* Clicker Area */
#main-clicker-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
    position: relative;
}

#hero-clicker {
    width: 260px;
    height: 260px;
    cursor: pointer;
    transition: transform 0.05s ease;
    /* Fancy border for the character */
    border-radius: 50%;
    /* box-shadow: 0 0 50px rgba(255, 100, 0, 0.3); */
    /* Add a subtle glow behind character */
    background: radial-gradient(circle, rgba(255, 200, 50, 0.1) 0%, transparent 70%);
}

#hero-clicker img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.7));
}

/* Dialogue Bubble */
.speech-bubble {
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    padding: 12px 20px;
    border-radius: 12px;
    border-bottom-left-radius: 2px;
    font-family: 'Pirata One', cursive;
    font-size: 1.3rem;
    margin-bottom: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: absolute;
    top: 180px;
    /* Adjusted: Above SCAM UPGRADES, below Face */
    right: 10px;
    max-width: 200px;
    transform: scale(0);
    opacity: 0;
    z-index: 20;
    border: 2px solid #555;
    pointer-events: none;
    /* Let clicks pass through */
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.speech-bubble.visible {
    transform: scale(1);
    opacity: 1;
}

/* Upgrade Cards */
.list-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.item-card {
    background: var(--card-bg);
    /* Dark purple gradient */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    transition: transform 0.2s, box-shadow 0.2s;
}

.item-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.5);
}

.item-card.can-afford {
    border: 1px solid var(--gold);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.1);
}

.card-icon {
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--gold);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.item-info {
    flex: 1;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.item-name {
    font-weight: bold;
    color: #fff;
    font-size: 1rem;
}

.item-lvl {
    font-size: 0.7rem;
    background: #444;
    padding: 2px 6px;
    border-radius: 4px;
    color: #bbb;
    white-space: nowrap;
    /* Prevent wrapping */
    flex-shrink: 0;
    /* Prevent shrinking */
}

.item-stats {
    font-size: 0.8rem;
    color: var(--text-dim);
}

/* Buy Button */
.buy-btn {
    background: linear-gradient(180deg, #ffd700, #b8860b);
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    color: #2a1535;
    font-family: 'Cinzel', serif;
    font-weight: bold;
    cursor: pointer;
    min-width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    transition: filter 0.2s;
    box-shadow: inset 0 2px 5px rgba(255, 255, 255, 0.4), 0 2px 4px rgba(0, 0, 0, 0.3);
}

.buy-btn:active {
    filter: brightness(0.9);
    transform: translateY(1px);
}

.buy-btn:disabled {
    background: #333;
    color: #666;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);
}

.cost-text {
    font-size: 0.9rem;
}

/* Bottom Navigation */
nav {
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 80px;
    background: rgba(10, 5, 15, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
    padding-bottom: 10px;
    /* Safe area */
}

.nav-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #666;
    transition: color 0.3s;
    cursor: pointer;
}

.nav-tab.active {
    color: var(--gold);
}

.nav-icon {
    font-size: 1.5rem;
    margin-bottom: 4px;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-tab.active .nav-icon {
    transform: translateY(-5px) scale(1.2);
    text-shadow: 0 0 15px var(--gold);
}

.nav-label {
    font-size: 0.7rem;
    font-weight: bold;
    letter-spacing: 1px;
}

/* Floating Text */
.floating-text {
    position: absolute;
    color: #fff;
    font-weight: bold;
    font-size: 1.5rem;
    pointer-events: none;
    animation: floatUp 1s ease-out forwards;
    text-shadow: 0 2px 4px black;
    z-index: 999;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) scale(0.8);
        opacity: 0;
    }

    20% {
        transform: translateY(-20px) scale(1.1);
        opacity: 1;
    }

    100% {
        transform: translateY(-80px) scale(1);
        opacity: 0;
    }
}

/* Tax View */
.tax-view {
    text-align: center;
    padding: 40px 20px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 16px;
    border: 1px solid #444;
}

.tax-office-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 10px red);
}

.bribe-btn {
    background: linear-gradient(45deg, #ff0055, #990033);
    color: white;
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    margin-top: 20px;
    font-family: 'Cinzel', serif;
    box-shadow: 0 4px 15px rgba(255, 0, 85, 0.3);
}

/* Version Footer */
.version-footer {
    text-align: center;
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.3);
    padding: 20px 0;
    margin-top: auto;
    font-family: sans-serif;
    letter-spacing: 1px;
}