@font-face {
    font-family: 'RustyCage';
    src: url('RustyCagePersonalUseRegular-mL3x2.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&display=swap');

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

body {
    font-family: 'RustyCage', 'Inter', sans-serif;
    background: url('Illustration43_5.png') repeat;
    background-color: #F5F5F0;
    min-height: 100vh;
    color: #000000;
}

/* Header */
.header {
    background: rgba(245, 245, 240, 0.95);
    border-bottom: 2px solid #E0E0E0;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-image {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
}

.logo-text {
    font-family: 'RustyCage', cursive;
    font-size: 18px;
    font-weight: 400;
    color: #000000;
}

.chain-badge {
    font-family: 'RustyCage', cursive;
    font-size: 11px;
    background: #F5F5F0;
    padding: 8px 14px;
    border-radius: 8px;
    color: #000000;
    border: 1px solid #E0E0E0;
}

.network-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.status-label {
    font-family: 'RustyCage', cursive;
    font-size: 10px;
    color: #000000;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'RustyCage', cursive;
    font-size: 11px;
    font-weight: 600;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #E0E0E0;
}

.status-dot.connected {
    background: #000000;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
}

/* Main Container */
.main-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Panel Styles */
.panel {
    background: rgba(245, 245, 240, 0.9);
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    overflow: hidden;
}

.panel-header {
    background: #FAFAFA;
    padding: 14px 16px;
    border-bottom: 1px solid #E0E0E0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-icon {
    font-size: 16px;
}

.panel-title {
    font-family: 'RustyCage', cursive;
    font-size: 11px;
    font-weight: 400;
    color: #000000;
}

.panel-content {
    padding: 16px;
}

/* Wallet Panel */
.wallet-content {
    display: flex;
    justify-content: center;
}

.connect-wallet-btn {
    font-family: 'RustyCage', sans-serif;
    font-size: 14px;
    font-weight: 700;
    padding: 12px 24px;
    background: #F5F5F0;
    color: #000000;
    border: 2px solid #E0E0E0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.connect-wallet-btn:hover {
    background: #E8E8E8;
    transform: translateY(-1px);
}

.wallet-info-connected {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-label {
    font-family: 'RustyCage', cursive;
    font-size: 9px;
    color: #000000;
    margin-bottom: 6px;
}

.wallet-address-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #F5F5F0;
    padding: 10px 12px;
    border-radius: 6px;
    font-family: 'RustyCage', monospace;
    font-size: 13px;
}

.copy-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.copy-btn:hover {
    opacity: 1;
}

.balance-value {
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #000000;
}

.refresh-btn {
    font-family: 'RustyCage', sans-serif;
    font-size: 12px;
    font-weight: 600;
    padding: 10px;
    background: #F5F5F0;
    color: #000000;
    border: 1px solid #E0E0E0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.refresh-btn:hover {
    background: #DADADA;
}

.disconnect-btn {
    font-family: 'RustyCage', sans-serif;
    font-size: 11px;
    font-weight: 600;
    padding: 8px;
    background: transparent;
    color: #000000;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.disconnect-btn:hover {
    color: #000000;
}

/* Stats Panel */
.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.stat-row:not(:last-child) {
    border-bottom: 1px solid #E0E0E0;
}

.stat-label {
    font-family: 'RustyCage', cursive;
    font-size: 9px;
    color: #000000;
}

.stat-value {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #000000;
}

.stat-value.win {
    color: #000000;
}

.stat-value.loss {
    color: #000000;
}

/* Game Area */
.game-area {
    background: rgba(245, 245, 240, 0.9);
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.game-header {
    text-align: center;
    width: 100%;
    padding: 16px;
    border: 2px solid #F5F5F0;
    border-radius: 8px;
    background: linear-gradient(135deg, #FAFAFA 0%, #F5F5F0 100%);
}

.game-title {
    font-family: 'RustyCage', cursive;
    font-size: 20px;
    font-weight: 400;
    color: #000000;
    margin-bottom: 8px;
}

.game-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: #000000;
}

/* Coin */
.coin-container {
    margin: 20px 0;
}

.coin {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.6s;
    margin: 0 auto;
}

.coin-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.coin.flipping {
    animation: coinFlip 1s ease-in-out;
}

@keyframes coinFlip {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(1800deg); }
}

.coin.win {
    animation: coinWin 0.5s ease;
}

@keyframes coinWin {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.coin.lose {
    animation: coinShake 0.4s ease;
}

@keyframes coinShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Bet Amount Section */
.bet-amount-section {
    text-align: center;
    width: 100%;
}

.amount-label {
    font-family: 'RustyCage', cursive;
    font-size: 11px;
    color: #000000;
    margin-bottom: 12px;
}

.amount-display {
    font-family: 'Inter', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: #000000;
    margin-bottom: 8px;
}

.currency {
    font-size: 18px;
    color: #000000;
    margin-left: 8px;
}

.amount-limits {
    display: flex;
    justify-content: space-between;
    font-family: 'Inter', sans-serif;
    font-size: 9px;
    font-weight: 700;
    color: #000000;
    margin-bottom: 16px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.bet-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    max-width: 500px;
    margin: 0 auto;
}

.bet-btn {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 700;
    padding: 14px;
    background: #F5F5F0;
    color: #000000;
    border: 2px solid #E0E0E0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

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

.bet-btn.selected {
    background: #E8E8E8;
    border-color: #000000;
    color: #000000;
}

/* Prediction Section */
.prediction-section {
    text-align: center;
    width: 100%;
}

.prediction-label {
    font-family: 'RustyCage', cursive;
    font-size: 11px;
    color: #000000;
    margin-bottom: 16px;
}

.prediction-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    max-width: 500px;
    margin: 0 auto;
}

.prediction-btn {
    font-family: 'RustyCage', sans-serif;
    font-size: 16px;
    font-weight: 700;
    padding: 20px;
    background: rgba(245, 245, 240, 0.9);
    color: #000000;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.prediction-btn:hover {
    border-color: #F5F5F0;
    transform: translateY(-2px);
}

.prediction-btn.selected {
    background: #E8E8E8;
    border-color: #000000;
    color: #000000;
}

.prediction-icon {
    font-size: 24px;
}

/* Play Button */
.play-btn {
    font-family: 'RustyCage', sans-serif;
    font-size: 16px;
    font-weight: 700;
    padding: 18px 48px;
    background: #F5F5F0;
    color: #000000;
    border: 2px solid #E0E0E0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    max-width: 500px;
    text-transform: uppercase;
}

.play-btn:hover:not(:disabled) {
    background: #E8E8E8;
    transform: translateY(-2px);
}

.play-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Result Display */
.result-display {
    font-size: 14px;
    font-weight: 600;
    padding: 16px 24px;
    border-radius: 8px;
    text-align: center;
    width: 100%;
    max-width: 500px;
    animation: resultSlide 0.3s ease;
}

@keyframes resultSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-display.win {
    background: #F5F5F0;
    border: 2px solid #000000;
    color: #000000;
}

.result-display.lose {
    background: #F5F5F0;
    border: 2px solid #000000;
    color: #000000;
}

/* Confetti */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #F5F5F0;
    animation: confettiFall 3s linear forwards;
}

@keyframes confettiFall {
    to {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .main-container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
}

@media (max-width: 640px) {
    .header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .logo-section {
        flex-direction: column;
    }

    .network-status {
        align-items: center;
    }

    .sidebar {
        grid-template-columns: 1fr;
    }

    .game-area {
        padding: 20px;
    }

    .coin {
        width: 120px;
        height: 120px;
    }

    .bet-buttons {
        grid-template-columns: repeat(2, 1fr);
    }

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

/* Leaderboard Panel */
.leaderboard-subtitle {
    font-family: 'RustyCage', cursive;
    font-size: 9px;
    color: #000000;
    margin-bottom: 12px;
    text-align: center;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.leaderboard-item {
    display: grid;
    grid-template-columns: 30px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    background: #F5F5F0;
    border-radius: 6px;
    transition: all 0.2s;
}

.leaderboard-item:hover {
    background: #FAFAFA;
}

.leaderboard-item.current-user {
    background: #F5F5F0;
    border: 1px solid #F5F5F0;
}

.leaderboard-rank {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 700;
    color: #000000;
    text-align: center;
}

.leaderboard-item:nth-child(1) .leaderboard-rank {
    color: #000000;
}

.leaderboard-item:nth-child(2) .leaderboard-rank {
    color: #000000;
}

.leaderboard-item:nth-child(3) .leaderboard-rank {
    color: #000000;
}

.leaderboard-address {
    font-family: 'RustyCage', monospace;
    font-size: 12px;
    color: #000000;
}

.leaderboard-amount {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: #000000;
}

.leaderboard-empty {
    text-align: center;
    padding: 20px;
    font-size: 12px;
    color: #000000;
    font-style: italic;
}

/* History Button */
.history-btn {
    width: 100%;
    margin-top: 16px;
    padding: 12px;
    background: #F5F5F0;
    color: #000000;
    border: 2px solid #E0E0E0;
    border-radius: 8px;
    font-family: 'RustyCage', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.history-btn:hover {
    background: #E8E8E8;
    transform: translateY(-1px);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(245, 245, 240, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-content {
    background: rgba(245, 245, 240, 0.9);
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #E0E0E0;
}

.modal-header h2 {
    font-family: 'RustyCage', cursive;
    font-size: 16px;
    color: #000000;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: #000000;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #000000;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.history-empty {
    text-align: center;
    padding: 40px 20px;
    font-size: 14px;
    color: #000000;
    font-style: italic;
}

/* History Items */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    background: #F5F5F0;
    border-radius: 8px;
    padding: 16px;
    transition: all 0.2s;
}

.history-item:hover {
    background: #FAFAFA;
}

.history-item.win {
    border-left: 4px solid #000000;
}

.history-item.lose {
    border-left: 4px solid #000000;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.history-receipt {
    font-family: 'RustyCage', cursive;
    font-size: 10px;
    color: #000000;
}

.history-timestamp {
    font-size: 11px;
    color: #000000;
}

.history-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.history-detail {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.history-label {
    font-size: 10px;
    color: #000000;
    text-transform: uppercase;
    font-weight: 600;
}

.history-value {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #000000;
    font-weight: 700;
}

.history-tx {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-tx-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-tx-label {
    font-size: 10px;
    color: #000000;
    min-width: 80px;
}

.history-tx-hash {
    font-family: 'RustyCage', monospace;
    font-size: 11px;
    color: #000000;
    text-decoration: none;
    word-break: break-all;
}

.history-tx-hash:hover {
    text-decoration: underline;
}
