* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
    background: linear-gradient(135deg, #2c1810 0%, #4a2818 50%, #6b3820 100%);
    min-height: 100vh;
    padding: 20px;
    color: #fff;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Language Selector */
.language-selector {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.globe-icon {
    font-size: 18px;
}

.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    overflow: hidden;
    display: none;
    min-width: 140px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.lang-dropdown.show {
    display: block;
}

.lang-option {
    display: block;
    padding: 12px 16px;
    color: #fff;
    text-decoration: none;
    transition: background 0.2s;
}

.lang-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.lang-option.active {
    background: rgba(139, 69, 19, 0.5);
    font-weight: 600;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

h1 {
    font-size: 2.2em;
    margin-bottom: 10px;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.subtitle {
    font-size: 1.1em;
    color: #ffa500;
    opacity: 0.9;
}

/* Stats Panel */
.stats-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.stat-item {
    text-align: center;
}

.stat-label {
    font-size: 0.85em;
    color: #ffa500;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 1.8em;
    font-weight: 700;
    color: #ffd700;
}

.stat-value.correct {
    color: #4ade80;
}

.stat-value.incorrect {
    color: #f87171;
}

/* Game Area */
.game-area {
    margin-bottom: 30px;
}

.cards-section {
    margin-bottom: 25px;
}

.cards-section h3 {
    color: #ffd700;
    margin-bottom: 15px;
    text-align: center;
    font-size: 1.3em;
}

.cards-display {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.card {
    width: 70px;
    height: 100px;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8em;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-5px);
}

.card.red {
    color: #dc2626;
}

.card.black {
    color: #1f2937;
}

.prompt-section {
    text-align: center;
    margin: 25px 0;
}

.prompt-section h3 {
    color: #ffa500;
    font-size: 1.2em;
}

/* Feedback Area */
.feedback-area {
    margin-bottom: 25px;
    padding: 25px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 15px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    text-align: center;
}

.feedback-icon {
    font-size: 4em;
    margin-bottom: 10px;
}

.feedback-icon.correct {
    color: #4ade80;
}

.feedback-icon.incorrect {
    color: #f87171;
}

.feedback-text {
    font-size: 1.8em;
    font-weight: 700;
    margin-bottom: 10px;
}

.feedback-text.correct {
    color: #4ade80;
}

.feedback-text.incorrect {
    color: #f87171;
}

.feedback-detail {
    font-size: 1.1em;
    color: #ffa500;
    margin-bottom: 15px;
}

.best-five-display {
    margin-top: 15px;
}

.best-five-label {
    font-size: 1em;
    color: #ffd700;
    margin-bottom: 10px;
}

.best-five-cards {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.mini-card {
    display: inline-block;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    font-size: 1.2em;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.mini-card.red {
    color: #dc2626;
}

.mini-card.black {
    color: #1f2937;
}

/* Ranking Buttons */
.ranking-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 25px;
}

.ranking-btn {
    padding: 16px 20px;
    background: linear-gradient(135deg, #8b4513, #a0522d);
    border: 2px solid #d2691e;
    border-radius: 12px;
    color: white;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.ranking-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #a0522d, #cd853f);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.ranking-btn:active:not(:disabled) {
    transform: translateY(-1px);
}

.ranking-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Control Buttons */
.control-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.control-btn {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    color: white;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Log Section */
.log-section {
    margin-bottom: 30px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    padding: 20px;
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.log-header h3 {
    color: #ffd700;
    font-size: 1.3em;
}

.clear-log-btn {
    padding: 8px 16px;
    background: rgba(255, 87, 87, 0.2);
    border: 1px solid rgba(255, 87, 87, 0.5);
    border-radius: 20px;
    color: #ff5757;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s;
}

.clear-log-btn:hover {
    background: rgba(255, 87, 87, 0.3);
}

.log-content {
    max-height: 300px;
    overflow-y: auto;
}

.log-empty {
    text-align: center;
    color: #999;
    padding: 20px;
    font-style: italic;
}

.log-entry {
    padding: 12px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border-left: 4px solid;
}

.log-entry.correct {
    border-left-color: #4ade80;
}

.log-entry.incorrect {
    border-left-color: #f87171;
}

.log-time {
    font-size: 0.85em;
    color: #ffa500;
    margin-bottom: 5px;
}

.log-cards {
    font-size: 1.1em;
    margin-bottom: 5px;
    font-weight: 600;
}

.log-result {
    font-size: 0.95em;
    color: #ddd;
}

/* Help Section */
.help-section {
    margin-bottom: 30px;
    padding: 25px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.help-section h3 {
    color: #ffd700;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.help-section ul, .help-section ol {
    margin-left: 25px;
    color: #ddd;
    line-height: 1.8;
}

.help-section li {
    margin-bottom: 8px;
}

.strategy-reminder {
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 165, 0, 0.1);
    border-left: 4px solid #ffa500;
    border-radius: 8px;
}

.strategy-reminder h4 {
    color: #ffa500;
    margin-bottom: 12px;
    font-size: 1.1em;
}

/* Hand Rankings Reference Section */
.hand-rankings-section {
    background: rgba(0, 0, 0, 0.5);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.hand-rankings-section h3 {
    color: #ffd700;
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.8em;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.rankings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.ranking-item {
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.3) 0%, rgba(139, 69, 19, 0.15) 100%);
    padding: 20px;
    border-radius: 12px;
    border: 2px solid rgba(139, 69, 19, 0.5);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.ranking-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(139, 69, 19, 0.4);
    border-color: rgba(139, 69, 19, 0.7);
}

.ranking-royal {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3) 0%, rgba(255, 215, 0, 0.15) 100%);
    border: 2px solid rgba(255, 215, 0, 0.6);
}

.ranking-royal:hover {
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.4);
    border-color: rgba(255, 215, 0, 0.8);
}

.ranking-number {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 2.5em;
    font-weight: 700;
    color: rgba(255, 215, 0, 0.3);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.ranking-name {
    color: #ffd700;
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.ranking-cards {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.card-symbol {
    background: white;
    padding: 12px 8px;
    border-radius: 8px;
    font-size: 1.5em;
    font-weight: 700;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    border: 2px solid #333;
    min-width: 45px;
    text-align: center;
    transition: all 0.2s;
}

.card-symbol:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.card-symbol.red {
    color: #e74c3c;
}

.card-symbol.black {
    color: #000;
}

/* Glossary Section */
.glossary-section {
    margin-bottom: 30px;
    padding: 25px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.glossary-section h3 {
    color: #ffd700;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.glossary-item {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.glossary-item h4 {
    color: #ffa500;
    margin-bottom: 8px;
    font-size: 1.1em;
}

.glossary-item p {
    color: #ddd;
    line-height: 1.6;
}

/* Footer */
footer {
    text-align: center;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    color: #ddd;
}

footer p {
    margin-bottom: 8px;
}

.warning {
    color: #ffa500;
    font-size: 0.95em;
}

.copyright {
    color: #999;
    font-size: 0.9em;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 20px;
    }

    h1 {
        font-size: 1.6em;
    }

    .subtitle {
        font-size: 1em;
    }

    .stats-panel {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: 10px;
        padding: 15px;
    }

    .stat-value {
        font-size: 1.4em;
    }

    .cards-display {
        gap: 6px;
        padding: 15px;
    }

    .card {
        width: 55px;
        height: 80px;
        font-size: 1.4em;
    }

    .ranking-buttons {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .ranking-btn {
        padding: 14px 18px;
        font-size: 0.95em;
    }

    .rankings-grid {
        grid-template-columns: 1fr;
    }

    .ranking-number {
        font-size: 2em;
    }

    .card-symbol {
        font-size: 1.2em;
        padding: 10px 6px;
        min-width: 40px;
    }
}

/* Scrollbar styling */
.log-content::-webkit-scrollbar {
    width: 8px;
}

.log-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.log-content::-webkit-scrollbar-thumb {
    background: rgba(255, 165, 0, 0.5);
    border-radius: 4px;
}

.log-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 165, 0, 0.7);
}
