/* Rock Paper Scissors Game - MathsVault Styling */

/* Import site's base styles */
@import url('/css/styles.css');

/* Mobile-first base styles */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Ensure proper touch targets */
button, .choice-btn {
    min-height: 44px;
    min-width: 44px;
    touch-action: manipulation;
}

/* Override container for game layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    background: white;
    min-height: 100vh;
    box-sizing: border-box;
}

/* Prevent horizontal scroll on mobile */
body {
    overflow-x: hidden;
}

/* Header styling */
header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 3rem;
}

header p {
    color: #666;
    font-size: 1.2rem;
    margin-bottom: 0;
}

/* Game mode toggle */
.game-mode-toggle {
    text-align: center;
    margin-bottom: 2rem;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.mode-toggle-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 24px;
    cursor: pointer;
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.mode-toggle-btn:hover {
    background: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

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

.choose-opponent-btn {
    background: var(--secondary);
}

.choose-opponent-btn:hover {
    background: #e6731e;
}

/* Scoreboard */
.scoreboard {
    display: flex;
    justify-content: space-around;
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-left: 4px solid var(--primary);
}

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

.score-label {
    font-size: 1rem;
    color: #666;
    margin-bottom: 5px;
    font-weight: 600;
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
}

.score-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
}

/* Game display */
.game-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
    border-left: 4px solid var(--secondary);
}

.player-section, .computer-section {
    flex: 1;
    text-align: center;
}

.player-section h3, .computer-section h3 {
    color: var(--primary);
    margin-bottom: 15px;
    font-size: 1.2rem;
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
    text-transform: capitalize;
}

.choice-display {
    width: 120px;
    height: 120px;
    border: 3px solid #ddd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    background: white;
    transition: all 0.3s ease;
}

.choice-icon {
    font-size: 4rem;
    transition: all 0.3s ease;
    color: var(--primary);
}

.choice-display.selected {
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(201, 12, 15, 0.3);
    transform: scale(1.1);
}

.choice-display.computer-selected {
    border-color: var(--secondary);
    box-shadow: 0 0 20px rgba(250, 183, 25, 0.3);
    transform: scale(1.1);
}

.vs-section {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 20px;
}

.vs-text {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
    background: white;
    padding: 10px 20px;
    border-radius: 50px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
}

/* Result section */
.result-section {
    margin-bottom: 2rem;
    text-align: center;
}

.result-message {
    font-size: 1.5rem;
    font-weight: bold;
    padding: 15px 30px;
    border-radius: 25px;
    display: inline-block;
    transition: all 0.3s ease;
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
}

.result-message.win {
    background: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.result-message.lose {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
}

.result-message.draw {
    background: #fff3cd;
    color: #856404;
    border: 2px solid #ffeaa7;
}

.result-message.default {
    background: #e2e3e5;
    color: var(--primary);
    border: 2px solid #d6d8db;
}

/* Controls */
.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.extended-only {
    display: none !important;
}

.extended-mode .extended-only {
    display: flex !important;
}

.choice-btn {
    background: linear-gradient(145deg, #ffffff, #e6e6e6);
    border: none;
    border-radius: 15px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 100px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
    position: relative;
    overflow: hidden;
}

/* Add ripple effect for mobile */
.choice-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(201, 12, 15, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.choice-btn:active::before {
    width: 300px;
    height: 300px;
}

.choice-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.choice-btn:active {
    transform: translateY(-2px);
}

.choice-btn.selected {
    background: var(--primary);
    color: white;
    transform: translateY(-5px);
}

.choice-btn.selected .btn-icon {
    color: white;
}

.btn-icon {
    font-size: 2rem;
    color: var(--primary);
    transition: all 0.3s ease;
}

.btn-text {
    font-size: 0.9rem;
    text-transform: capitalize;
}

/* Game controls */
.game-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.reset-btn, .auto-play-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 24px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
}

.auto-play-btn {
    background: var(--secondary);
}

.reset-btn:hover, .auto-play-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.reset-btn:active, .auto-play-btn:active {
    transform: translateY(0);
}

/* Rules section */
.rules-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    text-align: left;
    max-width: 800px;
    margin: 0 auto;
    border-left: 4px solid var(--primary);
}

.rules-section h3 {
    color: var(--primary);
    margin-bottom: 15px;
    text-align: center;
    font-size: 1.3rem;
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
    text-transform: capitalize;
}

.rules-section ul {
    list-style: none;
    padding: 0;
}

.rules-section li {
    padding: 8px 0;
    font-size: 1.1rem;
    color: #555;
    border-bottom: 1px solid #e9ecef;
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
}

.rules-section li:last-child {
    border-bottom: none;
}

.rules-section strong {
    color: var(--primary);
}

.rules-section i {
    color: var(--secondary);
    margin: 0 5px;
    font-size: 1.1em;
}

.rules-section em {
    color: var(--primary);
    font-style: italic;
    font-weight: 600;
    margin: 0 3px;
    text-decoration: underline;
    text-decoration-color: var(--secondary);
    text-underline-offset: 2px;
}

/* Video reference */
.video-reference {
    margin-top: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 10px;
    border-left: 4px solid var(--primary);
}

.video-reference p {
    margin: 0;
    font-size: 1rem;
    color: #495057;
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
}

.video-reference a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.video-reference a:hover {
    color: var(--secondary);
    text-decoration: underline;
}

.video-reference i {
    color: var(--primary);
    margin-right: 8px;
}

.video-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    margin-top: 15px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Animation for choice reveal */
@keyframes choiceReveal {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.choice-reveal {
    animation: choiceReveal 0.5s ease-out;
}

/* Responsive design - Mobile First Approach */

/* Large tablets and small desktops */
@media (max-width: 1024px) {
    .container {
        padding: 1.5rem;
    }
    
    .choice-display {
        width: 110px;
        height: 110px;
    }
    
    .choice-icon {
        font-size: 3.5rem;
    }
}

/* Tablets */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
        min-height: auto;
    }
    
    header h1 {
        font-size: 2.5rem;
        margin-bottom: 0.5rem;
    }
    
    header p {
        font-size: 1.1rem;
    }
    
    .game-mode-toggle {
        margin-bottom: 1.5rem;
    }
    
    .mode-toggle-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .scoreboard {
        flex-direction: row;
        justify-content: space-around;
        padding: 15px;
        margin-bottom: 1.5rem;
    }
    
    .score-item {
        flex: 1;
        text-align: center;
    }
    
    .score-label {
        font-size: 0.9rem;
        margin-bottom: 3px;
    }
    
    .score-value {
        font-size: 1.8rem;
    }
    
    .game-display {
        flex-direction: column;
        gap: 20px;
        padding: 15px;
        margin-bottom: 1.5rem;
    }
    
    .player-section, .computer-section {
        flex: none;
    }
    
    .vs-section {
        margin: 10px 0;
        order: -1;
    }
    
    .vs-text {
        font-size: 1.5rem;
        padding: 8px 16px;
    }
    
    .choice-display {
        width: 100px;
        height: 100px;
    }
    
    .choice-icon {
        font-size: 3rem;
    }
    
    .result-message {
        font-size: 1.3rem;
        padding: 12px 25px;
    }
    
    .controls {
        gap: 10px;
        margin-bottom: 1.5rem;
        justify-content: center;
    }
    
    .choice-btn {
        min-width: 85px;
        padding: 12px 8px;
        font-size: 0.85rem;
    }
    
    .btn-icon {
        font-size: 1.6rem;
    }
    
    .btn-text {
        font-size: 0.8rem;
    }
    
    .game-controls {
        gap: 10px;
        margin-bottom: 1.5rem;
    }
    
    .reset-btn, .auto-play-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .rules-section {
        padding: 20px;
        margin: 0;
    }
    
    .rules-section h3 {
        font-size: 1.2rem;
        margin-bottom: 12px;
    }
    
    .rules-section li {
        font-size: 1rem;
        padding: 6px 0;
    }
    
    .video-container {
        margin-top: 10px;
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    .container {
        padding: 0.75rem;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
    }
    
    header {
        margin-bottom: 1rem;
    }
    
    header h1 {
        font-size: 1.8rem;
        line-height: 1.2;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    .title-icons {
        display: flex;
        gap: 0.3rem;
    }
    
    .title-icons i {
        font-size: 2rem;
    }
    
    .title-text {
        font-size: 1.8rem;
    }
    
    
    header p {
        font-size: 0.9rem;
        margin-bottom: 0;
    }
    
    .game-mode-toggle {
        margin-bottom: 0.75rem;
    }
    
    .mode-toggle-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
        border-radius: 20px;
    }
    
    .scoreboard {
        flex-direction: row !important;
        gap: 8px;
        padding: 10px;
        margin-bottom: 0.75rem;
    }
    
    .score-item {
        flex: 1;
        text-align: center;
        padding: 4px 0;
    }
    
    .score-label {
        font-size: 0.8rem;
        margin-bottom: 2px;
    }
    
    .score-value {
        font-size: 1.3rem;
    }
    
    .game-display {
        flex-direction: row !important;
        padding: 10px;
        margin-bottom: 0.75rem;
        gap: 15px;
    }
    
    .player-section, .computer-section {
        flex: 1;
    }
    
    .player-section h3, .computer-section h3 {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }
    
    .vs-section {
        margin: 0;
        order: 0;
    }
    
    .vs-text {
        font-size: 1rem;
        padding: 4px 8px;
    }
    
    .choice-display {
        width: 60px;
        height: 60px;
    }
    
    .choice-icon {
        font-size: 2rem;
    }
    
    .result-message {
        font-size: 1rem;
        padding: 8px 16px;
        border-radius: 15px;
        margin-bottom: 0.75rem;
    }
    
    .controls {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px;
        margin-bottom: 0.75rem;
        max-width: 300px;
        margin-left: auto;
        margin-right: auto;
        justify-content: unset !important;
    }
    
    .choice-btn {
        min-width: 80px;
        padding: 8px 4px;
        flex-direction: column;
        gap: 4px;
    }
    
    .extended-mode .controls {
        grid-template-columns: repeat(3, 1fr) !important;
        max-width: 300px;
    }
    
    .extended-mode .choice-btn:nth-child(4),
    .extended-mode .choice-btn:nth-child(5) {
        grid-column: span 1;
    }
    
    .extended-mode .choice-btn:nth-child(4) {
        grid-column: 1;
        grid-row: 2;
    }
    
    .extended-mode .choice-btn:nth-child(5) {
        grid-column: 2;
        grid-row: 2;
    }
    
    .btn-icon {
        font-size: 1.2rem;
    }
    
    .btn-text {
        font-size: 0.7rem;
    }
    
    .game-controls {
        flex-direction: row;
        justify-content: center;
        gap: 8px;
        margin-bottom: 0.75rem;
    }
    
    .reset-btn, .auto-play-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
        border-radius: 15px;
        flex: 1;
        max-width: 120px;
    }
    
    .rules-section {
        padding: 10px;
        border-radius: 8px;
        margin-top: auto;
        flex-shrink: 0;
    }
    
    .rules-section h3 {
        font-size: 1rem;
        margin-bottom: 8px;
    }
    
    .rules-section li {
        font-size: 0.8rem;
        padding: 3px 0;
    }
    
    .video-reference {
        padding: 8px;
        margin-top: 10px;
    }
    
    .video-reference p {
        font-size: 0.8rem;
    }
    
    .video-container {
        margin-top: 6px;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .container {
        padding: 0.5rem;
    }
    
    header h1 {
        font-size: 1.6rem;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.4rem;
    }
    
    .title-icons {
        display: flex;
        gap: 0.25rem;
    }
    
    .title-icons i {
        font-size: 1.8rem;
    }
    
    .title-text {
        font-size: 1.6rem;
    }
    
    
    .choice-display {
        width: 50px;
        height: 50px;
    }
    
    .choice-icon {
        font-size: 1.6rem;
    }
    
    .controls {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 6px;
        margin-bottom: 0.75rem;
        max-width: 280px;
        margin-left: auto;
        margin-right: auto;
        justify-content: unset !important;
    }
    
    .choice-btn {
        min-width: 70px;
        padding: 6px 2px;
    }
    
    .extended-mode .controls {
        grid-template-columns: repeat(3, 1fr) !important;
        max-width: 280px;
    }
    
    .extended-mode .choice-btn:nth-child(4),
    .extended-mode .choice-btn:nth-child(5) {
        grid-column: span 1;
    }
    
    .extended-mode .choice-btn:nth-child(4) {
        grid-column: 1;
        grid-row: 2;
    }
    
    .extended-mode .choice-btn:nth-child(5) {
        grid-column: 2;
        grid-row: 2;
    }
    
    .btn-icon {
        font-size: 1rem;
    }
    
    .btn-text {
        font-size: 0.65rem;
    }
    
    .reset-btn, .auto-play-btn {
        padding: 6px 8px;
        font-size: 0.75rem;
        min-height: 40px;
    }
}

/* Extra small screens (iPhone SE, etc.) */
@media (max-width: 320px) {
    .container {
        padding: 0.25rem;
    }
    
    header h1 {
        font-size: 1.4rem;
        line-height: 1.1;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.3rem;
    }
    
    .title-icons {
        display: flex;
        gap: 0.2rem;
    }
    
    .title-icons i {
        font-size: 1.6rem;
    }
    
    .title-text {
        font-size: 1.4rem;
    }
    
    
    .choice-display {
        width: 45px;
        height: 45px;
    }
    
    .choice-icon {
        font-size: 1.4rem;
    }
    
    .controls {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 4px;
        margin-bottom: 0.75rem;
        max-width: 260px;
        margin-left: auto;
        margin-right: auto;
        justify-content: unset !important;
    }
    
    .choice-btn {
        min-width: 60px;
        padding: 5px 2px;
    }
    
    .extended-mode .controls {
        grid-template-columns: repeat(3, 1fr) !important;
        max-width: 260px;
    }
    
    .extended-mode .choice-btn:nth-child(4),
    .extended-mode .choice-btn:nth-child(5) {
        grid-column: span 1;
    }
    
    .extended-mode .choice-btn:nth-child(4) {
        grid-column: 1;
        grid-row: 2;
    }
    
    .extended-mode .choice-btn:nth-child(5) {
        grid-column: 2;
        grid-row: 2;
    }
    
    .btn-icon {
        font-size: 0.9rem;
    }
    
    .btn-text {
        font-size: 0.6rem;
    }
    
    .reset-btn, .auto-play-btn {
        padding: 5px 6px;
        font-size: 0.7rem;
        min-height: 38px;
    }
    
    .score-value {
        font-size: 1.2rem;
    }
    
    .result-message {
        font-size: 0.9rem;
        padding: 6px 12px;
    }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .container {
        padding: 0.5rem;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
    }
    
    header {
        margin-bottom: 0.5rem;
    }
    
    header h1 {
        font-size: 1.5rem;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.3rem;
    }
    
    .title-icons {
        display: flex;
        gap: 0.25rem;
    }
    
    .title-icons i {
        font-size: 1.8rem;
    }
    
    .title-text {
        font-size: 1.5rem;
    }
    
    
    header p {
        font-size: 0.8rem;
    }
    
    .game-mode-toggle {
        margin-bottom: 0.5rem;
    }
    
    .scoreboard {
        flex-direction: row;
        padding: 8px;
        margin-bottom: 0.5rem;
    }
    
    .score-item {
        flex: 1;
        text-align: center;
    }
    
    .score-label {
        font-size: 0.7rem;
    }
    
    .score-value {
        font-size: 1.2rem;
    }
    
    .game-display {
        flex-direction: row;
        gap: 10px;
        padding: 8px;
        margin-bottom: 0.5rem;
    }
    
    .vs-section {
        margin: 0 8px;
        order: 0;
    }
    
    .vs-text {
        font-size: 1rem;
        padding: 4px 8px;
    }
    
    .choice-display {
        width: 50px;
        height: 50px;
    }
    
    .choice-icon {
        font-size: 1.8rem;
    }
    
    .result-message {
        font-size: 0.9rem;
        padding: 6px 12px;
        margin-bottom: 0.5rem;
    }
    
    .controls {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 4px;
        margin-bottom: 0.5rem;
        max-width: 280px;
        margin-left: auto;
        margin-right: auto;
        justify-content: unset !important;
    }
    
    .choice-btn {
        min-width: 60px;
        padding: 6px 2px;
    }
    
    .extended-mode .controls {
        grid-template-columns: repeat(3, 1fr) !important;
        max-width: 280px;
    }
    
    .extended-mode .choice-btn:nth-child(4),
    .extended-mode .choice-btn:nth-child(5) {
        grid-column: span 1;
    }
    
    .extended-mode .choice-btn:nth-child(4) {
        grid-column: 1;
        grid-row: 2;
    }
    
    .extended-mode .choice-btn:nth-child(5) {
        grid-column: 2;
        grid-row: 2;
    }
    
    .btn-icon {
        font-size: 1rem;
    }
    
    .btn-text {
        font-size: 0.65rem;
    }
    
    .game-controls {
        flex-direction: row;
        gap: 6px;
        margin-bottom: 0.5rem;
    }
    
    .reset-btn, .auto-play-btn {
        padding: 6px 8px;
        font-size: 0.75rem;
        flex: 1;
        max-width: 100px;
    }
    
    .rules-section {
        margin-top: auto;
        flex-shrink: 0;
        padding: 8px;
    }
}

/* Character Selection Modal */
.character-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 20px;
    box-sizing: border-box;
}

.character-modal-content {
    background-color: white;
    margin: 2% auto;
    padding: 30px;
    border: 3px solid var(--primary);
    border-radius: 15px;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.character-modal-close {
    color: var(--primary);
    float: right;
    font-size: 42px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
    position: absolute;
    right: 20px;
    top: 20px;
}

.character-modal-close:hover,
.character-modal-close:focus {
    color: var(--secondary);
    text-decoration: none;
}

.character-modal-content h2 {
    color: var(--primary);
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
    margin-bottom: 25px;
    text-align: center;
    font-size: 2rem;
}

.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.character-card {
    background: white;
    border: 2px solid var(--primary);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.character-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    border-color: var(--secondary);
}

.character-card.selected {
    border-color: var(--secondary);
    background: linear-gradient(135deg, #fff5e6 0%, #fff 100%);
    box-shadow: 0 6px 20px rgba(250, 183, 25, 0.4);
}

.character-card-image {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 3px solid var(--primary);
    margin-bottom: 15px;
    object-fit: cover;
    transition: all 0.3s ease;
}

.character-card:hover .character-card-image {
    transform: scale(1.05);
    border-color: var(--secondary);
}

.character-card-name {
    color: var(--primary);
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
    font-size: 1.4rem;
    font-weight: bold;
    margin-bottom: 5px;
    text-align: center;
}

.character-card-title {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 15px;
    text-align: center;
    font-style: italic;
}

.character-card-separator {
    width: 50px;
    height: 2px;
    background: var(--secondary);
    margin: 10px 0 15px 0;
}

.character-card-bio {
    color: #555;
    font-size: 0.9rem;
    line-height: 1.5;
    text-align: center;
    margin-bottom: 15px;
}

.character-card-record {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
    width: 100%;
}

.record-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.record-stat:last-child {
    margin-bottom: 0;
}

.record-icon-win {
    color: #28a745;
    margin-right: 8px;
}

.record-icon-lose {
    color: #dc3545;
    margin-right: 8px;
}

.record-icon-draw {
    color: #ffc107;
    margin-right: 8px;
}

.record-label {
    color: #666;
    flex: 1;
    text-align: left;
}

.record-value {
    color: var(--primary);
    font-weight: bold;
    font-size: 0.95rem;
}

.character-card.difficulty-beginner {
    border-left: 5px solid #28a745;
}

.character-card.difficulty-intermediate {
    border-left: 5px solid #ffc107;
}

.character-card.difficulty-advanced {
    border-left: 5px solid #dc3545;
}

.character-card.difficulty-balanced {
    border-left: 5px solid #17a2b8;
}

.character-card.difficulty-free {
    border-left: 5px solid #6c757d;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    position: relative;
    overflow: hidden;
}

.character-card.difficulty-free::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('/interactive/rockpaperscissors/players_selfies/circuitboard.png');
    background-size: cover;
    background-position: center;
    opacity: 0.5;
    z-index: 0;
}

.character-card.difficulty-free > * {
    position: relative;
    z-index: 1;
}

.character-card.difficulty-free .character-card-name,
.character-card.difficulty-free .character-card-title,
.character-card.difficulty-free .character-card-bio {
    text-shadow: -1px -1px 0 white, 1px -1px 0 white, -1px 1px 0 white, 1px 1px 0 white,
                 0 -1px 0 white, 0 1px 0 white, -1px 0 0 white, 1px 0 0 white;
}

.character-card.difficulty-free .character-difficulty-badge {
    position: absolute;
    z-index: 2;
}

.character-difficulty-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
}

.character-card {
    position: relative;
}

.character-card.difficulty-beginner .character-difficulty-badge {
    background: #28a745;
    color: white;
}

.character-card.difficulty-intermediate .character-difficulty-badge {
    background: #ffc107;
    color: #333;
}

.character-card.difficulty-advanced .character-difficulty-badge {
    background: #dc3545;
    color: white;
}

.character-card.difficulty-balanced .character-difficulty-badge {
    background: #17a2b8;
    color: white;
}

.character-card.difficulty-free .character-difficulty-badge {
    background: #6c757d;
    color: white;
}

/* Responsive for character modal */
@media (max-width: 768px) {
    .character-modal-content {
        padding: 20px;
        width: 95%;
    }

    .character-modal-content h2 {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }

    .character-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .character-card {
        padding: 15px;
    }

    .character-card-image {
        width: 120px;
        height: 120px;
    }

    .character-card-name {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .game-mode-toggle {
        flex-direction: column;
        align-items: center;
    }

    .mode-toggle-btn {
        width: 100%;
        max-width: 250px;
    }
}

/* Match Result Modal */
.match-result-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.match-result-modal-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    margin: 10% auto;
    padding: 40px;
    border: 4px solid var(--primary);
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    text-align: center;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    animation: slideIn 0.4s ease;
}

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

.match-result-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: bounce 0.6s ease 0.2s;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

.match-result-title {
    color: var(--primary);
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
    font-size: 2.5rem;
    margin-bottom: 15px;
    font-weight: bold;
}

.match-result-message {
    color: #555;
    font-size: 1.3rem;
    margin-bottom: 10px;
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
}

.match-result-score {
    color: var(--secondary);
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 30px;
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
}

.match-result-close-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 15px 40px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
}

.match-result-close-btn:hover {
    background: var(--secondary);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.match-result-close-btn:active {
    transform: translateY(-1px);
}

/* Responsive for match result modal */
@media (max-width: 768px) {
    .match-result-modal-content {
        padding: 30px 20px;
        width: 95%;
    }

    .match-result-icon {
        font-size: 4rem;
    }

    .match-result-title {
        font-size: 2rem;
    }

    .match-result-message {
        font-size: 1.1rem;
    }

    .match-result-score {
        font-size: 1.5rem;
    }

    .match-result-close-btn {
        padding: 12px 30px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .match-result-modal-content {
        padding: 25px 15px;
        margin: 15% auto;
    }

    .match-result-icon {
        font-size: 3.5rem;
        margin-bottom: 15px;
    }

    .match-result-title {
        font-size: 1.8rem;
        margin-bottom: 10px;
    }

    .match-result-message {
        font-size: 1rem;
        margin-bottom: 8px;
    }

    .match-result-score {
        font-size: 1.3rem;
        margin-bottom: 20px;
    }

    .match-result-close-btn {
        padding: 10px 25px;
        font-size: 0.95rem;
    }
}