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

body {
    font-family: "IBM Plex Sans", sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #fff;
    min-height: 100vh;
    overflow-x: hidden;
}

.screen {
    display: none;
    min-height: 100vh;
    padding: 20px;
    animation: fadeIn 0.3s ease-in;
}

.screen.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

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

.container {
    max-width: 800px;
    width: 100%;
    text-align: center;
}

.logo {
    font-size: 4rem;
    margin-bottom: 1rem;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
}

.tagline {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 3rem;
}

.menu {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.btn {
    padding: 15px 30px;
    font-size: 1.1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: #ff6b6b;
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.btn-primary:hover {
    background: #ff5252;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.6);
}

.btn-secondary {
    background: #4ecdc4;
    color: white;
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.4);
}

.btn-secondary:hover {
    background: #45b8b0;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(78, 205, 196, 0.6);
}

.btn:disabled {
    background: #666;
    cursor: not-allowed;
    opacity: 0.5;
}

.divider {
    margin: 2rem 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: rgba(255, 255, 255, 0.3);
}

.divider span {
    background: rgba(255, 255, 255, 0.1);
    padding: 0 15px;
    position: relative;
    z-index: 1;
}

.join-form {
    display: flex;
    gap: 10px;
    flex-direction: column;
}

input[type="text"] {
    padding: 15px;
    font-size: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-align: center;
}

input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

input[type="text"]:focus {
    outline: none;
    border-color: #4ecdc4;
    background: rgba(255, 255, 255, 0.15);
}

#roomCodeInput {
    text-transform: uppercase;
}

.rules-link {
    margin-top: 2rem;
}

.rules-link a {
    color: #4ecdc4;
    text-decoration: none;
    font-size: 1rem;
}

.rules-link a:hover {
    text-decoration: underline;
}

.subtitle {
    opacity: 0.8;
    margin: 1rem 0;
}

.error-message {
    color: #ff6b6b;
    margin-top: 1rem;
    font-weight: 600;
}

/* Lobby Screen */
.room-code-display {
    background: rgba(78, 205, 196, 0.2);
    padding: 1rem 2rem;
    border-radius: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 3px;
    margin: 2rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.copy-link-btn {
    padding: 10px 20px;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    white-space: nowrap;
}

.copy-link-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: #4ecdc4;
    transform: translateY(-2px);
}

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

.players-waiting {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 2rem;
    margin: 2rem 0;
    min-height: 200px;
}

.players-waiting h3 {
    margin-bottom: 1.5rem;
}

#playersList {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.player-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 5px;
}

.badge-host {
    background: #ff6b6b;
}

.badge-challenge {
    background: #ff6b35;
}

.badge-normal {
    background: #6c757d;
}

.badge-player {
    background: #4ecdc4;
}

.badge-spectator {
    background: #9b59b6;
}

.player-disconnected {
    opacity: 0.5;
}

.role-toggle-btn {
    padding: 5px 15px;
    font-size: 0.9rem;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-right: 5px;
}

.role-toggle-btn:hover {
    background: #2980b9;
}

.kick-btn {
    padding: 5px 15px;
    font-size: 0.9rem;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.kick-btn:hover {
    background: #c0392b;
}

/* Game Screen */
#gameScreen.active {
    align-items: flex-start;
    padding-top: 20px;
}

.game-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

.game-header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.room-info-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.score-tracker {
    display: flex;
    gap: 2rem;
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.score-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

.score-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.heists .score-value {
    color: #4ecdc4;
}

.alarms .score-value {
    color: #ff6b6b;
}

.phase-indicator {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    text-transform: capitalize;
}

.spectators-display {
    font-size: 0.9rem;
    opacity: 0.8;
}

.game-board {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.community-cards-section,
.pocket-cards-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 1.5rem;
}

.community-cards-section h3,
.pocket-cards-section h3 {
    margin-bottom: 1rem;
}

.cards-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 10px;
}

.cards-header h3 {
    margin-bottom: 0;
}

.hand-ranking {
    font-size: 1rem;
    font-weight: 600;
    padding: 8px 16px;
    background: rgba(6, 167, 125, 0.3);
    border-radius: 8px;
    color: #fff;
}

.card-container {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    min-height: 120px;
    align-items: center;
}

.small-card-container {
    gap: 5px;
!important;
    min-height: 0;
!important;
}

.card {
    width: 80px;
    height: 110px;
    background: #ffffff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
    border: 2px solid #e0e0e0;
}

.small-card {
    width: 40px;
!important;
    height: 55px;
!important;
    font-size: 1.5rem;
!important;
    border: 1px solid #e0e0e0;
!important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
!important;
}

.card:hover {
    transform: translateY(-5px);
}

.card.red {
    color: #d32f2f;
}

.card.black {
    color: #1a1a1a;
}

.card.green {
    color: #2e7d32;
}

.card.blue {
    color: #1565c0;
}

.ranking-section {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.strength-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    padding: 0 1rem;
}

.strength-label {
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.strength-label.strength-low {
    color: #ff6b6b;
}

.strength-label.strength-high {
    color: #4ecdc4;
}

.instructions {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 1rem;
}

.chips-container {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.chip-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.chip {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.chip-white {
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    color: #333;
}

.chip-yellow {
    background: linear-gradient(135deg, #ffd93d 0%, #f9ca24 100%);
    color: #333;
}

.chip-orange {
    background: linear-gradient(135deg, #ff9f43 0%, #ee5a6f 100%);
    color: #fff;
}

.chip-red {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: #fff;
}

.chip:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.chip.selected {
    border-color: #4ecdc4;
    box-shadow: 0 0 20px rgba(78, 205, 196, 0.6);
}

.chip.taken {
    opacity: 0.5;
}

.chip.taken:hover {
    transform: scale(1.05);
}

.chip-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    text-align: center;
    min-height: 20px;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.confidence-container {
    margin-top: 1.5rem;
    text-align: center;
}

.btn-confidence {
    padding: 12px 24px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-confidence:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.btn-confidence.confident {
    background: rgba(78, 205, 196, 0.3);
    border-color: #4ecdc4;
    color: #4ecdc4;
}

.btn-confidence.confident:hover {
    background: rgba(78, 205, 196, 0.4);
}

#confidenceIcon {
    font-size: 1.2rem;
}

/* All Hands View for Spectators */
.all-hands-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.all-hands-section h3,
.other-players-hands-section h3 {
    margin-bottom: 1rem;
    color: #fff;
}

.other-players-hands-section {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.all-hands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.player-hand-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
}

.player-hand-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #fff;
}

.player-hand-cards {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin-bottom: 0.5rem;
    min-height: 60px;
    align-items: center;
}

.player-hand-ranking {
    font-size: 0.9rem;
    opacity: 0.9;
    padding: 5px;
    background: rgba(78, 205, 196, 0.2);
    border-radius: 5px;
}

/* Chip History Section */
.chip-history-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.chip-history-section h3 {
    margin-bottom: 1rem;
    color: #fff;
}

.chip-history-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
}

.chip-history-table thead {
    background: rgba(78, 205, 196, 0.2);
}

.chip-history-table th {
    padding: 12px;
    text-align: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.chip-history-table th:first-child {
    text-align: left;
    padding-left: 20px;
}

.chip-history-table td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chip-history-table td.player-name {
    text-align: left;
    padding-left: 20px;
    font-weight: 600;
    color: #fff;
}

.chip-history-table td.chip-value {
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
}

.chip-history-table td.chip-value.current {
    background: rgba(78, 205, 196, 0.15);
    color: #fff;
    font-size: 1.2rem;
}

.chip-history-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.chip-history-table tbody tr:last-child td {
    border-bottom: none;
}

.chip-arrow {
    font-size: 0.9rem;
    font-weight: 700;
    margin-left: 4px;
}

.chip-arrow.arrow-up {
    color: #4ecdc4;
}

.chip-arrow.arrow-down {
    color: #ff6b6b;
}

.chip-arrow.arrow-same {
    color: #999;
}

/* Chip Change Log Section */
.chip-change-log-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.chip-change-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.chip-change-log-header h3 {
    margin: 0;
    color: #fff;
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.toggle-switch input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.toggle-slider {
    position: relative;
    width: 50px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    transition: all 0.3s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 2px;
    transition: all 0.3s ease;
}

.toggle-switch input[type="checkbox"]:checked + .toggle-slider {
    background: #4ecdc4;
}

.toggle-switch input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(26px);
}

.toggle-label {
    font-size: 0.9rem;
    color: #fff;
    font-weight: 500;
}

.chip-change-log {
    max-height: 400px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 1rem;
}

.chip-change-log::-webkit-scrollbar {
    width: 8px;
}

.chip-change-log::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.chip-change-log::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.chip-change-log::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.chip-log-entry {
    display: flex;
    align-items: center;
    padding: 8px;
    margin-bottom: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
}

.chip-log-entry.selection {
    border-left-color: #4ecdc4;
}

.chip-log-entry.unselection {
    border-left-color: #ff6b6b;
}

.chip-log-timestamp {
    font-family: 'Courier New', monospace;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    margin-right: 12px;
    white-space: nowrap;
}

.chip-log-player {
    font-weight: 600;
    color: #fff;
    margin-right: 8px;
}

.chip-log-player.you {
    color: #4ecdc4;
}

.chip-log-phase-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-right: 8px;
    letter-spacing: 0.5px;
}

.chip-log-phase-badge.preflop {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
}

.chip-log-phase-badge.flop {
    background: rgba(255, 235, 59, 0.9);
    color: #333;
}

.chip-log-phase-badge.turn {
    background: rgba(255, 152, 0, 0.9);
    color: #fff;
}

.chip-log-phase-badge.river {
    background: rgba(244, 67, 54, 0.9);
    color: #fff;
}

.chip-log-change {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.8);
}

.chip-log-value {
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.15);
}

.chip-log-value.null {
    opacity: 0.5;
    font-style: italic;
}

.chip-log-arrow {
    color: rgba(255, 255, 255, 0.5);
}

.game-actions {
    text-align: center;
}

/* Round Result Screen */
#roundResultScreen.active {
    align-items: flex-start;
    padding-top: 20px;
}

.round-result-content {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.result-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.result-title.success {
    color: #4ecdc4;
}

.result-title.failure {
    color: #ff6b6b;
}

.result-message {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.community-cards-result {
    margin: 2rem 0;
}

.community-cards-result h3 {
    margin-bottom: 1rem;
}

.hand-rankings {
    margin-top: 2rem;
}

.hand-rankings h3 {
    margin-bottom: 1rem;
}

#handResults {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hand-result-item {
    background: rgba(255, 255, 255, 0.15);
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid rgba(78, 205, 196, 0.5);
}

/* If a hand has the strength arrow (should have been stronger), mark the whole item red */
.hand-result-item.hand-should-be-stronger {
    background: rgba(231, 76, 60, 0.12); /* soft red background */
    border-left-color: rgba(231, 76, 60, 0.95); /* red accent */
    color: #ffecec; /* slightly lighter text for contrast */
}

.strength-arrow {
    font-size: 1.2rem;
    margin-left: 8px;
    font-weight: 700;
}

/* Up (should have been stronger) -> green */
.strength-arrow.arrow-up {
    color: #06a77d;
}

/* Down (was ranked too strong) -> red */
.strength-arrow.arrow-down {
    color: #e74c3c;
}

.hand-result-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.hand-result-player {
    font-size: 1.2rem;
    font-weight: 600;
}

.hand-result-rank {
    font-size: 1.1rem;
    opacity: 0.9;
}

.hand-result-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.hand-result-cards {
    font-size: 1.1rem;
}

.hand-result-chips {
    font-size: 1rem;
    opacity: 0.9;
}

.round-actions {
    margin-top: 2rem;
    text-align: center;
}

/* Final Results Screen */
#resultsScreen .container {
    max-width: 900px;
}

#resultsContent {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.final-message {
    font-size: 1.3rem;
    margin: 1.5rem 0;
}

.final-score {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 2rem 0;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.final-round-label {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 2rem 0 1rem 0;
    opacity: 0.9;
}

.final-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    overflow: auto;
}

.modal.active {
    display: block;
}

.modal-content {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    margin: 5% auto;
    padding: 2rem;
    border-radius: 15px;
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 2.5rem;
    cursor: pointer;
    color: white;
    line-height: 1;
    font-weight: 300;
}

.close:hover {
    color: #ff6b6b;
}

.modal-content h2 {
    margin-bottom: 1.5rem;
    padding-right: 30px;
}

.rules-content {
    text-align: left;
    line-height: 1.6;
}

.rules-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    color: #fff;
    font-size: 1.3rem;
}

.rules-content p {
    margin-bottom: 1rem;
}

.rules-content ul,
.rules-content ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.rules-content li {
    margin-bottom: 0.7rem;
    padding-left: 0.5rem;
}

.rules-content ol {
    counter-reset: item;
}

.rules-content ol > li {
    display: block;
    position: relative;
}

/* Responsive */
@media (max-width: 768px) {
    .logo {
        font-size: 3rem;
    }

    .game-board {
        grid-template-columns: 1fr;
    }

    .game-header {
        flex-direction: column;
        text-align: center;
    }

    .card {
        width: 60px;
        height: 85px;
        font-size: 1.5rem;
    }

    .small-card {
        width: 30px;
    !important;
        height: 40px;
    !important;
        font-size: 0.75rem;
    !important;
    }

    .chip {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .chip-label {
        font-size: 0.75rem;
        max-width: 60px;
    }

    .chip-history-table {
        font-size: 0.85rem;
    }

    .chip-history-table th,
    .chip-history-table td {
        padding: 8px 4px;
    }

    .chip-history-table th:first-child,
    .chip-history-table td.player-name {
        padding-left: 10px;
    }

    .modal-content {
        margin: 10% auto;
        width: 95%;
        padding: 1.5rem;
    }

    .hand-result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* Poker Rankings Sidebar */
.poker-rankings-sidebar {
    position: fixed;
    right: -500px;
    top: 0;
    width: 500px;
    height: 100vh;
    background: linear-gradient(135deg, rgba(30, 60, 114, 0.98) 0%, rgba(42, 82, 152, 0.98) 100%);
    backdrop-filter: blur(10px);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
    transition: right 0.3s ease-in-out;
    z-index: 999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.poker-rankings-sidebar.visible {
    right: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #fff;
    font-weight: 700;
}

.sidebar-toggle-btn {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    transition: all 0.3s ease;
    opacity: 0.8;
}

.sidebar-toggle-btn:hover {
    opacity: 1;
    transform: scale(1.1);
    color: #ff6b6b;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.sidebar-content::-webkit-scrollbar {
    width: 8px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.rankings-list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: ranking;
}

.ranking-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.ranking-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(-5px);
    border-left-color: #4ecdc4;
}

.rank-number {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    background: rgba(78, 205, 196, 0.3);
    border-radius: 50%;
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
}

.rank-icon {
    font-size: 1.5rem;
    min-width: 30px;
    text-align: center;
}

.rank-details {
    flex: 1;
}

.rank-name {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.rank-description {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.3;
}

/* Button to open sidebar */
.show-rankings-btn {
    position: fixed;
    right: -12px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #4ecdc4 0%, #45b8b0 100%);
    color: white;
    border: none;
    border-radius: 8px 0 0 8px;
    padding: 15px 24px 15px 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: -4px 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 998;
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

.show-rankings-btn:hover {
    background: linear-gradient(135deg, #45b8b0 0%, #3da89f 100%);
    transform: translateY(-50%) translateX(-5px);
    box-shadow: -6px 6px 20px rgba(0, 0, 0, 0.4);
}

.show-rankings-btn.hidden {
    display: none;
}

/* Challenge Mode Styles */
.challenge-mode-section {
    margin: 1.5rem 0;
    text-align: center;
}

.challenge-card-display {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
}

.challenge-card-display h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    color: #fff;
}

.challenge-card {
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    padding: 1rem;
    border-radius: 8px;
}

.challenge-name {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #ffd700;
}

.challenge-description {
    font-size: 0.95rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
}

.chip.locked {
    position: relative;
    opacity: 0.8;
    border: 3px solid #666;
}

.lock-icon {
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 0.8rem;
    background: white;
    border-radius: 50%;
    padding: 2px;
}

/* Challenge Input Screen */
#challengeInputScreen .container {
    max-width: 900px;
}

.challenge-input-content {
    padding: 2rem 0;
}

#challengeInputScreen .chip-history-section {
    margin: 1.5rem 0;
}

.challenge-input-content h3 {
    color: #ffd700;
    margin-top: 0;
    margin-bottom: 1rem;
}

.challenge-instruction {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
}

.player-info-text {
    font-size: 1.1rem;
    margin: 1.5rem 0;
    padding: 1rem;
    background: rgba(255, 215, 0, 0.2);
    border: 2px solid rgba(255, 215, 0, 0.5);
    border-radius: 8px;
    text-align: center;
    color: #ffd700;
}

.wait-message {
    font-size: 1.1rem;
    margin: 2rem 0;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    text-align: center;
    font-style: italic;
    color: rgba(255, 255, 255, 0.9);
}

.challenge-button-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 1.5rem 0;
}

.challenge-button-container-vertical {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    margin: 1.5rem auto;
}

.btn-challenge-option {
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: bold;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
}

.btn-challenge-option:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.btn-challenge-option.has-votes {
    background: rgba(76, 175, 80, 0.3);
    border-color: rgba(76, 175, 80, 0.6);
}

.btn-challenge-option.my-vote {
    background: rgba(33, 150, 243, 0.4);
    border-color: rgba(33, 150, 243, 0.8);
    box-shadow: 0 0 10px rgba(33, 150, 243, 0.5);
}

.voting-status {
    background: rgba(255, 255, 255, 0.1);
    padding: 12px;
    border-radius: 8px;
    margin: 15px 0;
    text-align: center;
    font-size: 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.vote-prompt {
    font-size: 1.1rem;
    margin: 15px 0;
    text-align: center;
}

.vote-details {
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.vote-details h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.9);
}

.vote-option-detail {
    padding: 8px;
    margin: 5px 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

.close-voting-btn {
    margin-top: 20px;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    width: 100%;
    max-width: 400px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    border: none;
}

.close-voting-btn:hover {
    background: linear-gradient(135deg, #45a049, #3d8b40);
    transform: scale(1.02);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .poker-rankings-sidebar {
        width: 100%;
        right: -100%;
    }
    
    .show-rankings-btn {
        right: -10px;
        padding: 12px 20px 12px 10px;
        font-size: 0.85rem;
    }
}