* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0f172a;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    color: #e2e8f0;
}

.card {
    background: #1e293b;
    border-radius: 16px;
    padding: 48px 64px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    max-width: 420px;
    width: 100%;
}

.hidden {
    display: none !important;
}

.message {
    font-size: 1.25rem;
    margin: 0 0 16px;
}

.count {
    font-size: 1rem;
    color: #94a3b8;
    margin: 0 0 24px;
}

.spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 24px;
    border: 5px solid #334155;
    border-top-color: #38bdf8;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.character {
    font-size: 2.5rem;
    font-weight: 700;
    color: #38bdf8;
    margin: 0 0 32px;
    word-wrap: break-word;
}

.character-image-link {
    display: block;
    width: 180px;
    margin: 0 auto 20px;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.character-image-link:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.5);
}

.character-image {
    display: block;
    width: 180px;
    height: 180px;
    object-fit: cover;
    border-radius: 12px;
}

.character-description {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #94a3b8;
    margin: 0 0 24px;
    text-align: left;
}

.speaks-first {
    display: inline-block;
    margin: 0 auto 24px;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid #38bdf8;
    color: #38bdf8;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Logo / home page */

.logo {
    margin-bottom: 40px;
}

.logo-icon {
    font-size: 3.5rem;
    line-height: 1;
    margin-bottom: 8px;
}

.logo-text {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.version {
    color: #38bdf8;
    font-weight: 700;
}

.actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Buttons */

.btn {
    display: inline-block;
    border: none;
    border-radius: 10px;
    padding: 14px 20px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.1s ease, background 0.15s ease;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: #38bdf8;
    color: #0f172a;
}

.btn-primary:hover {
    background: #0ea5e9;
}

.btn-secondary {
    background: #334155;
    color: #e2e8f0;
}

.btn-secondary:hover {
    background: #475569;
}

.btn-category {
    background: #334155;
    color: #e2e8f0;
    padding: 20px;
}

.btn-category:hover {
    background: #38bdf8;
    color: #0f172a;
}

/* Category selection */

.category-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Join form */

#joinForm {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#codeInput {
    background: #0f172a;
    border: 2px solid #334155;
    border-radius: 10px;
    color: #e2e8f0;
    font-size: 1.25rem;
    letter-spacing: 0.1em;
    text-align: center;
    padding: 12px;
    font-family: inherit;
}

#codeInput:focus {
    outline: none;
    border-color: #38bdf8;
}

/* Room page */

.room-code {
    font-size: 1.1rem;
    letter-spacing: 0.08em;
    color: #38bdf8;
    font-weight: 700;
    margin: 0 0 8px;
}

.error {
    color: #f87171;
    font-size: 0.9rem;
    margin: 16px 0 0;
}

/* Admin page */

.admin-card {
    max-width: 640px;
    text-align: left;
    padding: 40px 48px;
}

.admin-card .message {
    text-align: center;
}

.admin-card .category-grid {
    margin-bottom: 28px;
}

.btn-category.active {
    background: #38bdf8;
    color: #0f172a;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #334155;
    text-align: left;
    font-size: 0.9rem;
}

.admin-table th {
    color: #94a3b8;
    font-weight: 600;
}

.admin-table tfoot td {
    border-bottom: none;
    padding-top: 14px;
}

.admin-table input {
    width: 100%;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 6px;
    color: #e2e8f0;
    padding: 8px;
    font-family: inherit;
    font-size: 0.9rem;
}

.admin-table input:focus {
    outline: none;
    border-color: #38bdf8;
}

.btn-delete,
.btn-add {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    font-weight: 700;
}

.btn-delete {
    background: #ef4444;
}

.btn-delete:hover {
    background: #dc2626;
}

.btn-add {
    background: #38bdf8;
    color: #0f172a;
}

.btn-add:hover {
    background: #0ea5e9;
}

/* DataTables dark theme */

.dataTables_wrapper {
    color: #e2e8f0;
    font-size: 0.85rem;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    color: #94a3b8;
    margin: 10px 0;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 6px;
    color: #e2e8f0;
    padding: 5px 8px;
    font-family: inherit;
    margin-left: 6px;
}

.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
    outline: none;
    border-color: #38bdf8;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    color: #e2e8f0 !important;
    border: 1px solid transparent !important;
    background: transparent !important;
    padding: 4px 10px;
    border-radius: 6px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #334155 !important;
    color: #e2e8f0 !important;
    border-color: #334155 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    color: #475569 !important;
}

table.dataTable thead th {
    color: #94a3b8;
}

table.dataTable tbody tr {
    background: transparent !important;
}

table.dataTable tbody tr:hover {
    background: #263449 !important;
}
