* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #7e22ce 100%);
    min-height: 100vh;
    color: #fff;
    padding: 1rem;
}

.game-container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    overflow-y: auto;
    padding: 1rem;
}

.overlay.hidden {
    display: none;
}

.overlay-content {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    padding: 2rem;
    border-radius: 1rem;
    max-width: 700px;
    width: 100%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.overlay-content h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    text-align: center;
}

.overlay-content p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.instructions {
    background: rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
}

.instructions h3, .instructions h4 {
    margin-bottom: 1rem;
}

.instructions ul {
    list-style: none;
    padding-left: 0;
}

.instructions li {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.crypto-info {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.crypto-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.crypto-list div {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem;
    border-radius: 0.25rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-decoration: none;
    text-align: center;
    font-weight: bold;
}

.btn-primary {
    background: #10b981;
    color: #fff;
    width: 100%;
    margin-bottom: 0.5rem;
}

.btn-primary:hover {
    background: #059669;
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    width: 100%;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-success {
    background: #10b981;
    color: #fff;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: #ef4444;
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
}

#gameUI {
    display: block;
}

#gameUI.hidden {
    display: none;
}

.top-bar {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 1rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.wallet-info {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-item .label {
    font-size: 0.85rem;
    opacity: 0.8;
    margin-bottom: 0.25rem;
}

.stat-item .value {
    font-size: 1.3rem;
    font-weight: bold;
}

.news-banner {
    background: linear-gradient(90deg, #f59e0b, #ef4444);
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    text-align: center;
    font-weight: bold;
    animation: slideIn 0.5s ease;
    display: none;
}

.news-banner.active {
    display: block;
}

@keyframes slideIn {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 1rem;
}

.trading-section {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 1rem;
}

.trading-section h2 {
    margin-bottom: 1rem;
}

.crypto-grid {
    display: grid;
    gap: 1rem;
}

.crypto-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    padding: 1.5rem;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    align-items: center;
    transition: all 0.3s ease;
}

.crypto-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
}

.crypto-icon {
    font-size: 2.5rem;
}

.crypto-info-card {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.crypto-name {
    font-size: 1.2rem;
    font-weight: bold;
}

.crypto-symbol {
    font-size: 0.9rem;
    opacity: 0.7;
}

.crypto-price {
    font-size: 1.5rem;
    font-weight: bold;
}

.crypto-change {
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.crypto-change.positive {
    color: #10b981;
}

.crypto-change.negative {
    color: #ef4444;
}

.crypto-actions {
    display: flex;
    gap: 0.5rem;
}

.crypto-actions button {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.portfolio-section,
.mining-section,
.achievements-section {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 1rem;
}

.portfolio-section h3,
.mining-section h3,
.achievements-section h3 {
    margin-bottom: 1rem;
}

.portfolio-items,
.mining-items,
.achievements-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.portfolio-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.75rem;
    border-radius: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.portfolio-item-info {
    display: flex;
    flex-direction: column;
}

.portfolio-crypto-name {
    font-weight: bold;
}

.portfolio-amount {
    font-size: 0.85rem;
    opacity: 0.7;
}

.portfolio-value {
    font-weight: bold;
    text-align: right;
}

.mining-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mining-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mining-name {
    font-weight: bold;
}

.mining-count {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.85rem;
}

.mining-desc {
    font-size: 0.85rem;
    opacity: 0.8;
}

.mining-item button {
    width: 100%;
    padding: 0.5rem;
    font-size: 0.9rem;
}

.achievement-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.75rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.achievement-item.locked {
    opacity: 0.4;
}

.achievement-icon {
    font-size: 1.5rem;
}

.achievement-info {
    flex: 1;
}

.achievement-name {
    font-weight: bold;
    font-size: 0.9rem;
}

.achievement-desc {
    font-size: 0.8rem;
    opacity: 0.7;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    padding: 2rem;
    border-radius: 1rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.modal-content h3 {
    margin-bottom: 1.5rem;
    text-align: center;
}

.trade-info {
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.price-display,
.balance-display {
    display: flex;
    justify-content: space-between;
    margin: 0.5rem 0;
}

.price {
    font-weight: bold;
    font-size: 1.2rem;
}

.trade-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.trade-controls input {
    padding: 0.75rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1rem;
}

.trade-controls input:focus {
    outline: none;
    border-color: #10b981;
}

.trade-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
}

.error-message {
    color: #ef4444;
    margin-top: 1rem;
    text-align: center;
    font-weight: bold;
    min-height: 1.5rem;
}

@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .wallet-info {
        width: 100%;
    }

    .top-bar {
        flex-direction: column;
    }

    .crypto-card {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .crypto-actions {
        justify-content: center;
    }

    .trade-buttons {
        grid-template-columns: 1fr;
    }
}
