/* CSS Variables for Theme Support */
:root {
    --bg-color: #181c1f;
    --text-color: #00ff00;
    --panel-color: #23272b;
    --card-bg: #23272b;
    --accent: #00ff00;
    --particle: rgba(0, 255, 0, 0.15);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Orbitron', monospace;
    background: var(--bg-color, #181c1f);
    color: var(--text-color, #00ff00);
    min-height: 100vh;
    overflow-x: hidden;
    animation: backgroundShift 20s ease-in-out infinite;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, rgba(0, 255, 0, 0.3), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(0, 255, 255, 0.3), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(255, 0, 255, 0.3), transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(0, 255, 0, 0.3), transparent),
        radial-gradient(2px 2px at 160px 30px, rgba(0, 255, 255, 0.3), transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    animation: float 15s infinite linear;
    pointer-events: none;
    z-index: -1;
}

@keyframes float {
    0% { transform: translateY(0px) translateX(0px); }
    33% { transform: translateY(-10px) translateX(5px); }
    66% { transform: translateY(5px) translateX(-5px); }
    100% { transform: translateY(0px) translateX(0px); }
}

@keyframes backgroundShift {
    0%, 100% { 
        background-position: 0% 0%, 100% 100%, 50% 50%, 0% 0%;
    }
    50% { 
        background-position: 100% 100%, 0% 0%, 0% 100%, 100% 0%;
    }
}

@keyframes glow {
    from { text-shadow: 0 0 10px #00ff00; }
    to { text-shadow: 0 0 20px #00ff00, 0 0 30px #00ff00; }
}

.game-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Header Styles */
.header {
    text-align: center;
    padding: 20px;
    background: rgba(0, 255, 0, 0.1);
    border-radius: 15px;
    border: 2px solid #00ff00;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
}

.title {
    font-size: 2.5rem;
    font-weight: 900;
    text-shadow: 0 0 10px #00ff00;
    margin-bottom: 20px;
    animation: glow 2s ease-in-out infinite alternate;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.stat-card {
    background: #23272b;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1.5px solid #00ff00;
    text-align: center;
    color: #00ff00;
    box-shadow: 0 0 10px rgba(0,255,0,0.10);
}

.stat-label {
    font-weight: 700;
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.stat-value {
    color: #00ff00;
    font-weight: 900;
    font-size: 1.1rem;
    text-shadow: 0 0 5px #00ff00;
}

/* Main Content Layout */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    min-height: 600px;
}

.left-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.right-panel {
    display: flex;
    flex-direction: column;
}

/* Clicker Section */
.clicker-section {
    background: rgba(0, 255, 0, 0.05);
    border-radius: 15px;
    border: 2px solid #00ff00;
    padding: 30px;
    text-align: center;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.monster-can-container {
    position: relative;
}

.monster-can {
    width: 200px;
    height: 300px;
    cursor: pointer;
    position: relative;
    transition: transform 0.1s ease;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.monster-can:hover {
    transform: scale(1.05);
}

.monster-can:active {
    transform: scale(0.95);
}

.monster-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 15px;
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.5);
    border: 3px solid #00ff00;
    transition: all 0.3s ease;
    filter: brightness(1.1) contrast(1.1);
}

.monster-image:hover {
    box-shadow: 0 0 40px rgba(0, 255, 0, 0.8);
    filter: brightness(1.2) contrast(1.2);
}

.monster-can:active .monster-image {
    filter: brightness(0.9) contrast(1.3);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.6);
}

.click-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    font-size: 2rem;
    font-weight: 900;
    color: #00ff00;
    opacity: 0;
    z-index: 10;
    text-shadow: 0 0 10px #00ff00;
}

/* Rebirth Section */
.rebirth-section {
    background: rgba(255, 0, 255, 0.1);
    border-radius: 15px;
    border: 2px solid #ff00ff;
    padding: 20px;
    text-align: center;
}

.rebirth-section h3 {
    color: #ff00ff;
    margin-bottom: 15px;
    font-size: 1.5rem;
    text-shadow: 0 0 10px #ff00ff;
}

.rebirth-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.rebirth-stat {
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #ff00ff;
    font-size: 0.9rem;
    color: #ff00ff;
    font-weight: 700;
}

.rebirth-btn {
    background: linear-gradient(45deg, #ff00ff, #ff44ff);
    color: #000000;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-family: 'Orbitron', monospace;
    font-weight: 900;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.5);
    text-transform: uppercase;
}

.rebirth-btn:hover:not(:disabled) {
    background: linear-gradient(45deg, #ff44ff, #ff88ff);
    transform: translateY(-2px);
    box-shadow: 0 5px 25px rgba(255, 0, 255, 0.8);
}

.rebirth-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: linear-gradient(45deg, #444444, #666666);
    box-shadow: none;
}

/* Upgrades Section */
.upgrades-section {
    background: rgba(0, 255, 0, 0.05);
    border-radius: 15px;
    border: 2px solid #00ff00;
    padding: 16px;
    height: 440px;
    max-width: 520px;
    min-width: 320px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

.upgrades-section h2 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 2rem;
    color: #00ff00;
}

.upgrade-tabs {
    display: flex;
    margin-bottom: 20px;
    gap: 10px;
}

.tab-btn {
    flex: 1;
    background: rgba(0, 0, 0, 0.5);
    color: #00ff00;
    border: 1px solid #00ff00;
    padding: 10px;
    border-radius: 8px;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn.active,
.tab-btn:hover {
    background: rgba(0, 255, 0, 0.1);
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

.upgrade-content {
    flex: 1;
    overflow-y: auto;
    max-height: 340px;
    scrollbar-width: thin;
    scrollbar-color: #00ff00 #181c1f;
}

.upgrade-content::-webkit-scrollbar {
    width: 16px;
    background: #181c1f;
}
.upgrade-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #00ff00 40%, #00cc00 100%);
    border-radius: 12px;
    border: 3px solid #181c1f;
    min-height: 40px;
}
.upgrade-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #00ff99 0%, #00ff00 100%);
}
.upgrade-content::-webkit-scrollbar-track {
    background: #181c1f;
    border-radius: 12px;
}

.upgrade-tab {
    display: none;
}

.upgrade-tab.active {
    display: block;
}

.upgrade-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.upgrade-item {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #00ff00;
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.upgrade-item:hover:not(.disabled) {
    background: rgba(0, 255, 0, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 0, 0.3);
}

.upgrade-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.upgrade-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.upgrade-name {
    font-weight: 700;
    color: #00ff00;
    font-size: 1.1rem;
}

.upgrade-cost {
    font-weight: 900;
    color: #ffff00;
    font-size: 1.2rem;
}

.upgrade-description {
    color: #cccccc;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.upgrade-count {
    color: #00ff00;
    font-weight: 700;
    font-size: 0.9rem;
}

/* Bottom Section */
.bottom-section {
    width: 100%;
}

/* Achievements Section */
.achievements-section {
    background: rgba(0, 255, 0, 0.05);
    border-radius: 15px;
    border: 2px solid #00ff00;
    padding: 20px;
}

.achievements-section h2 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 2rem;
    color: #00ff00;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.achievement-item {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #00ff00;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
    opacity: 0.6;
}

.achievement-item.unlocked {
    background: rgba(0, 255, 0, 0.1);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
    opacity: 1;
}

.achievement-item.unlocked .achievement-icon {
    animation: bounce 0.5s ease;
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.achievement-icon {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
}

.achievement-name {
    font-weight: 700;
    color: #00ff00;
    margin-bottom: 5px;
}

.achievement-description {
    color: #cccccc;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.achievement-reward {
    color: #ffff00;
    font-weight: 700;
    font-size: 0.9rem;
}

/* Controls */
.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.control-btn {
    background: rgba(0, 0, 0, 0.7);
    color: #00ff00;
    border: 2px solid #00ff00;
    padding: 10px 20px;
    border-radius: 10px;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.control-btn:hover {
    background: rgba(0, 255, 0, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 0, 0.3);
}

.control-btn:active {
    transform: translateY(0);
}

/* Notifications */
.notifications {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    pointer-events: none;
}

.notification {
    background: rgba(0, 255, 0, 0.9);
    color: #000000;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 10px;
    font-weight: 700;
    transform: translateX(100%);
    animation: slideIn 0.5s ease forwards;
    pointer-events: auto;
}

@keyframes slideIn {
    to { transform: translateX(0); }
}

.notification.fadeOut {
    animation: fadeOut 0.5s ease forwards;
}

@keyframes fadeOut {
    to { opacity: 0; transform: translateX(100%); }
}

/* Background Music Volume Slider Styles */
.bg-volume-container {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0,0,0,0.7);
    border: 2px solid #00ff00;
    border-radius: 10px;
    padding: 8px 16px;
    margin-left: 10px;
    box-shadow: 0 0 10px rgba(0,255,0,0.2);
}

.bg-volume-label {
    color: #00ff00;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    font-size: 1rem;
}

#bg-volume-slider {
    width: 120px;
    accent-color: #00ff00;
}

#bg-volume-value {
    color: #00ff00;
    font-family: 'Orbitron', monospace;
    font-size: 1rem;
    min-width: 40px;
    text-align: right;
}

/* Modern Button and Modal Styles for Monster Shop */
.modern-btn {
    background: linear-gradient(90deg, #00ff99 0%, #00ccff 100%);
    color: #181c1f;
    border: none;
    border-radius: 30px;
    padding: 0.75em 2em;
    font-size: 1.2em;
    font-weight: bold;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    cursor: pointer;
    transition: background 0.2s, color 0.2s, transform 0.1s;
    margin: 1em 0;
}
.modern-btn:hover {
    background: linear-gradient(90deg, #00ccff 0%, #00ff99 100%);
    color: #23272b;
    transform: scale(1.05);
}

.monster-shop-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--panel-color, #23272b);
    color: var(--text-color, #00ff00);
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.35);
    padding: 2em 2em 1em 2em;
    z-index: 1001;
    min-width: 340px;
    max-width: 95vw;
    max-height: 80vh;
    overflow-y: auto;
    display: none;
}
.monster-shop-modal.active {
    display: block;
}
.monster-shop-modal .close-btn {
    position: absolute;
    top: 0.5em;
    right: 1em;
    background: none;
    border: none;
    color: var(--text-color, #00ff00);
    font-size: 2em;
    cursor: pointer;
}
.monster-shop-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5em;
    justify-content: center;
    margin-top: 1em;
}
.monster-shop-item {
    background: var(--card-bg, #23272b);
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    padding: 1em;
    text-align: center;
    min-width: 120px;
    max-width: 160px;
    transition: box-shadow 0.2s, transform 0.1s;
}
.monster-shop-item.selected {
    border: 2px solid var(--accent, #00ff00);
    box-shadow: 0 0 16px var(--accent, #00ff00, 0.2);
}
.monster-shop-item img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    margin-bottom: 0.5em;
}
.monster-shop-item .monster-name {
    font-weight: bold;
    margin-bottom: 0.25em;
}
.monster-shop-item .monster-price {
    font-size: 0.95em;
    margin-bottom: 0.5em;
}
.monster-shop-item .monster-btn {
    background: linear-gradient(90deg, #00ff99 0%, #00ccff 100%);
    color: #181c1f;
    border: none;
    border-radius: 18px;
    padding: 0.4em 1.2em;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, transform 0.1s;
}
.monster-shop-item .monster-btn:hover {
    background: linear-gradient(90deg, #00ccff 0%, #00ff99 100%);
    color: #23272b;
    transform: scale(1.05);
}

.monster-perk {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #2eec71;
  text-shadow: 0 1px 4px #222, 0 0 8px #fff2;
  letter-spacing: 0.5px;
  background: rgba(0,0,0,0.15);
  border-radius: 8px;
  padding: 0.3em 0.7em;
  display: block;
}

/* Modal styles for Achievements and Gallery */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0; top: 0; width: 100vw; height: 100vh;
  overflow: auto;
  background: rgba(0,0,0,0.6);
}
.modal-content {
  background: #222;
  margin: 5% auto;
  padding: 2em;
  border-radius: 1em;
  width: 90%;
  max-width: 500px;
  color: #fff;
  position: relative;
  animation: modalIn 0.2s;
}
@keyframes modalIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.close {
  position: absolute;
  right: 1em; top: 1em;
  font-size: 2em;
  cursor: pointer;
}
.achievement-modal-item {
  background: #333;
  margin: 0.5em 0;
  padding: 0.7em 1em;
  border-radius: 0.5em;
  border-left: 5px solid #888;
  transition: border-color 0.2s;
}
.achievement-modal-item.unlocked {
  border-color: #ffd700;
  background: #2d2;
  color: #222;
}
.gallery-item {
  display: inline-block;
  margin: 1em;
  text-align: center;
}
.gallery-img {
  width: 64px; height: 64px;
  border-radius: 0.5em;
  box-shadow: 0 0 8px #000a;
  animation: monsterBounce 1.2s infinite alternate;
}
@keyframes monsterBounce {
  from { transform: translateY(0); }
  to { transform: translateY(-10px) scale(1.05); }
}
#theme-picker {
  margin-left: 1em;
  padding: 0.3em 1em;
  border-radius: 0.5em;
  font-size: 1em;
}
.theme-dark { background: #181818 !important; color: #eee !important; }
.theme-neon { background: #0f0f23 !important; color: #39ff14 !important; }
.theme-pastel { background: #f8f8ff !important; color: #6a5acd !important; }
.theme-cb-protanopia { background: #222 !important; color: #e2e600 !important; }
.theme-cb-deuteranopia { background: #222 !important; color: #00e2e6 !important; }
.theme-cb-tritanopia { background: #222 !important; color: #e600e2 !important; }

/* Animated backgrounds for secret codes */
.party-bg {
    animation: partyGradient 2s linear infinite alternate;
}
@keyframes partyGradient {
    0% { background: linear-gradient(135deg, #ff00cc, #3333ff); }
    100% { background: linear-gradient(135deg, #33ffcc, #ffcc00); }
}
.spooky-bg {
    background: repeating-linear-gradient(45deg, #222, #222 20px, #444 20px, #444 40px);
    filter: hue-rotate(90deg) brightness(0.7);
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .monster-can {
        width: 150px;
        height: 225px;
    }
    
    .rebirth-stats {
        flex-direction: column;
        align-items: center;
    }
    
    .achievements-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
  .game-container { width: 100vw; padding: 0; }
  .main-content { flex-direction: column; }
  .left-panel, .right-panel { width: 100%; }
  .stats-grid, .achievements-grid, .cosmetic-shop-grid { grid-template-columns: 1fr 1fr; }
  .controls { flex-wrap: wrap; }
  .control-btn, #theme-picker { margin: 0.3em 0.5em; }
}
@media (max-width: 400px) {
  .stats-grid, .achievements-grid, .cosmetic-shop-grid { grid-template-columns: 1fr; }
}

/* Tutorial modal */
#tutorial-modal .modal-content { background: #fffbe7; color: #222; }
#tutorial-modal .tutorial-step { margin: 1em 0; }
#tutorial-modal .close { color: #222; }

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #00ff00;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #00cc00;
}

/* Animation for click effects */
@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -150%) scale(1.5);
    }
}

.click-effect.animate {
    animation: floatUp 1s ease-out forwards;
}

@keyframes comboFloat {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -200%) scale(1.2);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}
