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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #0f4c3a 0%, #1a6b4f 50%, #0f4c3a 100%);
    min-height: 100vh;
    padding: 20px;
    color: #fff;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '♠';
    position: fixed;
    top: 5%;
    left: 5%;
    font-size: 20em;
    color: rgba(255, 255, 255, 0.04);
    z-index: 0;
    pointer-events: none;
    transform: rotate(-25deg);
    animation: floatSuit1 20s ease-in-out infinite;
}

body::after {
    content: '♥';
    position: fixed;
    bottom: 10%;
    right: 8%;
    font-size: 18em;
    color: rgba(220, 53, 69, 0.05);
    z-index: 0;
    pointer-events: none;
    transform: rotate(20deg);
    animation: floatSuit2 25s ease-in-out infinite;
}

@keyframes floatSuit1 {
    0%, 100% { transform: rotate(-25deg) translateY(0); }
    50% { transform: rotate(-20deg) translateY(-30px); }
}

@keyframes floatSuit2 {
    0%, 100% { transform: rotate(20deg) translateY(0); }
    50% { transform: rotate(25deg) translateY(30px); }
}

.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: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #ffd700;
    border-radius: 8px;
    color: #fff;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
}

.lang-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 215, 0, 0.3);
}

.globe-icon {
    font-size: 1.2em;
}

.current-lang {
    font-weight: 500;
}

.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #ffd700;
    border-radius: 8px;
    min-width: 150px;
    display: none;
    flex-direction: column;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
}

.lang-dropdown.show {
    display: flex;
}

.lang-option {
    padding: 12px 20px;
    color: #fff;
    text-decoration: none;
    transition: all 0.2s;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

.lang-option:last-child {
    border-bottom: none;
}

.lang-option:hover {
    background: rgba(255, 215, 0, 0.2);
    padding-left: 25px;
}

.lang-option.active {
    background: rgba(255, 215, 0, 0.3);
    color: #ffd700;
    font-weight: 600;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    border: 2px solid #ffd700;
}

header h1 {
    font-size: 2.5em;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 10px;
    font-weight: 600;
}

.subtitle {
    color: #fff;
    font-size: 1.1em;
    opacity: 0.9;
}

/* Stats Panel */
.stats-panel {
    display: flex;
    justify-content: space-around;
    background: rgba(0, 0, 0, 0.4);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.stat-item {
    text-align: center;
}

.stat-label {
    font-size: 0.9em;
    color: #ccc;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 2em;
    font-weight: 600;
    color: #ffd700;
}

.stat-value.correct {
    color: #4caf50;
}

.stat-value.incorrect {
    color: #f44336;
}

/* Game Area */
.game-area {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 20px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    display: flex;
    flex-direction: column;
    gap: 40px;
    position: relative;
    overflow: hidden;
}

.game-area::before {
    content: '♦';
    position: absolute;
    top: -20px;
    right: 30px;
    font-size: 8em;
    color: rgba(220, 53, 69, 0.06);
    pointer-events: none;
    transform: rotate(25deg);
}

.game-area::after {
    content: '♣';
    position: absolute;
    bottom: -20px;
    left: 30px;
    font-size: 8em;
    color: rgba(255, 255, 255, 0.06);
    pointer-events: none;
    transform: rotate(-25deg);
}

.position-section,
.hand-section,
.situation-section {
    background: rgba(40, 167, 69, 0.15);
    padding: 25px;
    border-radius: 12px;
    border: 2px solid rgba(40, 167, 69, 0.4);
}

.position-section h3,
.hand-section h3,
.situation-section h3 {
    text-align: center;
    color: #51cf66;
    margin-bottom: 20px;
    font-size: 1.5em;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.position-display,
.situation-display {
    display: flex;
    justify-content: center;
}

.position-badge,
.situation-badge {
    padding: 15px 30px;
    background: rgba(255, 215, 0, 0.2);
    border: 2px solid #ffd700;
    border-radius: 10px;
    color: #ffd700;
    font-size: 1.3em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.card-display {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
}

.card {
    width: 110px;
    height: 150px;
    background: white;
    color: #000;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
    border: 4px solid #333;
    transition: all 0.3s;
    gap: 5px;
}

.hand-section .card {
    border-color: #28a745;
    box-shadow: 0 6px 12px rgba(40, 167, 69, 0.5), 0 0 20px rgba(40, 167, 69, 0.3);
}

.card.red {
    color: #e74c3c;
}

.card-rank {
    font-size: 3em;
    line-height: 1;
}

.card-suit {
    font-size: 2.5em;
    line-height: 1;
}

.hand-description {
    text-align: center;
    font-size: 1.3em;
    color: #fff;
    font-weight: 500;
    padding: 15px;
    background: rgba(40, 167, 69, 0.2);
    border-radius: 8px;
    border: 1px solid rgba(40, 167, 69, 0.3);
    margin-top: 10px;
}

/* Feedback Area */
.feedback-area {
    margin-bottom: 20px;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    animation: slideDown 0.3s ease-out;
}

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

.feedback-area.correct {
    background: rgba(76, 175, 80, 0.3);
    border: 2px solid #4caf50;
}

.feedback-area.incorrect {
    background: rgba(244, 67, 54, 0.3);
    border: 2px solid #f44336;
}

.feedback-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.feedback-text {
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 10px;
}

.feedback-detail {
    font-size: 1.1em;
    opacity: 0.9;
    line-height: 1.6;
}

.feedback-detail strong {
    font-weight: 600;
    font-size: 1.2em;
}

.feedback-detail small {
    display: block;
    margin-top: 10px;
    font-size: 0.9em;
    opacity: 0.85;
    line-height: 1.5;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

.win-rate-comparison {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 12px 0;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    font-size: 0.95em;
}

.win-rate-comparison span {
    display: block;
}

.rate-label {
    font-weight: 600;
    color: #ffd700;
    margin-bottom: 5px;
}

.rate-user {
    color: #f8b4b4;
}

.rate-correct {
    color: #90ee90;
    font-weight: 600;
}

.rate-diff {
    color: #ffd700;
    font-size: 0.9em;
    font-style: italic;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.action-btn {
    flex: 1;
    min-width: 150px;
    max-width: 180px;
    padding: 20px;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    border: 3px solid #ffd700;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 500;
    transition: all 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(255, 215, 0, 0.4);
    background: linear-gradient(135deg, #34495e, #2c3e50);
}

.action-btn:active {
    transform: translateY(0);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Poker action button colors */
.fold-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border-color: #c0392b;
}

.fold-btn:hover {
    background: linear-gradient(135deg, #c0392b, #e74c3c);
    box-shadow: 0 6px 12px rgba(231, 76, 60, 0.4);
}

.call-btn {
    background: linear-gradient(135deg, #f39c12, #d68910);
    border-color: #d68910;
}

.call-btn:hover {
    background: linear-gradient(135deg, #d68910, #f39c12);
    box-shadow: 0 6px 12px rgba(243, 156, 18, 0.4);
}

.raise-btn {
    background: linear-gradient(135deg, #27ae60, #229954);
    border-color: #229954;
}

.raise-btn:hover {
    background: linear-gradient(135deg, #229954, #27ae60);
    box-shadow: 0 6px 12px rgba(39, 174, 96, 0.4);
}

.btn-label {
    font-size: 1.2em;
}

.btn-key {
    font-size: 0.8em;
    color: #ffffff;
    opacity: 0.9;
}

/* Control Buttons */
.control-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.control-btn {
    padding: 15px 40px;
    font-size: 1.1em;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: 2px solid #c0392b;
}

.control-btn:hover {
    background: linear-gradient(135deg, #c0392b, #e74c3c);
    transform: scale(1.05);
}


/* Log Section */
.log-section {
    background: rgba(0, 0, 0, 0.5);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

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

.log-header h3 {
    color: #ffd700;
    font-size: 1.3em;
    margin: 0;
}

.clear-log-btn {
    padding: 8px 20px;
    background: rgba(244, 67, 54, 0.3);
    border: 2px solid #f44336;
    border-radius: 6px;
    color: #fff;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.2s;
}

.clear-log-btn:hover {
    background: rgba(244, 67, 54, 0.5);
    transform: scale(1.05);
}

.log-content {
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    max-height: 300px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.95em;
    line-height: 1.6;
}

.log-content::-webkit-scrollbar {
    width: 10px;
}

.log-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
}

.log-content::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.5);
    border-radius: 5px;
}

.log-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 215, 0, 0.7);
}

.log-empty {
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    padding: 20px;
    font-style: italic;
}

.log-entry {
    margin-bottom: 15px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border-left: 4px solid;
}

.log-entry.correct {
    border-left-color: #4caf50;
}

.log-entry.incorrect {
    border-left-color: #f44336;
}

.log-entry-header {
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.log-entry-time {
    font-size: 0.85em;
    opacity: 0.7;
}

.log-entry-hand {
    color: #ffd700;
    margin-bottom: 6px;
}

.log-entry-action {
    margin-bottom: 6px;
}

.log-entry-winrate {
    margin: 8px 0;
    font-size: 0.85em;
}

.log-entry-winrate .win-rate-comparison {
    padding: 8px;
    margin: 0;
}

.log-entry-explanation {
    font-size: 0.9em;
    opacity: 0.8;
    padding: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    margin-top: 8px;
    line-height: 1.5;
}

/* Help Section */
.help-section {
    background: rgba(0, 0, 0, 0.4);
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.help-section h3 {
    color: #ffd700;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.help-section ul {
    list-style-position: inside;
    line-height: 1.8;
    margin-bottom: 20px;
}

.help-section li {
    margin-bottom: 10px;
}

.strategy-reminder {
    background: rgba(255, 215, 0, 0.1);
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #ffd700;
}

.strategy-reminder h4 {
    color: #ffd700;
    margin-bottom: 10px;
}

.strategy-reminder ol {
    list-style-position: inside;
    line-height: 1.8;
}

/* Glossary Section */
.glossary-section {
    background: rgba(0, 0, 0, 0.4);
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.glossary-section h3 {
    color: #ffd700;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.glossary-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid #ffd700;
    transition: all 0.3s;
}

.glossary-item:last-child {
    margin-bottom: 0;
}

.glossary-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(5px);
}

.glossary-item h4 {
    color: #ffd700;
    margin-bottom: 10px;
    font-size: 1.1em;
    font-weight: 600;
}

.glossary-item p {
    color: #fff;
    line-height: 1.6;
    opacity: 0.9;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    opacity: 0.8;
}

footer p {
    margin: 5px 0;
}

.warning {
    color: #ffd700;
    font-weight: 500;
    font-size: 1.1em;
}

.copyright {
    font-size: 0.9em;
    opacity: 0.7;
    margin-top: 10px;
    color: #ccc;
}

/* 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.4);
}

.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(40, 167, 69, 0.2) 0%, rgba(40, 167, 69, 0.1) 100%);
    padding: 20px;
    border-radius: 12px;
    border: 2px solid rgba(40, 167, 69, 0.4);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.ranking-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(40, 167, 69, 0.3);
    border-color: rgba(40, 167, 69, 0.6);
}

.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;
}

/* Responsive Design */
@media (max-width: 768px) {
    .language-selector {
        position: relative;
        margin-bottom: 15px;
        display: flex;
        justify-content: center;
    }

    .lang-btn {
        width: 100%;
        max-width: 200px;
        justify-content: center;
    }

    .lang-dropdown {
        left: 50%;
        transform: translateX(-50%);
        right: auto;
    }

    header h1 {
        font-size: 1.8em;
    }

    .stats-panel {
        flex-wrap: wrap;
        gap: 15px;
    }

    .stat-item {
        flex: 1 1 45%;
    }

    .card {
        width: 80px;
        height: 110px;
    }

    .card-rank {
        font-size: 2em;
    }

    .card-suit {
        font-size: 1.8em;
    }

    .position-section h3,
    .hand-section h3,
    .situation-section h3 {
        font-size: 1.2em;
    }

    .game-area {
        gap: 30px;
        padding: 20px;
    }

    .position-section,
    .hand-section,
    .situation-section {
        padding: 20px;
    }

    .position-badge,
    .situation-badge {
        font-size: 1.1em;
        padding: 12px 24px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-btn {
        max-width: 100%;
    }

    .control-buttons {
        flex-direction: column;
    }

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

    .ranking-number {
        font-size: 2em;
    }

    .card-symbol {
        font-size: 1.2em;
        padding: 10px 6px;
        min-width: 40px;
    }
}

/* Animation for correct/incorrect */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

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

.shake {
    animation: shake 0.5s;
}

.pulse {
    animation: pulse 0.5s;
}
