* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #fff;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

#stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 50%, rgba(231, 76, 60, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(52, 152, 219, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(46, 204, 113, 0.1) 0%, transparent 50%);
    animation: backgroundShift 20s ease infinite;
    z-index: -1;
}

@keyframes backgroundShift {

    0%,
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.05) rotate(1deg);
    }
}

.back-button {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: rgba(231, 76, 60, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(231, 76, 60, 0.4);
    border-radius: 50px;
    text-decoration: none;
    color: #e74c3c;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.back-button:hover {
    transform: translateX(-5px) scale(1.05);
    background: rgba(231, 76, 60, 0.3);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.5);
}

.back-icon {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.back-button:hover .back-icon {
    transform: translateX(-3px);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

header {
    text-align: center;
    padding: 90px 40px 40px;
    animation: fadeInDown 0.8s ease;
}

.header-content {
    position: relative;
}

.header-content h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #e74c3c 0%, #3498db 50%, #2ecc71 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 4px 20px rgba(231, 76, 60, 0.3));
    letter-spacing: 1px;
}

.report-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    margin-top: 15px;
    background: rgba(231, 76, 60, 0.2);
    border: 2px solid rgba(231, 76, 60, 0.4);
    border-radius: 25px;
    color: #e74c3c;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.report-button:hover {
    background: rgba(231, 76, 60, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.5);
}

.report-icon {
    font-size: 1.2rem;
}

.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 2px solid rgba(231, 76, 60, 0.4);
    padding: 0;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 2px solid rgba(231, 76, 60, 0.3);
    background: rgba(231, 76, 60, 0.1);
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #e74c3c;
    margin: 0;
}

.close-modal {
    background: none;
    border: none;
    color: #e74c3c;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    transform: rotate(90deg);
    color: #c0392b;
}

#reportForm {
    padding: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
}

.form-group input[type="text"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(52, 152, 219, 0.3);
    border-radius: 10px;
    color: #fff;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%233498db' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}

.form-group select option {
    background: #1a1a2e;
    color: #fff;
    padding: 10px;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: rgba(52, 152, 219, 0.6);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.3);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group input[type="file"] {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px dashed rgba(52, 152, 219, 0.3);
    border-radius: 10px;
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-group input[type="file"]:hover {
    border-color: rgba(52, 152, 219, 0.5);
    background: rgba(255, 255, 255, 0.08);
}

.file-info {
    display: block;
    margin-top: 5px;
    font-size: 0.8rem;
    color: #9ca3af;
    font-style: italic;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 25px;
}

.btn-cancel,
.btn-submit {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cancel {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.btn-submit {
    background: rgba(231, 76, 60, 0.3);
    color: #e74c3c;
    border: 2px solid rgba(231, 76, 60, 0.5);
}

.btn-submit:hover {
    background: rgba(231, 76, 60, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
}

.btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.report-status {
    margin-top: 15px;
    padding: 12px 15px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    display: none;
}

.report-status.success {
    display: block;
    background: rgba(46, 204, 113, 0.2);
    border: 2px solid rgba(46, 204, 113, 0.5);
    color: #2ecc71;
}

.report-status.error {
    display: block;
    background: rgba(231, 76, 60, 0.2);
    border: 2px solid rgba(231, 76, 60, 0.5);
    color: #e74c3c;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 400;
    margin-bottom: 8px;
}

.tagline {
    font-size: 0.9rem;
    opacity: 0.7;
    font-weight: 300;
}

.stats-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(17, 24, 39, 0.6);
    backdrop-filter: blur(10px);
    padding: 15px 20px;
    border-radius: 15px;
    border: 2px solid rgba(231, 76, 60, 0.3);
    transition: all 0.4s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    animation: fadeInUp 0.8s ease;
    position: relative;
    flex-wrap: wrap;
}

.stat-card:nth-child(1) {
    animation-delay: 0.1s;
}

.stat-card:nth-child(2) {
    animation-delay: 0.2s;
}

.stat-card:nth-child(3) {
    animation-delay: 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(52, 152, 219, 0.4);
    border-color: rgba(52, 152, 219, 0.5);
}

.stat-icon {
    font-size: 2rem;
    filter: drop-shadow(0 0 10px rgba(255, 223, 0, 0.5));
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: #3498db;
    line-height: 1;
}

.stat-label {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-top: 4px;
    color: #9ca3af;
}

.easter-egg {
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    animation: easterEggBounce 0.6s ease;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.easter-egg-67 {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    color: #fff;
    border: 2px solid rgba(155, 89, 182, 0.8);
    animation: easterEggBounce 0.6s ease, pulse67 2s ease-in-out infinite;
}

.easter-egg-69 {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: #fff;
    border: 2px solid rgba(231, 76, 60, 0.8);
    animation: easterEggBounce 0.6s ease, wiggle 1s ease-in-out infinite;
}

.easter-egg-100 {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: #fff;
    border: 2px solid rgba(243, 156, 18, 0.8);
    animation: easterEggBounce 0.6s ease, celebrate 1s ease-in-out infinite;
    font-size: 0.9rem;
}

@keyframes easterEggBounce {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(20px) scale(0.5);
    }

    50% {
        transform: translateX(-50%) translateY(-5px) scale(1.1);
    }

    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

@keyframes pulse67 {

    0%,
    100% {
        box-shadow: 0 4px 15px rgba(155, 89, 182, 0.5);
    }

    50% {
        box-shadow: 0 4px 25px rgba(155, 89, 182, 0.8), 0 0 30px rgba(155, 89, 182, 0.4);
    }
}

@keyframes wiggle {

    0%,
    100% {
        transform: translateX(-50%) rotate(0deg);
    }

    25% {
        transform: translateX(-50%) rotate(-3deg);
    }

    75% {
        transform: translateX(-50%) rotate(3deg);
    }
}

@keyframes celebrate {

    0%,
    100% {
        transform: translateX(-50%) scale(1);
        box-shadow: 0 4px 15px rgba(243, 156, 18, 0.5);
    }

    50% {
        transform: translateX(-50%) scale(1.1);
        box-shadow: 0 4px 30px rgba(243, 156, 18, 0.8), 0 0 40px rgba(243, 156, 18, 0.6);
    }
}

body.celebrating {
    animation: celebrateShake 0.5s ease-in-out 0s 3;
}

body.celebrating .room-card {
    animation: fadeInScale 0.6s ease forwards, celebrateBounce 0.8s ease-in-out infinite !important;
}

body.celebrating .stat-card {
    animation: fadeInUp 0.8s ease, celebrateBounce 0.8s ease-in-out infinite !important;
}

.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    top: -10px;
    z-index: 9999;
    animation: confettiFall linear forwards;
    border-radius: 2px;
    opacity: 0.9;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

@keyframes celebrateShake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

@keyframes celebrateBounce {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-10px) scale(1.02);
    }
}

.hand-67 {
    position: absolute;
    width: 60px;
    height: 60px;
    z-index: 100;
    object-fit: contain;
}

.hand-left {
    left: -70px;
    top: 50%;
    animation: handBounceLeft67 0.27s ease-in-out infinite;
}

.hand-right {
    right: -70px;
    top: 50%;
    animation: handBounceRight67 0.27s ease-in-out infinite;
    transform: scaleX(-1);
}

@keyframes handBounceLeft67 {

    0%,
    100% {
        transform: translateY(-50%) translateY(0);
    }

    50% {
        transform: translateY(-50%) translateY(-15px);
    }
}

@keyframes handBounceRight67 {

    0%,
    100% {
        transform: translateY(-50%) translateY(-15px) scaleX(-1);
    }

    50% {
        transform: translateY(-50%) translateY(0) scaleX(-1);
    }
}

.filter-container {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    animation: fadeInUp 0.8s ease 0.4s both;
}

.filter-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background: rgba(17, 24, 39, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    border: 2px solid rgba(52, 152, 219, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.filter-toggle:hover {
    background: rgba(17, 24, 39, 0.8);
    border-color: rgba(52, 152, 219, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.3);
}

.filter-toggle input[type="checkbox"] {
    appearance: none;
    width: 50px;
    height: 26px;
    background: rgba(231, 76, 60, 0.3);
    border: 2px solid rgba(231, 76, 60, 0.5);
    border-radius: 13px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.filter-toggle input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #e74c3c;
    top: 2px;
    left: 2px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.filter-toggle input[type="checkbox"]:checked {
    background: rgba(46, 204, 113, 0.3);
    border-color: rgba(46, 204, 113, 0.5);
}

.filter-toggle input[type="checkbox"]:checked::before {
    background: #2ecc71;
    transform: translateX(24px);
}

.filter-label {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}

.loading {
    text-align: center;
    padding: 80px 20px;
    animation: fadeIn 0.5s ease;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(52, 152, 219, 0.2);
    border-top-color: #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loading p {
    font-size: 1.2rem;
    opacity: 0.8;
}

.error {
    text-align: center;
    padding: 60px 40px;
    background: rgba(255, 59, 48, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    border: 2px solid rgba(255, 59, 48, 0.4);
    margin: 40px 20px;
    animation: fadeIn 0.5s ease;
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.error p {
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.retry-button {
    padding: 12px 30px;
    background: rgba(255, 107, 107, 0.3);
    border: 2px solid rgba(255, 107, 107, 0.5);
    border-radius: 25px;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-button:hover {
    background: rgba(255, 107, 107, 0.5);
    transform: scale(1.05);
}

.rooms-section {
    padding: 20px;
    animation: fadeInUp 1s ease 0.3s both;
}

.rooms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 20px;
    align-items: stretch;
}

.room-card {
    background: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 0;
    border: 1px solid rgba(231, 76, 60, 0.3);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    opacity: 0;
    animation: fadeInScale 0.6s ease forwards;
    height: fit-content;
}

.room-card:nth-child(1) {
    animation-delay: 0.1s;
}

.room-card:nth-child(2) {
    animation-delay: 0.2s;
}

.room-card:nth-child(3) {
    animation-delay: 0.3s;
}

.room-card:nth-child(4) {
    animation-delay: 0.4s;
}

.room-card:nth-child(5) {
    animation-delay: 0.5s;
}

.room-card:nth-child(6) {
    animation-delay: 0.6s;
}

.room-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
    border-color: rgba(52, 152, 219, 0.5);
}

.room-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: rgba(231, 76, 60, 0.15);
    border-bottom: 1px solid rgba(231, 76, 60, 0.3);
    gap: 10px;
}

.room-title-section {
    flex: 1;
}

.room-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0;
}

.room-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.lobby-type {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lobby-public {
    background: rgba(46, 204, 113, 0.2);
    border: 1px solid rgba(46, 204, 113, 0.5);
    color: #2ecc71;
}

.lobby-private {
    background: rgba(155, 89, 182, 0.2);
    border: 1px solid rgba(155, 89, 182, 0.5);
    color: #9b59b6;
}

.time-active {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(52, 152, 219, 0.2);
    border: 1px solid rgba(52, 152, 219, 0.4);
    color: #3498db;
}

.room-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.room-id {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.3) 0%, rgba(52, 152, 219, 0.3) 100%);
    border: 1px solid rgba(231, 76, 60, 0.5);
    color: #e74c3c;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    box-shadow: 0 2px 10px rgba(231, 76, 60, 0.3);
}

.player-count {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    background: rgba(52, 152, 219, 0.2);
    border: 1px solid rgba(52, 152, 219, 0.4);
    color: #3498db;
}

.player-count.status-full {
    background: rgba(231, 76, 60, 0.3);
    border: 1px solid rgba(231, 76, 60, 0.5);
    color: #e74c3c;
    animation: pulse 2s ease-in-out infinite;
}

.player-count.status-almost-full {
    background: rgba(243, 156, 18, 0.3);
    border: 1px solid rgba(243, 156, 18, 0.5);
    color: #f39c12;
}

.joinable-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.joinable-status.joinable {
    background: rgba(46, 204, 113, 0.3);
    border: 1px solid rgba(46, 204, 113, 0.5);
    color: #2ecc71;
}

.joinable-status.not-joinable {
    background: rgba(231, 76, 60, 0.3);
    border: 1px solid rgba(231, 76, 60, 0.5);
    color: #e74c3c;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.joinable .status-dot {
    background: #2ecc71;
    box-shadow: 0 0 8px #2ecc71;
    animation: pulse-green 2s ease-in-out infinite;
}

.not-joinable .status-dot {
    background: #e74c3c;
    box-shadow: 0 0 8px #e74c3c;
}

.race-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.race-status.voting {
    background: rgba(155, 89, 182, 0.3);
    border: 1px solid rgba(155, 89, 182, 0.5);
    color: #9b59b6;
    animation: pulse-voting 2s ease-in-out infinite;
}

.race-status.racing {
    background: rgba(243, 156, 18, 0.3);
    border: 1px solid rgba(243, 156, 18, 0.5);
    color: #f39c12;
}

@keyframes pulse-voting {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(155, 89, 182, 0.7);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(155, 89, 182, 0);
    }
}

@keyframes pulse-green {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(231, 76, 60, 0);
    }
}

.players-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(52, 152, 219, 0.1);
    border-top: 1px solid rgba(52, 152, 219, 0.2);
    border-bottom: 1px solid rgba(52, 152, 219, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.players-toggle:hover {
    background: rgba(52, 152, 219, 0.2);
}

.toggle-icon {
    font-size: 0.9rem;
    transition: transform 0.3s ease;
    color: #3498db;
}

.toggle-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: #3498db;
}

.players-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    opacity: 1;
}

.players-list.collapsed {
    max-height: 0;
    opacity: 0;
}

.player-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 20px;
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}

.player-item:last-child {
    border-bottom: none;
}

.player-item:hover {
    background: rgba(52, 152, 219, 0.1);
}

.mii-image {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: rgba(17, 24, 39, 0.8);
    border: 2px solid rgba(231, 76, 60, 0.3);
    object-fit: cover;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.player-item:hover .mii-image {
    border-color: rgba(52, 152, 219, 0.6);
}

.player-info {
    flex: 1;
    min-width: 0;
}

.player-name {
    font-family: 'CTMKF', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-stats {
    display: flex;
    gap: 16px;
    font-size: 0.85rem;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-label-small {
    color: #9ca3af;
    font-weight: 500;
}

.stat-value-small {
    color: #e0e0e0;
    font-weight: 600;
}

.fc-code {
    font-family: 'Courier New', monospace;
    background: rgba(52, 152, 219, 0.15);
    border: 1px solid rgba(52, 152, 219, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #5dade2;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: default;
}

.fc-code.openhost {
    background: rgba(46, 204, 113, 0.2);
    border: 1px solid rgba(46, 204, 113, 0.5);
    color: #2ecc71;
    text-decoration: underline;
    text-decoration-style: wavy;
    text-decoration-color: rgba(46, 204, 113, 0.6);
    cursor: help;
}

.fc-code.openhost:hover {
    background: rgba(46, 204, 113, 0.3);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.4);
}

.fc-stat {
    position: relative;
}

.openhost-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(46, 204, 113, 0.95);
    color: #fff;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(46, 204, 113, 0.8);
}

.openhost-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(46, 204, 113, 0.95);
}

.openhost-tooltip.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

@media (hover: hover) {
    .fc-code.openhost:hover + .openhost-tooltip {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }
}

.no-rooms {
    text-align: center;
    padding: 80px 20px;
    font-size: 1.3rem;
    opacity: 0.7;
    background: rgba(17, 24, 39, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    border: 2px solid rgba(231, 76, 60, 0.3);
    margin: 40px 20px;
}

footer {
    text-align: center;
    padding: 40px 20px 30px;
    margin-top: 40px;
    border-top: 2px solid rgba(231, 76, 60, 0.2);
    animation: fadeIn 1s ease 0.5s both;
}

footer p {
    margin: 8px 0;
    font-size: 1rem;
}

footer a {
    color: #3498db;
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 1px solid transparent;
}

footer a:hover {
    color: #5dade2;
    border-bottom-color: #5dade2;
}

.footer-note {
    font-size: 0.9rem;
    opacity: 0.7;
    font-style: italic;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@font-face {
    font-family: 'CTMKF';
    src: url('ctmkf.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@media (max-width: 768px) {
    .back-button {
        top: 15px;
        left: 15px;
        padding: 10px 16px;
        font-size: 1rem;
    }

    .back-text {
        display: none;
    }

    .back-icon {
        font-size: 1.8rem;
    }

    header {
        padding: 80px 20px 40px;
    }

    .header-content h1 {
        font-size: 2.5rem;
    }

    .subtitle {
        font-size: 1.2rem;
    }

    .tagline {
        font-size: 0.9rem;
    }

    .report-button {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .modal-header {
        padding: 15px 20px;
    }

    .modal-header h2 {
        font-size: 1.3rem;
    }

    #reportForm {
        padding: 20px;
    }

    .form-actions {
        flex-direction: column;
    }

    .stats-container {
        flex-direction: column;
        gap: 15px;
    }

    .stat-card {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    .rooms-grid {
        grid-template-columns: 1fr;
    }

    .player-stats {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .mii-image {
        width: 60px;
        height: 60px;
    }
}