* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(145deg, #2ecc71, #27ae60);
    color: white;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: background 0.3s;
}

.top-panel {
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    z-index: 10;
}

#score-container {
    display: flex;
    align-items: baseline;
    gap: 5px;
    background: rgba(0,0,0,0.3);
    padding: 10px 20px;
    border-radius: 40px;
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
}

.score {
    font-size: 48px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    color: #fff;
    text-shadow: 0 2px 5px rgba(0,0,0,0.3);
    line-height: 1;
}

.currency {
    font-size: 24px;
    color: rgba(255,255,255,0.8);
}

#bill-container {
    position: absolute;
    bottom: 120px;
    left: 0;
    right: 0;
    top: 100px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    pointer-events: none;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    pointer-events: auto;
    touch-action: none;
}

.bottom-panel {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 20;
}

#energy-container {
    position: relative;
    width: 100%;
    height: 40px;
    background: rgba(0,0,0,0.3);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
}

#energy-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #f1c40f, #e67e22);
    transition: width 0.2s ease;
}

#energy-text {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.bottom-buttons {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.bottom-btn {
    flex: 1;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 30px;
    padding: 15px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    color: white;
    cursor: pointer;
    transition: transform 0.1s, background 0.2s;
    position: relative;
}

.bottom-btn:active {
    transform: scale(0.95);
    background: rgba(0,0,0,0.7);
}

.btn-icon {
    font-size: 28px;
}

.btn-label {
    font-size: 14px;
    font-weight: 500;
}

.safe-badge {
    position: absolute;
    top: -5px;
    right: 10px;
    background: #e74c3c;
    color: white;
    font-size: 12px;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 20px;
    border: 2px solid white;
}

.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(145deg, #2c3e50, #34495e);
    color: white;
    margin: 10% auto;
    padding: 20px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.close, .close-safe {
    color: rgba(255,255,255,0.6);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close:hover, .close-safe:hover {
    color: white;
}

h2 {
    margin-bottom: 20px;
    font-size: 24px;
    text-align: center;
}

.upgrade-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 10px;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.6);
    font-size: 16px;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s;
}

.tab-btn.active {
    background: rgba(255,255,255,0.1);
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.upgrade {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(0,0,0,0.2);
    border-radius: 15px;
    margin-bottom: 10px;
    border: 1px solid rgba(255,255,255,0.05);
}

.upgrade span {
    font-size: 16px;
}

.cost {
    color: #f1c40f;
    font-weight: bold;
}

.upgrade button {
    background: #2ecc71;
    border: none;
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.upgrade button:hover {
    background: #27ae60;
}

#safe-modal .modal-content {
    text-align: center;
}

#safe-modal-amount {
    font-size: 28px;
    font-weight: bold;
    color: #f1c40f;
}

#passive-income {
    color: #2ecc71;
    font-weight: bold;
}

.collect-btn {
    background: #f1c40f;
    border: none;
    color: #2c3e50;
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
    transition: background 0.2s;
}

.collect-btn:hover {
    background: #f39c12;
}
