* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Hide Scrollbar Completely */
html {
    -ms-overflow-style: none;
    scrollbar-width: none;
    overflow: auto;
}

html::-webkit-scrollbar {
    display: none;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    overflow: auto;
    overflow-x: hidden;
    -ms-overflow-style: none;
    scrollbar-width: none;
    position: relative;
    -webkit-overflow-scrolling: touch;
    max-width: 100vw;
    box-sizing: border-box;
}

.dark-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(3px);
    pointer-events: none;
    z-index: 50;
}

body::-webkit-scrollbar {
    display: none;
}

* {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

*::-webkit-scrollbar {
    display: none;
}

/* Page Header */
.page-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 12px 30px;
    z-index: 10002;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    height: 60px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-logo-img {
    height: 55px;
    width: auto;
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.3)) brightness(0) invert(1);
    transform: translate(3px, 3.5px);
}

.header-title {
    font-size: 1.6em;
    font-weight: 800;
    color: white;
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.5px;
}

.header-nav {
    display: flex;
    gap: 10px;
    align-items: center;
}

.header-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.header-btn span {
    font-size: 1.2em;
}

.header-btn-primary {
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

.header-btn-primary:hover {
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.4);
}

.header-btn-success {
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

.header-btn-success:hover {
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.4);
}

.header-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.3em;
    line-height: 44px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    flex-shrink: 0;
    position: relative;
}

.header-icon-btn::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 30px;
    width: 1px;
    background: rgba(255, 255, 255, 0.15);
}

.header-icon-btn:hover {
    background: transparent;
    color: white;
}

.header-icon-btn:last-child::after {
    display: none;
}

#header-toggle-participants {
    filter: grayscale(1) brightness(3);
}

#header-toggle-chat {
    font-size: 1.15em;
    transform: translateY(2px);
    filter: grayscale(1) brightness(3);
}

#header-settings-btn {
    transform: translateY(2px);
    filter: grayscale(1) brightness(3);
    font-size: 1.1em;
}

#header-settings-btn::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 30px;
    width: 1px;
    background: rgba(255, 255, 255, 0.15);
}

.header-invite-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(74, 74, 94, 0.6);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: white;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateY(2px);
}

.header-invite-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.header-leave-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(220, 53, 69, 0.8);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 12px;
    position: relative;
    top: 2.5px;
}

.header-leave-btn:hover {
    background: rgba(220, 53, 69, 1);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.4);
}

.invite-link-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 12px;
}

.invite-link-container {
    display: flex;
    align-items: center;
    gap: 6px;
}

.invite-link-input {
    flex: 1;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    color: white;
    font-size: 0.8em;
    font-family: 'Courier New', monospace;
}

.invite-link-input:focus {
    outline: none;
    border-color: rgba(102, 126, 234, 0.5);
    background: rgba(255, 255, 255, 0.08);
}

.header-room-info {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.header-room-name {
    font-size: 1.1em;
    font-weight: 700;
    color: white;
    padding-left: 16px;
    margin-left: 16px;
    position: relative;
    transform: translateY(2px);
}

.header-room-name::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 30px;
    width: 1px;
    background: rgba(255, 255, 255, 0.2);
}

.header-room-code-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    margin-right: 16px;
    border-right: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

.header-room-code {
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.header-room-code strong {
    font-weight: 600;
    color: white;
    font-size: 1.05em;
    margin-left: 4px;
}

.header-btn-inline {
    padding: 4px 10px;
    font-size: 0.8em;
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.header-btn-inline:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

/* TEST - If you see this comment in browser dev tools, CSS is loading */

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    animation: backgroundFloat 20s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes backgroundFloat {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

/* Confetti Canvas */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* Particles */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    animation: float 15s infinite;
    opacity: 0.9;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
}

@keyframes float {
    0%, 100% { transform: translateY(0) translateX(0); }
    25% { transform: translateY(-100px) translateX(50px); }
    50% { transform: translateY(-200px) translateX(-50px); }
    75% { transform: translateY(-100px) translateX(50px); }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    backdrop-filter: blur(15px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: transparent;
    padding: 30px 40px 40px 40px;
    border-radius: 25px;
    max-width: 500px;
    width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    margin: 15px;
    box-sizing: border-box;
}

.modal-content h2 {
    color: white;
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.4em;
    font-weight: 700;
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.3);
}

.animate-in {
    animation: modalSlideIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.custom-deck-modal {
    max-width: 600px;
}

.preview-title {
    font-size: 1.2em;
    color: white;
    margin-bottom: 8px;
}

.preview-subtitle {
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 15px;
}

.deck-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 20px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 10px;
    border: 2px dashed rgba(102, 126, 234, 0.3);
    min-height: 80px;
    align-items: center;
    justify-content: center;
}

.preview-card {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: bold;
    min-width: 45px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    animation: cardPopIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes cardPopIn {
    from {
        opacity: 0;
        transform: scale(0);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 16px;
}

.modal-actions .btn {
    padding: 6px 16px;
    min-width: 80px;
    font-size: 0.9em;
}

/* Help modal styling */
.help-section {
    margin-bottom: 20px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.help-section h3 {
    font-size: 1.1em;
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.95);
}

.help-section:nth-child(3) h3 {
    filter: grayscale(0.4) brightness(0.9);
}

.help-section p {
    font-size: 0.95em;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    margin-bottom: 8px;
}

.help-section p:last-child {
    margin-bottom: 0;
}

.help-section strong {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 600;
}

.modal-section {
    margin-bottom: 15px;
    position: relative;
    overflow: visible;
}

.modal-section label {
    display: block;
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
    font-size: 0.95em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.modal-section input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    font-size: 1em;
    transition: all 0.3s;
    box-sizing: border-box;
    background: rgba(74, 74, 94, 0.6);
    backdrop-filter: blur(15px);
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 10px rgba(255, 255, 255, 0.1);
}

.modal-section input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.modal-section input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(255, 255, 255, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 15px rgba(255, 255, 255, 0.2);
}

/* Custom Select Dropdown */
.custom-select {
    position: relative;
    width: 100%;
    cursor: pointer;
    user-select: none;
}

.custom-select-trigger {
    padding: 14px 40px 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    background: rgba(74, 74, 94, 0.6);
    backdrop-filter: blur(15px);
    color: white;
    font-size: 1em;
    font-weight: 500;
    transition: all 0.3s;
    position: relative;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 10px rgba(255, 255, 255, 0.1);
}

.custom-select-trigger::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background-image: url('data:image/svg+xml;charset=UTF-8,%3csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3e%3cpolyline points="6 9 12 15 18 9"%3e%3c/polyline%3e%3c/svg%3e');
    background-size: contain;
    background-repeat: no-repeat;
    transition: transform 0.3s;
}

.custom-select.open .custom-select-trigger::after {
    transform: translateY(-50%) rotate(180deg);
}

.custom-select-trigger:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(255, 255, 255, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 15px rgba(255, 255, 255, 0.2);
}

.custom-options {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: rgba(74, 74, 94, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 25px rgba(255, 255, 255, 0.2);
    -webkit-overflow-scrolling: touch;
}

.custom-options::-webkit-scrollbar {
    width: 8px;
}

.custom-options::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.custom-options::-webkit-scrollbar-thumb {
    background: rgba(197, 163, 255, 0.5);
    border-radius: 10px;
}

.custom-options::-webkit-scrollbar-thumb:hover {
    background: rgba(197, 163, 255, 0.7);
}

.custom-select.open .custom-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-option {
    padding: 12px 16px;
    color: white;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
}

.custom-option:first-child {
    border-radius: 10px 10px 0 0;
}

.custom-option:last-child {
    border-radius: 0 0 10px 10px;
}

.custom-option:only-child {
    border-radius: 10px;
}

.custom-option:hover {
    background: rgba(197, 163, 255, 0.3);
}

.custom-option.selected {
    background: rgba(197, 163, 255, 0.2);
}

.advanced-toggle {
    text-align: center;
    margin: 15px 0;
}

.btn-link {
    background: none;
    border: none;
    color: white;
    font-size: 0.95em;
    cursor: pointer;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 5px;
    transition: all 0.3s;
}

.btn-link:hover {
    background: rgba(255, 255, 255, 0.15);
    text-decoration: underline;
}

.advanced-settings {
    margin: 20px 0;
    padding: 20px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 10px;
    border: 1px dashed #667eea;
    animation: advancedSlideIn 0.3s ease-out;
}

@keyframes advancedSlideIn {
    from {
        opacity: 0;
        max-height: 0;
        padding: 0 20px;
    }
    to {
        opacity: 1;
        max-height: 200px;
        padding: 20px;
    }
}

.advanced-settings {
    margin: 20px 0;
    padding: 25px;
    background: transparent;
    border-radius: 12px;
    animation: advancedSlideIn 0.3s ease-out;
}

@keyframes advancedSlideIn {
    from {
        opacity: 0;
        max-height: 0;
        padding: 0 25px;
    }
    to {
        opacity: 1;
        max-height: 600px;
        padding: 25px;
    }
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid rgba(197, 163, 255, 0.15);
    gap: 20px;
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-item .custom-select {
    min-width: 140px;
    max-width: 180px;
    flex-shrink: 0;
}

.setting-item .custom-select-trigger {
    padding: 10px 35px 10px 14px;
    font-size: 0.9em;
}

.setting-item .custom-select-trigger::after {
    right: 10px;
    width: 14px;
    height: 14px;
}

.setting-item .custom-option {
    padding: 10px 14px;
    font-size: 0.9em;
}

.setting-header {
    flex: 1;
    min-width: 0;
}

.setting-header label {
    display: block;
    font-weight: 700;
    color: white;
    margin-bottom: 5px;
    font-size: 1em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.setting-description {
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    line-height: 1.4;
    max-width: 100%;
    word-wrap: break-word;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    margin-left: 15px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #667eea;
}

input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.toggle-slider:hover {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.input-hint {
    display: block;
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 8px;
    font-style: italic;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
}

.divider {
    text-align: center;
    margin: 30px 0;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 700;
    position: relative;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
}

.divider::before { left: 0; }
.divider::after { right: 0; }

.btn-large {
    width: 100%;
    padding: 15px;
    font-size: 1.2em;
    margin-top: 10px;
}

.modal-toggle {
    text-align: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-link {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85em;
    cursor: pointer;
    padding: 6px 12px;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-link:hover {
    color: rgba(255, 255, 255, 0.95);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.container {
    max-width: 900px;
    width: 100%;
    margin: 62px auto 0;
    background: transparent;
    border-radius: 30px;
    padding: 5px 30px;
    position: relative;
    z-index: 200;
    box-sizing: border-box;
    animation: containerFadeIn 0.8s ease-out;
}

/* Disable animation when restoring session */
body[data-restoring="true"] .container {
    animation: none !important;
}

.container.no-animation {
    animation: none !important;
}

.container.sidebar-closed {
    padding-right: 20px !important;
}

@keyframes containerFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

header {
    text-align: center;
    margin-bottom: 50px;
    position: relative;
    padding-bottom: 30px;
    border-bottom: 2px solid rgba(102, 126, 234, 0.1);
}

header h1 {
    color: white;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    font-size: 3.5em;
    margin-bottom: 10px;
    font-weight: 800;
    letter-spacing: -1px;
}

.title-animate {
    animation: titleBounce 2s ease-in-out infinite;
}

@keyframes titleBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1em;
    margin-bottom: 20px;
    font-weight: 500;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.room-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
    margin-bottom: 20px;
    padding: 20px 30px;
    background: rgba(102, 126, 234, 0.08);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    border: 2px solid rgba(102, 126, 234, 0.25);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.room-name {
    font-size: 1.6em;
    font-weight: bold;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    padding: 12px 28px;
    border-radius: 30px;
    border: 2px solid rgba(102, 126, 234, 0.4);
    color: #667eea;
    margin-right: 10px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.room-code {
    font-size: 1.1em;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    padding: 10px 24px;
    border-radius: 25px;
    border: 2px solid rgba(102, 126, 234, 0.3);
    color: #333;
    backdrop-filter: blur(10px);
}

.room-code strong {
    color: #667eea;
    font-size: 1.3em;
    letter-spacing: 2px;
}

.btn-small {
    padding: 8px 15px;
    font-size: 0.9em;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

.game-section {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: 4px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px;
}

.story-info {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(15px);
    padding: 25px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    animation: slideRight 0.5s ease-out;
}

@keyframes slideRight {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.story-info label {
    display: block;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.story-info input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s;
}

.story-info input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: scale(1.02);
}

.players-section {
    background: transparent;
    padding: 2px;
    border-radius: 20px;
    animation: slideLeft 0.5s ease-out;
    display: flex;
    flex-direction: column;
    align-items: center;
}

@keyframes slideLeft {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.players-section h2 {
    display: none;
}

#player-count {
    color: #667eea;
    font-weight: bold;
}

.players-list {
    min-height: 240px;
    margin-top: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.players-controls {
    display: flex;
    justify-content: center;
    margin-top: 15px;
}

.players-controls .btn {
    padding: 10px 24px;
    font-size: 1em;
    font-weight: 700;
}

.players-table-view {
    position: relative;
    width: 100%;
    max-width: 650px;
    height: 320px;
    background: transparent;
    padding: 12px;
    margin: 0 auto;
}

.table-player-wrapper {
    position: absolute;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.table-player {
    position: relative;
    background: #4a4a5e;
    backdrop-filter: blur(10px);
    padding: 5px;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    text-align: center;
    min-width: 44px;
    max-width: 52px;
    transition: background 0.3s, box-shadow 0.3s, border 0.3s, opacity 0.3s;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.table-player::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0));
    border-radius: 10px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

@keyframes tablePlayerFloat {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.table-player:hover {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 12px 30px rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    z-index: 10;
}

.table-player.voted {
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.35) !important;
    backdrop-filter: blur(10px) !important;
    box-shadow: 0 15px 40px rgba(255, 255, 255, 0.4);
}

.table-player.voted::before {
    opacity: 1;
}

.table-player.revealed {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.2);
}

.player-avatar {
    font-size: 1.6em;
    font-weight: 900;
    color: white;
    margin-bottom: 4px;
    min-height: 1.6em;
    height: 1.6em;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

@keyframes avatarPulse {
    0%, 50% { transform: scale(0); }
    70% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.table-player.voted .player-avatar {
    color: white;
}

.table-player.revealed .player-avatar {
    color: white;
}

.player-label {
    font-size: 0.85em;
    font-weight: 700;
    color: white;
    white-space: nowrap;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    text-align: center;
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-you-badge {
    font-size: 0.7em;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 700;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Current user indicator */
.table-player.current-user {
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15),
                0 0 20px rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
}

.table-player.current-user:hover {
    border-color: rgba(255, 255, 255, 0.7);
    box-shadow: 0 12px 40px rgba(255, 255, 255, 0.35),
                0 0 30px rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.25);
}

/* Player remove button (host only) */
.player-remove-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff4757 0%, #ff6b81 100%);
    border: 2px solid rgba(255, 255, 255, 0.9);
    color: white;
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s ease;
    padding: 0;
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.3);
    opacity: 0;
    pointer-events: none;
}

.table-player-wrapper:hover .player-remove-btn {
    opacity: 1;
    pointer-events: auto;
}

.player-remove-btn:hover {
    background: linear-gradient(135deg, #ff3838 0%, #ff5252 100%);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.5);
}

.player-remove-btn:active {
    transform: scale(0.95);
}

.table-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(74, 74, 94, 0.6);
    backdrop-filter: blur(15px);
    padding: 10px 16px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    width: 280px;
    height: 110px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    transition: all 0.4s ease;
}

.table-center.all-voted {
    box-shadow: 0 8px 40px rgba(255, 255, 255, 0.35),
                0 0 60px rgba(255, 255, 255, 0.25),
                0 0 100px rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.2);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 8px 40px rgba(255, 255, 255, 0.3),
                    0 0 60px rgba(255, 255, 255, 0.25),
                    0 0 100px rgba(255, 255, 255, 0.15);
    }
    50% {
        box-shadow: 0 8px 40px rgba(255, 255, 255, 0.45),
                    0 0 60px rgba(255, 255, 255, 0.4),
                    0 0 100px rgba(255, 255, 255, 0.25);
    }
}

.table-center::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, 
        transparent 30%, 
        rgba(255, 255, 255, 0.1) 50%, 
        transparent 70%);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

@keyframes tableCenterPop {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.room-name-display {
    font-size: 1.8em;
    font-weight: 900;
    color: white;
    margin-bottom: 5px;
    text-transform: capitalize;
    position: relative;
    z-index: 1;
}

.room-code-display {
    font-size: 1.1em;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 10px;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.room-display {
    font-size: 1.5em;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 10px;
}

.players-count {
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 800;
    margin-bottom: 6px;
    position: relative;
    z-index: 1;
}

.btn-table-reveal {
    margin-top: 6px;
    padding: 12px 24px !important;
    font-size: 0.85em !important;
    font-weight: 700;
    line-height: 1.2;
    color: white;
    background: rgba(255, 255, 255, 0.35) !important;
    backdrop-filter: blur(15px) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 20px rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 12px !important;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-table-reveal:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(255, 255, 255, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 35px rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.3);
}

.table-consensus-badge {
    margin-top: 20px;
    padding: 20px 30px;
    border-radius: 15px;
    text-align: center;
    animation: badgePopIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes badgePopIn {
    from {
        opacity: 0;
        transform: scale(0) rotate(-180deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

.table-consensus-badge.consensus-perfect {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border: 3px solid #28a745;
}

.table-consensus-badge.consensus-good {
    background: linear-gradient(135deg, #d1ecf1, #bee5eb);
    border: 3px solid #17a2b8;
}

.table-consensus-badge.consensus-discuss {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border: 3px solid #ffc107;
}

.table-consensus-badge.consensus-sync {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    border: 3px solid #dc3545;
}

.table-badge-emoji {
    font-size: 3em;
    margin-bottom: 10px;
    animation: emojiSpin 1s ease-out;
}

@keyframes emojiSpin {
    from { transform: rotate(-360deg) scale(0); }
    to { transform: rotate(0) scale(1); }
}

.table-badge-title {
    font-size: 1.5em;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

.table-badge-message {
    font-size: 1em;
    color: #666;
    font-weight: 500;
}

/* Table Stats Display */
.table-stats-display {
    margin-top: 6px;
    padding: 8px;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea15, #764ba215);
    border: 1px solid #667eea;
    animation: statsSlideIn 0.6s ease-out;
}

@keyframes statsSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stats-row {
    display: flex;
    justify-content: space-around;
    gap: 6px;
    margin-bottom: 5px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4px 10px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-label {
    font-size: 0.7em;
    color: #666;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
}

.stat-value {
    font-size: 1.3em;
    font-weight: bold;
    color: #667eea;
    text-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.consensus-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 6px;
    font-weight: 600;
    animation: consensusPulse 0.8s ease-out;
}

@keyframes consensusPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.consensus-indicator.consensus-perfect {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border: 2px solid #28a745;
    color: #155724;
}

.consensus-indicator.consensus-good {
    background: linear-gradient(135deg, #d1ecf1, #bee5eb);
    border: 2px solid #17a2b8;
    color: #0c5460;
}

.consensus-indicator.consensus-discuss {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border: 2px solid #ffc107;
    color: #856404;
}

.consensus-indicator.consensus-sync {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    border: 2px solid #dc3545;
    color: #721c24;
}

.consensus-emoji {
    font-size: 1.2em;
    animation: emojiFloat 2s ease-in-out infinite;
}

@keyframes emojiFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.consensus-text {
    font-size: 0.8em;
}

.mini-consensus-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 25px;
    margin-top: 10px;
    font-weight: bold;
    animation: badgeBounce 0.6s ease-out;
}

@keyframes badgeBounce {
    0%, 60%, 100% { transform: scale(1); }
    30% { transform: scale(1.15); }
}

.mini-consensus-badge.consensus-perfect {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border: 2px solid #28a745;
    color: #28a745;
}

.mini-consensus-badge.consensus-good {
    background: linear-gradient(135deg, #d1ecf1, #bee5eb);
    border: 2px solid #17a2b8;
    color: #17a2b8;
}

.mini-consensus-badge.consensus-discuss {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border: 2px solid #ffc107;
    color: #f57c00;
}

.mini-consensus-badge.consensus-sync {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    border: 2px solid #dc3545;
    color: #dc3545;
}

.mini-badge-emoji {
    font-size: 1.5em;
}

.mini-badge-text {
    font-size: 1.1em;
}

.player-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    backdrop-filter: blur(10px);
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    animation: playerCardPop 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

@keyframes playerCardPop {
    from {
        opacity: 0;
        transform: scale(0.8) rotate(-5deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

.player-card:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.3) 100%);
    border-color: rgba(255, 255, 255, 0.4);
}

.player-card.voted {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
}

.player-card.revealed {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.2);
}

.player-info {
    flex: 1;
}

.player-name {
    font-weight: bold;
    color: white;
    margin-bottom: 3px;
    font-size: 0.8em;
}

.player-vote {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9em;
}

.player-vote.voted {
    color: white;
    font-weight: bold;
    animation: votePulse 1s ease-in-out infinite;
}

@keyframes votePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.player-vote.revealed {
    font-size: 1.3em;
    color: white;
    font-weight: bold;
    animation: revealPop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes revealPop {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.cards-section {
    text-align: center;
    animation: fadeInUp 0.6s ease-out;
    background: transparent;
    padding: 0px;
    border-radius: 20px;
    margin-top: 20px;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cards-section h2 {
    color: white;
    margin-bottom: 8px;
    margin-top: 0;
    font-weight: 800;
    font-size: 0.95em;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.cards-container {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 4px;
    perspective: 1000px;
}

.card {
    width: 40px;
    height: 62px;
    background: rgba(74, 74, 94, 0.6);
    backdrop-filter: blur(15px);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4em;
    font-weight: 900;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    user-select: none;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0));
    border-radius: 12px;
    opacity: 0;
    transition: opacity 0.3s;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(255, 255, 255, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.card:hover::before {
    opacity: 1;
}

.card:active {
    transform: translateY(-6px);
}

.card.selected {
    background: rgba(255, 255, 255, 0.35);
    color: white;
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-4px);
    box-shadow: 0 15px 40px rgba(255, 255, 255, 0.4);
    animation: none;
}

.card.selected::before {
    opacity: 1;
}

.selected-value {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 8px;
    border-radius: 12px;
    margin-top: 6px;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.selected-value p {
    font-size: 0.9em;
    color: #333;
}

#current-selection {
    font-weight: bold;
    color: #667eea;
    font-size: 1.4em;
    animation: selectionGlow 2s ease-in-out infinite;
}

@keyframes selectionGlow {
    0%, 100% { text-shadow: 0 0 10px rgba(102, 126, 234, 0.5); }
    50% { text-shadow: 0 0 20px rgba(102, 126, 234, 0.8); }
}

.controls {
    display: none;
}

.btn {
    padding: 16px 36px;
    font-size: 1.1em;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 700;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    text-transform: none;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: rgba(74, 74, 94, 0.6) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: blur(15px) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 10px rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(255, 255, 255, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 20px rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3) !important;
}

.btn-success {
    background: rgba(74, 74, 94, 0.6) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: blur(15px) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 10px rgba(255, 255, 255, 0.1);
}

.btn-success:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(255, 255, 255, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 20px rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3) !important;
}

.btn-pulse {
    animation: buttonPulse 2s ease-in-out infinite;
}

@keyframes buttonPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
    }
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.16) !important;
    color: white !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    backdrop-filter: blur(10px) !important;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.15);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6) !important;
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c82333, #bd2130);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(220, 53, 69, 0.4);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.results-section {
    background: transparent;
    backdrop-filter: none;
    padding: 5px 15px;
    margin-top: 10px;
    border-radius: 0;
    border: none;
    box-shadow: none;
    display: none;
    animation: resultsSlideIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes resultsSlideIn {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.results-section.show {
    display: block;
}

.results-stats {
    margin-bottom: 5px;
}

.stats-summary {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
    margin-top: 15px;
}

.stat-box {
    background: rgba(74, 74, 94, 0.75);
    backdrop-filter: blur(15px);
    padding: 10px 16px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    min-width: 100px;
    transition: all 0.3s ease;
    cursor: default;
}

.stat-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(255, 255, 255, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.stat-box .stat-label {
    font-size: 0.75em;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.stat-box .stat-value {
    font-size: 1.3em;
    font-weight: bold;
    color: white;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 255, 255, 0.3);
}

.stat-box-highlight {
    background: rgba(255, 255, 255, 0.25) !important;
    border: 2px solid rgba(255, 255, 255, 0.4) !important;
}

.stat-box-highlight .stat-label {
    color: white !important;
}

.stat-value-large {
    /* No size override - use default stat-value size */
}

.consensus-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: badgeBounce 0.6s ease-out;
}

.consensus-emoji {
    font-size: 1.5em;
    line-height: 1;
    margin-bottom: 5px;
}

.consensus-text {
    font-size: 0.75em;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.reset-btn-badge {
    cursor: pointer;
}

.reset-btn-badge:active {
    transform: translateY(-2px) scale(0.98);
}

@keyframes badgeBounce {
    0%, 60%, 100% { transform: scale(1); }
    30% { transform: scale(1.15); }
}

#results-content {
    position: relative;
    margin-bottom: 0;
}

.table-view {
    position: relative;
    width: 100%;
    height: 500px;
    background: radial-gradient(circle, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 20px;
    box-shadow: inset 0 4px 20px rgba(0, 0, 0, 0.1);
}

.table-player-card {
    position: absolute;
    background: white;
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-align: center;
    min-width: 100px;
    animation: playerCardFloat 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    animation-fill-mode: backwards;
    transition: all 0.3s;
}

@keyframes playerCardFloat {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.3);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.table-player-card:hover {
    transform: translate(-50%, -50%) scale(1.1) !important;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
    z-index: 10;
}

.player-vote-display {
    font-size: 2.5em;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 8px;
    animation: votePopIn 0.5s ease-out;
}

@keyframes votePopIn {
    0%, 50% { transform: scale(0); }
    70% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.player-name-display {
    font-size: 1em;
    font-weight: 600;
    color: #333;
    text-transform: capitalize;
}

.center-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 40px 50px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    animation: badgePop 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.3s;
    animation-fill-mode: backwards;
    z-index: 5;
    min-width: 300px;
}

@keyframes badgePop {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0) rotate(-180deg);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1) rotate(0);
    }
}

.center-badge.perfect {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border: 3px solid #28a745;
    box-shadow: 0 8px 30px rgba(40, 167, 69, 0.4), 0 0 40px rgba(40, 167, 69, 0.2);
}

.center-badge.good {
    background: linear-gradient(135deg, #d1ecf1, #bee5eb);
    border: 3px solid #17a2b8;
    box-shadow: 0 8px 30px rgba(23, 162, 184, 0.4), 0 0 40px rgba(23, 162, 184, 0.2);
}

.center-badge.discuss {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border: 3px solid #ffc107;
    box-shadow: 0 8px 30px rgba(255, 193, 7, 0.4), 0 0 40px rgba(255, 193, 7, 0.2);
}

.center-badge.sync {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    border: 3px solid #dc3545;
    box-shadow: 0 8px 30px rgba(220, 53, 69, 0.4), 0 0 40px rgba(220, 53, 69, 0.2);
}

.badge-emoji {
    font-size: 4em;
    margin-bottom: 15px;
    animation: badgeEmojiSpin 1s ease-out 0.5s;
}

@keyframes badgeEmojiSpin {
    from { transform: rotate(-360deg) scale(0); }
    to { transform: rotate(0) scale(1); }
}

.badge-title {
    font-size: 2em;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    animation: badgeTextSlide 0.6s ease-out 0.7s;
    animation-fill-mode: backwards;
}

@keyframes badgeTextSlide {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.badge-message {
    font-size: 1.1em;
    color: #666;
    font-weight: 500;
    animation: badgeTextSlide 0.6s ease-out 0.9s;
    animation-fill-mode: backwards;
}

.result-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: all 0.3s;
    animation: resultCardFlip 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    animation-fill-mode: backwards;
}

@keyframes resultCardFlip {
    from {
        opacity: 0;
        transform: rotateY(-90deg) scale(0.8);
    }
    to {
        opacity: 1;
        transform: rotateY(0) scale(1);
    }
}

.result-card:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.result-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 12px;
    font-size: 1.3em;
    text-transform: capitalize;
}

.result-value {
    font-size: 2.2em;
    color: #667eea;
    font-weight: bold;
    animation: numberSpin 0.8s ease-out;
}

@keyframes numberSpin {
    from {
        transform: scale(0) rotate(360deg);
        opacity: 0;
    }
    to {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}

#statistics {
    background: transparent;
    padding: 0;
    border-radius: 0;
    margin-top: 0;
    box-shadow: none;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
    animation: statCardPop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    animation-fill-mode: backwards;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 160px;
}

@keyframes statCardPop {
    from {
        opacity: 0;
        transform: scale(0.5) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.15s; }
.stat-card:nth-child(3) { animation-delay: 0.2s; }
.stat-card:nth-child(4) { animation-delay: 0.25s; }
.stat-card:nth-child(5) { animation-delay: 0.3s; }
.stat-card:nth-child(6) { animation-delay: 0.35s; }

.stat-card:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.stat-card.consensus {
    border: 2px solid;
}

.stat-card.consensus.good {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border-color: #28a745;
}

.stat-card.consensus.needs-discussion {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border-color: #ffc107;
}

.stat-icon {
    font-size: 2em;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.3;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-value {
    font-size: 3em;
    color: #667eea;
    font-weight: bold;
    animation: statValueBounce 0.6s ease-out;
    margin-top: auto;
}

.stat-value.large {
    font-size: 3em;
}

@keyframes statValueBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.vote-distribution {
    margin-top: 40px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 15px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    cursor: default;
}

.vote-distribution:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    border-color: rgba(255, 255, 255, 0.3);
}

.vote-distribution h3 {
    font-size: 1em;
    margin-bottom: 10px;
    color: #fff;
    text-align: center;
}

.distribution-chart {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chart-row {
    display: flex;
    align-items: center;
    gap: 15px;
    animation: chartRowSlide 0.5s ease-out;
    animation-fill-mode: backwards;
}

@keyframes chartRowSlide {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.chart-label {
    font-size: 1.3em;
    font-weight: bold;
    color: white;
    min-width: 40px;
    text-align: center;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.4), rgba(118, 75, 162, 0.4));
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.chart-bar-container {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
    height: 40px;
    position: relative;
}

.chart-bar {
    height: 100%;
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.6), rgba(118, 75, 162, 0.6));
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    padding: 0 15px;
    transition: width 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
    animation: barGrow 0.8s ease-out;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

@keyframes barGrow {
    from {
        width: 0 !important;
    }
}

.chart-count {
    color: white;
    font-weight: 700;
    font-size: 0.9em;
    white-space: nowrap;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.no-numeric-votes {
    text-align: center;
    padding: 40px;
    color: white;
    font-size: 1.2em;
}

.result-card.numeric-vote .result-value {
    color: #667eea;
}

.result-card.special-vote .result-value {
    color: #764ba2;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    animation: statSlideIn 0.5s ease-out;
    animation-fill-mode: backwards;
}

@keyframes statSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.stat-row:nth-child(1) { animation-delay: 0.1s; }
.stat-row:nth-child(2) { animation-delay: 0.2s; }
.stat-row:nth-child(3) { animation-delay: 0.3s; }
.stat-row:nth-child(4) { animation-delay: 0.4s; }
.stat-row:nth-child(5) { animation-delay: 0.5s; }

.stat-label {
    font-weight: bold;
    color: #333;
    font-size: 1.1em;
}

.stat-value {
    color: #667eea;
    font-weight: bold;
    font-size: 1.2em;
}

/* Notification Toast */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: toastSlideIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 10001;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(400px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.table-center-message {
    font-size: 1.1em;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

/* Tablet landscape and small desktop */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding: 15px;
        max-width: 100%;
        margin: 80px auto 0;
        margin-right: auto;
    }
    
    .page-header {
        padding: 12px 20px;
    }
    
    header h1 {
        font-size: 1.8em;
    }
    
    /* Voting table for tablets */
    .voting-table {
        width: 90% !important;
        height: 450px !important;
        padding: 20px !important;
    }
    
    .table-player {
        width: 70px !important;
        height: 70px !important;
        font-size: 0.9em !important;
        min-width: 70px !important;
        max-width: 70px !important;
    }
    
    .table-player-name {
        font-size: 0.75em !important;
        max-width: 70px !important;
    }
    
    .player-vote-card {
        width: 40px !important;
        height: 55px !important;
        font-size: 1.4em !important;
    }
    
    .table-center-box {
        width: 130px !important;
        height: 130px !important;
        font-size: 0.95em !important;
    }
    
    .btn-table-reveal {
        padding: 14px 20px !important;
        font-size: 0.9em !important;
    }
    
    /* Estimate cards for tablets */
    .cards-container {
        gap: 12px;
        padding: 15px;
    }
    
    .card {
        width: 65px !important;
        height: 95px !important;
        font-size: 1.6em !important;
    }
    
    .card.special {
        font-size: 2.2em !important;
    }
    
    .teams-sidebar {
        width: 340px;
    }
    
    .modal-content {
        max-width: 500px;
        width: 90%;
        padding: 30px;
    }
    
    .stats-summary {
        gap: 10px !important;
    }
    
    .stat-box {
        padding: 16px 22px !important;
        min-width: 110px !important;
    }
    
    .stat-box .stat-label {
        font-size: 0.8em !important;
    }
    
    .stat-box .stat-value {
        font-size: 1.6em !important;
    }
}

@media (max-width: 768px) {
    * {
        box-sizing: border-box;
    }
    
    body {
        padding: 0 !important;
    }
    
    html, body {
        overflow-x: hidden !important;
        overflow-y: auto;
        width: 100% !important;
        max-width: 100vw !important;
        margin: 0;
        padding: 0;
        -webkit-overflow-scrolling: touch;
    }
    
    .container {
        padding: 8px;
        padding-right: 8px !important;
        margin: 0 auto;
        margin-top: 110px;
        margin-right: auto !important;
        max-width: 100vw;
        width: 100%;
        box-sizing: border-box;
    }
    
    .page-header {
        padding: 8px 12px;
        width: 100%;
        box-sizing: border-box;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        overflow-x: hidden;
        overflow-y: visible;
        min-height: 100px;
        height: auto;
        z-index: 10002;
    }

    header h1 {
        font-size: clamp(1.1em, 4vw, 1.3em);
        margin-bottom: 6px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .header-content {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
        width: 100%;
        overflow: hidden;
    }
    
    .header-logo {
        max-width: 100%;
        overflow: hidden;
    }
    
    .header-actions {
        width: 100%;
        display: flex;
        justify-content: flex-start;
        gap: 6px;
        flex-wrap: wrap;
        overflow: visible;
    }
    
    .header-actions .btn,
    .header-invite-btn,
    .header-leave-btn {
        padding: 8px 12px;
        font-size: 0.8em;
        flex-shrink: 0;
        white-space: nowrap;
        height: auto;
        min-height: 36px;
    }
    
    .header-icon-btn {
        width: 40px;
        height: 36px;
        font-size: 1.2em;
        flex-shrink: 0;
    }
    
    .header-icon-btn::after {
        display: none;
    }

    .room-info {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
        font-size: 0.8em;
        width: 100%;
        margin-top: 4px;
    }
    
    .room-info span {
        white-space: nowrap;
    }
    
    /* Voting table mobile layout */
    .voting-table {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: clamp(250px, 50vh, 350px) !important;
        padding: 10px !important;
        box-sizing: border-box;
        margin: 10px auto;
    }
    
    .table-player {
        width: clamp(45px, 12vw, 60px) !important;
        height: clamp(45px, 12vw, 60px) !important;
        font-size: clamp(0.7em, 2vw, 0.85em) !important;
        min-width: auto !important;
        max-width: none !important;
    }
    
    .table-player-name {
        font-size: clamp(0.6em, 1.8vw, 0.75em) !important;
        max-width: clamp(45px, 12vw, 60px) !important;
    }
    
    .player-vote-card {
        width: clamp(30px, 8vw, 40px) !important;
        height: clamp(45px, 12vw, 60px) !important;
        font-size: clamp(1em, 3vw, 1.3em) !important;
    }
    
    .table-center-box {
        width: clamp(80px, 20vw, 120px) !important;
        height: clamp(80px, 20vw, 120px) !important;
        font-size: clamp(0.7em, 2vw, 0.9em) !important;
    }
    
    .btn-table-reveal {
        padding: clamp(8px, 2vw, 12px) clamp(12px, 3vw, 16px) !important;
        font-size: clamp(0.75em, 2vw, 0.9em) !important;
    }

    .cards-container {
        gap: 6px;
        padding: 8px;
        overflow-x: visible;
        flex-wrap: wrap;
        width: 100%;
        box-sizing: border-box;
        justify-content: center;
    }

    .card {
        min-width: clamp(50px, 13vw, 60px) !important;
        width: clamp(50px, 13vw, 60px) !important;
        height: clamp(70px, 18vw, 90px) !important;
        font-size: clamp(1.2em, 3.5vw, 1.5em) !important;
        flex-shrink: 0;
    }
    
    .card.special {
        font-size: clamp(1.6em, 4.5vw, 2em) !important;
    }

    .controls {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    .btn {
        width: 100%;
        padding: 10px;
        font-size: clamp(0.85em, 2.5vw, 1em);
    }
    
    /* Modal adjustments */
    .modal-content {
        padding: 20px;
        margin: 15px;
        max-width: calc(100vw - 30px) !important;
        width: calc(100vw - 30px);
        max-height: 85vh;
        overflow-y: auto;
        box-sizing: border-box;
    }
    
    .modal-content h2 {
        font-size: clamp(1.2em, 4vw, 1.5em);
    }
    
    .help-section {
        padding: 10px;
    }
    
    .help-section h3 {
        font-size: clamp(0.95em, 3vw, 1.1em);
    }
    
    .help-section p {
        font-size: clamp(0.85em, 2.5vw, 0.95em);
    }
    
    /* Settings modal */
    .settings-section {
        padding: 10px;
    }
    
    .setting-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    /* Results section */
    .results-section {
        padding: 12px !important;
        width: 100% !important;
        box-sizing: border-box;
    }
    
    .stats-summary {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        width: 100% !important;
        margin-top: 0 !important;
    }
    
    .stat-box {
        padding: 15px !important;
        min-width: auto !important;
        width: 100% !important;
        box-sizing: border-box;
    }
    
    .stat-box .stat-label {
        font-size: clamp(0.75em, 2.2vw, 0.85em) !important;
        margin-bottom: 8px !important;
    }
    
    .stat-box .stat-value {
        font-size: clamp(1.4em, 4vw, 1.8em) !important;
    }
    
    .stat-value-large {
        font-size: clamp(1.5em, 4.5vw, 2em);
    }

    .toast {
        right: 10px;
        left: 10px;
        bottom: 20px;
        max-width: calc(100vw - 20px);
        font-size: clamp(0.85em, 2.5vw, 0.95em);
    }
    
    /* Sidebar mobile behavior */
    .teams-sidebar {
        width: 100%;
        max-width: none;
        top: 100px;
        transform: translateX(100%);
        z-index: 100;
    }
    
    .chat-panel {
        width: 100% !important;
        max-width: 100vw !important;
        right: 0 !important;
        top: 100px !important;
        transform: translateX(100%);
        z-index: 100 !important;
    }
    
    .chat-panel.active {
        transform: translateX(0);
    }
    
    .teams-sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar-toggle {
        display: flex !important;
    }
    
    .participants-list {
        max-height: calc(100vh - 200px);
    }
    
    /* Chat messages mobile */
    .chat-messages {
        padding: 8px;
    }
    
    .chat-message {
        max-width: 85%;
    }
    
    .chat-message-content {
        padding: 8px 10px;
        font-size: clamp(0.85em, 2.5vw, 0.95em);
    }
    
    .chat-input-container {
        padding: 8px;
    }
    
    .chat-input {
        font-size: clamp(0.9em, 2.5vw, 1em);
    }
    
    .player-remove-btn {
        width: 18px;
        height: 18px;
        font-size: 0.75em;
    }
}

/* Extra small phones */
@media (max-width: 480px) {
    .container {
        margin-top: 140px;
        padding: 8px;
        padding-right: 8px !important;
        max-width: 100%;
    }
    
    .page-header {
        padding: 8px 10px;
        min-height: 110px;
        overflow-x: hidden;
        overflow-y: visible;
    }
    
    header h1 {
        font-size: 1.1em;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
    
    .header-actions .btn {
        padding: 6px 8px;
        font-size: 0.75em;
    }
    
    /* Voting elements for extra small phones */
    .voting-table {
        min-height: 220px !important;
        padding: 8px !important;
        width: 95% !important;
    }
    
    .table-player {
        width: 45px !important;
        height: 45px !important;
        font-size: 0.7em !important;
        min-width: 45px !important;
        max-width: 45px !important;
    }
    
    .table-player-name {
        font-size: 0.6em !important;
        max-width: 45px !important;
    }
    
    .player-vote-card {
        width: 28px !important;
        height: 42px !important;
        font-size: 0.95em !important;
    }
    
    .table-center-box {
        width: 70px !important;
        height: 70px !important;
        font-size: 0.7em !important;
    }
    
    .btn-table-reveal {
        padding: 8px 12px !important;
        font-size: 0.75em !important;
    }
    
    /* Estimate cards for extra small phones */
    .card {
        min-width: 45px !important;
        width: 45px !important;
        height: 65px !important;
        font-size: 1.1em !important;
    }
    
    .card.special {
        font-size: 1.5em !important;
    }
    
    /* Results section for small phones */
    .stats-summary {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        width: 100% !important;
    }
    
    .stat-box {
        padding: 14px !important;
        width: 100% !important;
        min-width: auto !important;
    }
    
    .stat-box .stat-label {
        font-size: 0.7em !important;
        margin-bottom: 6px !important;
    }
    
    .stat-box .stat-value {
        font-size: 1.4em !important;
    }
}

/* Countdown animation */
@keyframes countdownPulse {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Chat Panel Styles */
.chat-panel {
    position: fixed;
    right: 0;
    top: 60px;
    bottom: 0;
    width: 380px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
    box-shadow: -2px 0 15px rgba(0, 0, 0, 0.3);
    transform: translateX(0);
}

/* Teams-style sidebar tabs */
.sidebar-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    padding: 0;
}

.sidebar-tab {
    flex: 1;
    padding: 16px 20px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    position: relative;
}

.sidebar-tab:hover {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.9);
}

.sidebar-tab.active {
    color: white;
    border-bottom-color: rgba(102, 126, 234, 1);
    background: rgba(255, 255, 255, 0.03);
}

/* Apply white filter to people icon in sidebar */
.sidebar-tab[data-tab="people"] {
    filter: grayscale(1) brightness(3);
}

.sidebar-tab .tab-badge {
    display: inline-block;
    min-width: 20px;
    height: 20px;
    line-height: 20px;
    padding: 0 6px;
    background: rgba(74, 74, 94, 0.6);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 6px;
    vertical-align: middle;
}

.sidebar-content {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.sidebar-content.active {
    display: flex;
}

.chat-panel:not(.active) {
    transform: translateX(100%);
}

/* Adjust container padding when right sidebar is closed */
.container.sidebar-closed {
    padding-right: 20px;
}

/* Participants Panel - Right sidebar (same as chat) */
.participants-panel {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 380px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    z-index: 100;
    box-shadow: -2px 0 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
    transform: translateX(100%);
}

.participants-panel.active {
    transform: translateX(0);
}

.participants-header {
    display: none;
}

.participants-header h3 {
    margin: 0;
    font-size: 16px;
    color: white;
    font-weight: 600;
}

.participants-count {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}

.participants-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    position: relative;
    z-index: 2;
}

.participant-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    margin-bottom: 8px;
    background: rgba(74, 74, 94, 0.6);
    backdrop-filter: blur(15px);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.participant-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(255, 255, 255, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.participant-item.current-user-item {
    background: rgba(74, 74, 94, 0.6);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.participant-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.participant-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(74, 74, 94, 0.6);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: white;
}

.participant-name {
    color: white;
    font-size: 14px;
    font-weight: 500;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.participant-status {
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-badge {
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    background: rgba(74, 74, 94, 0.6);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.status-badge.voted {
    color: rgba(255, 255, 255, 0.9);
}

.status-badge.pending {
    color: rgba(255, 255, 255, 0.9);
}

.status-badge.unread-badge {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(15px);
    color: white;
    min-width: 18px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.status-badge.host {
    color: rgba(255, 255, 255, 0.9);
    margin-right: 5px;
}

.chat-panel.minimized {
    max-height: 60px;
}

.chat-panel.minimized .chat-messages,
.chat-panel.minimized .chat-input-area {
    display: none;
}

.chat-header {
    display: none;
}

.chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: white;
    line-height: 1;
    display: flex;
    align-items: center;
}

.chat-toggle-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: all 0.2s;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chat-back-btn {
    background: rgba(74, 74, 94, 0.6);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    color: white;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    margin-right: 12px;
}

.chat-back-btn:hover {
    background: rgba(94, 94, 114, 0.7);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    padding: 16px 20px;
    background: rgba(74, 74, 94, 0.4);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.chat-header h3 {
    margin: 0;
    flex: 1;
    font-size: 16px;
    white-space: nowrap;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
    gap: 10px;
}

.chat-message {
    display: flex;
    flex-direction: column;
    gap: 4px;
    animation: messageSlideIn 0.3s ease;
    max-width: 75%;
    align-self: flex-start;
}

/* Own messages aligned to right */
.chat-message.own-message {
    align-self: flex-end;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    flex-wrap: wrap;
}

.chat-message-sender {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
}

.private-indicator {
    font-size: 11px;
    color: rgba(255, 215, 0, 0.9);
    font-weight: 500;
    padding: 2px 6px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 4px;
}

.chat-message-time {
    color: rgba(255, 255, 255, 0.4);
    margin-left: auto;
}

.chat-message-content {
    background: rgba(74, 74, 94, 0.6);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    padding: 10px 14px;
    border-radius: 16px 16px 16px 4px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    word-wrap: break-word;
}

/* Own message styling - different color and border radius */
.chat-message.own-message .chat-message-content {
    background: rgba(102, 126, 234, 0.5);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(102, 126, 234, 0.3);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border-radius: 16px 16px 4px 16px;
}

.chat-message.emoji-message .chat-message-content {
    background: transparent;
    border: none;
    font-size: 32px;
    padding: 4px 12px;
}

.chat-input-area {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
}

.chat-input-container {
    display: flex;
    gap: 8px;
    position: relative;
    z-index: 2;
}

#chat-input {
    flex: 1;
    background: rgba(74, 74, 94, 0.6);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 10px 14px;
    color: white;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

#chat-input:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(102, 126, 234, 0.5);
}

#chat-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.chat-send-btn {
    background: rgba(74, 74, 94, 0.6);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 10px 18px;
    color: white;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.chat-send-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.chat-send-btn:active {
    transform: translateY(0);
}

/* Player clickable styling */
.player-clickable {
    cursor: pointer;
    transition: all 0.3s ease;
}

.player-clickable:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.6);
}

/* Emoji Reaction Picker */
.emoji-reaction-picker {
    display: flex;
    gap: 8px;
    padding: 4px;
    z-index: 10000;
    animation: fadeInUp 0.2s ease;
}

.emoji-reaction-btn {
    background: none;
    border: none;
    width: 30px;
    height: 30px;
    font-size: 22px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.emoji-reaction-btn:hover {
    transform: scale(1.3);
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.6));
}

/* Player Reaction Badge - Shows on player tile */
.player-reaction-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 32px;
    z-index: 100;
    animation: reactionBadgeAnim 3s ease-out forwards;
    pointer-events: none;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.8));
}

@keyframes reactionBadgeAnim {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(10px);
    }
    10% {
        opacity: 1;
        transform: scale(1.3) translateY(0);
    }
    20% {
        transform: scale(1) translateY(0);
    }
    80% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    100% {
        opacity: 0;
        transform: scale(0.8) translateY(-5px);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Player Reactions Display */
.player-reactions {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    padding: 4px 8px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: reactionPop 0.3s ease;
    white-space: nowrap;
}

.reaction-emoji {
    font-size: 16px;
    animation: emojiPop 0.4s ease;
}

@keyframes reactionPop {
    0% {
        opacity: 0;
        transform: translateX(-50%) scale(0.5);
    }
    50% {
        transform: translateX(-50%) scale(1.1);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
}

.table-player-wrapper {
    position: relative;
}

/* Mobile responsiveness for chat */
/* Floating chat open button */
.chat-open-fab {
    position: fixed;
    right: 20px;
    bottom: 30px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.5);
    z-index: 150;
    transition: all 0.3s ease;
    opacity: 0;
    pointer-events: none;
}

.chat-open-fab.visible {
    opacity: 1;
    pointer-events: all;
}

.chat-open-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(102, 126, 234, 0.7);
}

.chat-open-fab:active {
    transform: scale(0.95);
}
