* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #F8F5ED;
    min-height: 100vh;
    color: #231F20;
}

/* Corner Logo */
.corner-logo {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 6px;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: 1px solid #D92323;
}

.corner-logo-img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(35, 31, 32, 0.1);
    border: 2px solid #D92323;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.back-link {
    color: #D92323;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: color 0.3s ease;
    padding: 8px 15px;
    border-radius: 20px;
    background: rgba(217, 35, 35, 0.1);
}

.back-link:hover {
    color: #B91E1E;
    background: rgba(217, 35, 35, 0.2);
}

header h1 {
    color: #231F20;
    font-size: 2.5rem;
    font-weight: 700;
}

.balance-display {
    background: linear-gradient(45deg, #D92323, #B91E1E);
    color: white;
    padding: 15px 25px;
    border-radius: 25px;
    font-size: 1.2rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(217, 35, 35, 0.3);
}

.game-panel {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(35, 31, 32, 0.1);
    border: 1px solid #D92323;
}

.powerball-explanation {
    background: linear-gradient(135deg, #D92323, #B91E1E);
    color: white;
    padding: 15px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 8px 25px rgba(217, 35, 35, 0.3);
}

.powerball-explanation h3 {
    color: white;
    margin-bottom: 10px;
    font-size: 1.3rem;
    font-weight: 700;
}

.powerball-explanation p {
    margin-bottom: 8px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.95);
}

.powerball-explanation ul {
    margin: 15px 0;
    padding-left: 20px;
}

.powerball-explanation li {
    margin-bottom: 8px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
}

.powerball-explanation strong {
    color: #f1c40f;
    font-weight: 700;
}

.powerball-explanation em {
    color: #e74c3c;
    font-style: italic;
}

.explanation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 10px 0;
    transition: all 0.3s ease;
}

.explanation-header:hover {
    opacity: 0.8;
}

.explanation-header h3 {
    margin: 0;
    color: white;
    font-size: 1.3rem;
    font-weight: 700;
}

.toggle-icon {
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.explanation-content {
    overflow: hidden;
    transition: max-height 0.3s ease;
    max-height: 500px; /* Adjust based on content */
}

.explanation-content.collapsed {
    max-height: 0;
}

.toggle-icon.collapsed {
    transform: rotate(-90deg);
}

.balance-section {
    text-align: center;
    margin: 30px 0;
    padding: 20px;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(39, 174, 96, 0.3);
}

.balance-section .balance-display {
    background: transparent;
    box-shadow: none;
    padding: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.game-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.cost-info, .max-number-info {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
}

.game-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

.generate-btn, .reset-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.generate-btn {
    background: linear-gradient(45deg, #D92323, #B91E1E);
    color: white;
    box-shadow: 0 4px 15px rgba(217, 35, 35, 0.3);
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(217, 35, 35, 0.4);
}

.reset-btn {
    background: linear-gradient(45deg, #231F20, #1A1617);
    color: white;
    box-shadow: 0 4px 15px rgba(35, 31, 32, 0.3);
}

.reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(35, 31, 32, 0.4);
}

.result-section {
    text-align: center;
    margin-bottom: 30px;
}

.result-display {
    background: linear-gradient(45deg, #D92323, #B91E1E);
    color: white;
    padding: 20px;
    border-radius: 15px;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 15px;
    box-shadow: 0 8px 25px rgba(217, 35, 35, 0.3);
    min-height: 60px;
    display: block;
    text-align: center;
}

.prize-display {
    font-size: 1.5rem;
    font-weight: 600;
    color: #D92323;
    min-height: 30px;
}

.stats-section {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
}

.stats-grid {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
}

.stat-item {
    background: white;
    padding: 10px 15px;
    border-radius: 8px;
    border-left: 4px solid #D92323;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 1;
    min-width: 150px;
}

.stat-label {
    font-weight: 600;
    color: #231F20;
}

.stat-value {
    font-weight: 700;
    font-size: 1.1rem;
}

.stat-value.positive {
    color: #D92323;
}

.stat-value.negative {
    color: #B91E1E;
}

.history-section {
    background: #F8F5ED;
    border-radius: 10px;
    padding: 20px;
    border: 1px solid #D92323;
}

.history-section h3 {
    color: #231F20;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.history-list {
    max-height: 200px;
    overflow-y: auto;
}

.history-item {
    background: white;
    padding: 10px 15px;
    margin-bottom: 8px;
    border-radius: 8px;
    border-left: 4px solid #D92323;
    font-size: 0.9rem;
}

.history-item.win {
    border-left-color: #D92323;
    background: linear-gradient(90deg, #F8F5ED, white);
}

.history-item.loss {
    border-left-color: #231F20;
    background: linear-gradient(90deg, #F8F5ED, white);
}

.prize-tiers {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(35, 31, 32, 0.1);
    border: 1px solid #D92323;
}

.prize-tiers h3 {
    color: #231F20;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.tiers-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.tier-item {
    background: linear-gradient(45deg, #f39c12, #e67e22);
    color: white;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.3);
}

.tier-item.top-tier {
    background: linear-gradient(45deg, #f1c40f, #f39c12);
}

.tier-item.mid-tier {
    background: linear-gradient(45deg, #e67e22, #d35400);
}

.tier-item.low-tier {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
}

/* Prize Table Styles */
.prize-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

.prize-table th {
    background: linear-gradient(45deg, #D92323, #B91E1E);
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 1rem;
}

.prize-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    font-size: 0.95rem;
}

.prize-table tr:last-child td {
    border-bottom: none;
}

.prize-table tr:hover {
    background: #f8f9fa;
}

.tier-name {
    font-weight: 700;
    color: #2c3e50;
}

.tier-count {
    color: #666;
}

.tier-prize {
    font-weight: 600;
    color: #27ae60;
}

.tier-range {
    color: #666;
    font-family: monospace;
}

.tier-odds {
    color: #666;
    font-weight: 600;
}

/* Tier-specific colors - Matching graph dot colors */
.tier-row.tier-jackpot .tier-name {
    color: #28a745; /* Green for major wins */
    font-weight: bold;
}

.tier-row.tier-major .tier-name {
    color: #28a745; /* Green for major wins */
}

.tier-row.tier-high .tier-name {
    color: #28a745; /* Green for major wins */
}

.tier-row.tier-medium .tier-name {
    color: #ffc107; /* Yellow for medium wins */
}

.tier-row.tier-low .tier-name {
    color: #fd7e14; /* Orange for basic wins */
}

.tier-row.tier-basic .tier-name {
    color: #fd7e14; /* Orange for basic wins */
}

.tier-row.tier-no-prize .tier-name {
    color: #dc3545; /* Red for losses */
    font-weight: bold;
}

/* Legacy tier colors for backward compatibility */
.tier-row.tier-elite .tier-name {
    color: #f1c40f;
}

.tier-row.tier-premium .tier-name {
    color: #e67e22;
}

.tier-row.tier-gold .tier-name {
    color: #f39c12;
}

.tier-row.tier-silver .tier-name {
    color: #95a5a6;
}

.tier-row.tier-bronze .tier-name {
    color: #d35400;
}

.tier-row.tier-top .tier-name {
    color: #f1c40f;
}

.tier-row.tier-mid .tier-name {
    color: #f39c12;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .game-info {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .game-controls {
        flex-direction: column;
        gap: 8px;
    }
    
    .generate-btn, .reset-btn {
        padding: 10px 15px;
        font-size: 0.8rem;
    }
    
    .tiers-list {
        grid-template-columns: 1fr;
    }
    
    .prize-table {
        font-size: 0.9rem;
    }
    
    .prize-table th,
    .prize-table td {
        padding: 10px 8px;
    }
}

/* Profit Graph Section */
.profit-graph-section {
    background: #F8F5ED;
    border: 2px solid #D92323;
    border-radius: 10px;
    padding: 10px;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(217, 35, 35, 0.1);
}

.graph-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.graph-header h3 {
    color: #231F20;
    margin: 0;
    font-size: 1.3rem;
    font-weight: bold;
}

.graph-toggle {
    display: flex;
    align-items: center;
}

.toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: #231F20;
}

.toggle-label input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 40px;
    height: 20px;
    background-color: #ccc;
    border-radius: 10px;
    margin-right: 8px;
    transition: background-color 0.3s;
}

.toggle-slider:before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    background-color: white;
    transition: transform 0.3s;
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider {
    background-color: #D92323;
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.toggle-text {
    font-weight: 500;
}

.profit-graph {
    width: 100%;
    height: 300px;
    background: #F8F5ED;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    padding: 0;
    margin: 0;
}

.profit-graph svg {
    width: 100%;
    height: 100%;
    display: block;
} 