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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: radial-gradient(circle at 30% 70%, #230a2a 0%, #06040a 50%, #000 100%);
    min-height: 100vh;
    padding: 20px;
    color: #efeefe;
}

.navbar {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    padding: 15px 30px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar h2 {
    color: #a8a9ff;
    margin: 0;
}

.nav-buttons {
    display: flex;
    gap: 10px;
}

.nav-buttons button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.nav-buttons button.active {
    background: #667eea;
    color: white;
}

.nav-buttons button:not(.active) {
    background: rgba(255, 255, 255, 0.05);
    color: #a8a9ff;
}

.nav-buttons button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
}

.nav-back-btn {
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: #a8a9ff;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-block;
}

.nav-back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.panel {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.panel.active {
    display: block;
}

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

.card {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

h1, h2, h3 {
    color: #cfcfd0;
    margin-bottom: 20px;
    text-align: center;
}

h1 {
    font-size: 36px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h2 {
    font-size: 24px;
}

h3 {
    font-size: 18px;
    margin-top: 25px;
    border-bottom: 2px solid rgba(168, 169, 255, 0.3);
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #a8a9ff;
    font-weight: 600;
}

input, select, textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.05);
    color: #efeefe;
    transition: border-color 0.3s;
}

input::placeholder, select [disabled] option {
    color: rgba(239, 238, 254, 0.5);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #a8a9ff;
}

button {
    padding: 12px 28px;
    background: rgba(168, 169, 255, 0.15);
    color: #a8a9ff;
    border: 1px solid rgba(168, 169, 255, 0.3);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

button:hover {
    transform: translateY(-2px);
    background: rgba(168, 169, 255, 0.25);
    border-color: rgba(168, 169, 255, 0.5);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.button-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.button-group button {
    flex: 1;
    min-width: 150px;
}

.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-success {
    background: rgba(76, 175, 80, 0.1);
    color: #a8e6a8;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.alert-error {
    background: rgba(244, 67, 54, 0.1);
    color: #ff9999;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.alert-info {
    background: rgba(33, 150, 243, 0.1);
    color: #64b5f6;
    border: 1px solid rgba(33, 150, 243, 0.3);
}

.alert-warning {
    background: rgba(255, 152, 0, 0.1);
    color: #ffcc99;
    border: 1px solid rgba(255, 152, 0, 0.3);
}

.game-header {
    background: rgba(168, 169, 255, 0.1);
    color: #f6f5ff;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 30px;
    border: 1px solid rgba(168, 169, 255, 0.2);
}

.game-header h1 {
    color: #f6f5ff;
    -webkit-text-fill-color: unset;
    margin-bottom: 10px;
}

.game-header p {
    font-size: 16px;
    opacity: 0.7;
    color: #a8a9ff;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.game-item {
    background: rgba(255, 255, 255, 0.02);
    border: 2px solid rgba(168, 169, 255, 0.15);
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s;
    cursor: pointer;
}

.game-item:hover {
    border-color: rgba(168, 169, 255, 0.4);
    transform: translateY(-5px);
}

.game-item h4 {
    color: #a8a9ff;
    margin-bottom: 10px;
    font-size: 16px;
}

.game-item p {
    color: #a8a9ff;
    opacity: 0.7;
    font-size: 14px;
    margin-bottom: 8px;
}

.player-list {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.player-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(168, 169, 255, 0.1);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.player-item.voted-out {
    opacity: 0.5;
    background: rgba(255, 100, 100, 0.05);
}

.player-name {
    font-weight: 600;
    color: rgba(225, 225, 247, 0.747);
    text-transform: capitalize;
}

.player-status {
    font-size: 12px;
    color: #a8a9ff;
    opacity: 0.8;
}

.topic-display {
    background: rgba(168, 169, 255, 0.1);
    color: #f6f5ff;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    margin: 30px 0;
    font-size: 24px;
    font-weight: bold;
    border: 1px solid rgba(168, 169, 255, 0.2);
}

.game-phase {
    text-align: center;
    padding: 15px;
    background: rgba(168, 169, 255, 0.08);
    color: #a8a9ff;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 600;
    border: 1px solid rgba(168, 169, 255, 0.15);
}

.timer {
    text-align: center;
    font-size: 36px;
    font-weight: bold;
    color: #a8a9ff;
    margin: 20px 0;
    font-family: 'Courier New', monospace;
}

.voting-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin: 20px 0;
}

.voting-buttons button {
    padding: 12px;
    font-size: 12px;
}

.result-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.result-table th, .result-table td {
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px;
    text-align: left;
    color: #efeefe;
}

.result-table th {
    background: rgba(168, 169, 255, 0.08);
    font-weight: 600;
    color: #a8a9ff;
}

.result-table tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.loading {
    text-align: center;
    padding: 40px;
    color: #a8a9ff;
    opacity: 0.6;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid #a8a9ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .two-column {
        grid-template-columns: 1fr;
    }
    
    .games-grid {
        grid-template-columns: 1fr;
    }
    
    .navbar {
        flex-direction: column;
        gap: 15px;
        padding: 12px 20px;
    }
    
    .navbar h2 {
        font-size: 18px;
        letter-spacing: 1px;
    }
    
    .nav-buttons a {
        font-size: 14px;
        padding: 6px 12px;
    }
    
    .card {
        padding: 20px;
        border-radius: 10px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    h2 {
        font-size: 20px;
    }
    
    h3 {
        font-size: 16px;
    }
    
    .game-header {
        padding: 20px;
    }
    
    .game-header h1 {
        font-size: 24px;
    }
    
    .option-buttons {
        flex-direction: column;
        gap: 12px;
    }
    
    .option-btn {
        flex-direction: column;
        padding: 20px;
        min-height: 80px;
    }
    
    .option-icon {
        font-size: 32px;
    }
    
    .option-label {
        font-size: 16px;
    }
    
    .game-form {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .form-title {
        font-size: 16px;
    }
    
    .button-group-form {
        flex-direction: column;
    }
    
    .button-group-form button {
        width: 100%;
        margin-bottom: 10px;
        min-height: 44px;
    }
    
    .button-group-form button:last-child {
        margin-bottom: 0;
    }
    
    .timer {
        font-size: 28px;
    }
    
    .voting-buttons {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
    
    .voting-buttons button {
        padding: 10px;
        font-size: 11px;
        min-height: 44px;
    }
    
    .topic-display {
        font-size: 18px;
        padding: 20px;
    }
    
    table {
        font-size: 12px;
    }
    
    .session-info {
        padding: 15px;
        margin: 15px 0;
    }
    
    .session-info p {
        font-size: 13px;
        margin-bottom: 8px;
    }
    
    .player-item {
        font-size: 13px;
        padding: 10px;
        min-height: 44px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 8px;
        background: radial-gradient(circle at 30% 70%, #230a2a 0%, #06040a 50%, #000 100%);
    }
    
    .card {
        padding: 15px;
        border-radius: 8px;
    }
    
    .navbar {
        padding: 10px 15px;
    }
    
    .navbar h2 {
        font-size: 18px;
        letter-spacing: 1px;
    }
    
    h1 {
        font-size: 22px;
        letter-spacing: 1px;
    }
    
    h2 {
        font-size: 18px;
    }
    
    h3 {
        font-size: 14px;
    }
    
    .game-header {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .game-header h1 {
        font-size: 22px;
        letter-spacing: 1px;
    }
    
    .welcome-section {
        margin-bottom: 25px;
    }
    
    .welcome-section h2 {
        font-size: 18px;
        margin-bottom: 0;
        letter-spacing: 1px;
    }
    
    .option-buttons {
        flex-direction: column;
        gap: 12px;
    }
    
    .option-btn {
        padding: 18px;
        min-height: 60px;
        gap: 10px;
        border: 1px solid rgba(168, 169, 255, 0.3);
    }
    
    .option-icon {
        font-size: 28px;
    }
    
    .option-label {
        font-size: 16px;
    }
    
    .game-form {
        padding: 12px;
        margin-bottom: 20px;
    }
    
    .form-title {
        font-size: 15px;
        margin-bottom: 15px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    input, select {
        font-size: 13px;
        padding: 10px;
        min-height: 44px;
    }
    
    .btn-primary, .btn-secondary {
        font-size: 13px;
        padding: 10px 20px;
        min-height: 44px;
    }
    
    button {
        min-height: 44px;
    }
    
    .timer {
        font-size: 28px;
        margin: 15px 0;
    }
    
    .voting-buttons {
        gap: 8px;
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    }
    
    .voting-buttons button {
        padding: 10px;
        font-size: 11px;
        min-height: 44px;
    }
    
    .topic-display {
        font-size: 18px;
        padding: 20px;
        margin: 20px 0;
    }
    
    table {
        font-size: 12px;
    }
    
    .session-info {
        padding: 12px;
        margin: 15px 0;
    }
    
    .session-info p {
        font-size: 13px;
        margin-bottom: 8px;
    }
    
    .player-item {
        font-size: 13px;
        padding: 10px;
        min-height: 44px;
        align-items: center;
    }
    
    .result-table th, .result-table td {
        padding: 8px;
        font-size: 12px;
    }
}

/* Responsive Initial Screen */
.welcome-section {
    text-align: center;
    margin-bottom: 30px;
}

.welcome-section h2 {
    margin-bottom: 8px;
}

.welcome-section p {
    color: #999;
    font-size: 15px;
}

.option-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.option-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 25px;
    background: rgba(168, 169, 255, 0.1);
    color: #a8a9ff;
    border: 1px solid rgba(168, 169, 255, 0.3);
    border-radius: 12px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    min-height: 150px;
}

.option-btn:hover {
    transform: translateY(-5px);
    background: rgba(168, 169, 255, 0.15);
    border-color: rgba(168, 169, 255, 0.5);
}

.option-icon {
    font-size: 36px;
}

.option-label {
    font-size: 18px;
    font-weight: bold;
}

.option-desc {
    font-size: 13px;
    opacity: 0.9;
}

.game-form {
    display: block;
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    border: 1px solid rgba(168, 169, 255, 0.15);
    animation: slideDown 0.3s ease-out;
}

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

.form-title {
    font-size: 18px;
    color: #a8a9ff;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(168, 169, 255, 0.3);
}

.button-group-form {
    display: flex;
    gap: 12px;
    margin-top: 15px;
}

.btn-primary {
    flex: 1;
    background: rgba(168, 169, 255, 0.15);
    color: #a8a9ff;
    border: 1px solid rgba(168, 169, 255, 0.3);
}

.btn-secondary {
    flex: 1;
    background: rgba(200, 100, 100, 0.1);
    color: #ff9999;
    border: 1px solid rgba(200, 100, 100, 0.3);
}

.btn-primary:hover,
.btn-secondary:hover {
    transform: translateY(-2px);
}

/* Large screens */
@media (min-width: 1024px) {
    .option-buttons {
        gap: 20px;
    }
    
    .option-btn {
        min-height: 140px;
        padding: 30px;
    }
    
    .card {
        padding: 35px;
    }
}

.session-info {
    background: rgba(168, 169, 255, 0.08);
    border: 2px solid rgba(168, 169, 255, 0.2);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.session-info strong {
    color: #a8a9ff;
}

/* Hide secondary text and descriptions */
.welcome-section p,
.game-header p,
.option-desc,
.option-btn .option-desc {
    display: none;
}

/* Minimal footer/help text opacity */
p {
    color: #a8a9ff;
    opacity: 0.6;
}

#game-code-display {
    font-size: 16px;
    font-weight: 700;
    color: rgb(233, 246, 138);
}

#game-category-display {
    text-transform: capitalize; 
    font-size: 16px;
    font-weight: 700;
    color: rgb(233, 246, 138);
}

.session-inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap; /* important for mobile */
}

.session-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}