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

html, body {
    min-height: 100%;
    background: #0a0a0a;
    font-family: 'Segoe UI', system-ui, sans-serif;
    color: #fff;
}

.container {
    max-width: 700px;
    margin: 0 auto;
    padding: 40px 20px;
}

h1 {
    font-size: 48px;
    font-weight: 900;
    letter-spacing: 6px;
    text-align: center;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #0f3460, #e94560, #16c79a, #f5a623);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 40px;
    font-size: 16px;
}

.card {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}

.card h2 {
    font-size: 20px;
    margin-bottom: 16px;
    color: #ccc;
}

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

.form-group label {
    display: block;
    font-size: 14px;
    color: #888;
    margin-bottom: 6px;
}

.form-group select,
.form-group input {
    width: 100%;
    padding: 10px 14px;
    background: #222;
    border: 1px solid #333;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
}

.form-group select:focus,
.form-group input:focus {
    outline: none;
    border-color: #0f3460;
}

.create-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.create-row .btn {
    width: auto;
    white-space: nowrap;
    padding: 10px 24px;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    background: #0f3460;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    text-align: center;
}

.btn:hover {
    background: #1a4a80;
}

.btn-start {
    background: #16c79a;
    font-size: 16px;
    padding: 12px 24px;
}

.btn-start:hover {
    background: #1ad4a7;
}

/* Game table */
.game-table {
    width: 100%;
    border-collapse: collapse;
    background: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
}

.game-table thead th {
    background: #222;
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    color: #888;
    letter-spacing: 1px;
}

.game-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid #222;
    font-size: 14px;
}

.game-table tbody tr:last-child td {
    border-bottom: none;
}

.game-code {
    font-family: monospace;
    font-size: 18px;
    letter-spacing: 2px;
    cursor: pointer;
    color: #4a8aff;
}

.game-code:hover {
    text-decoration: underline;
}

.state-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.state-badge.lobby { background: #1a3a1a; color: #4a4; }
.state-badge.playing { background: #1a1a3a; color: #44a; }
.state-badge.paused { background: #3a3a1a; color: #aa4; }
.state-badge.ended { background: #3a1a1a; color: #a44; }

.actions {
    white-space: nowrap;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: #fff;
    background: #0f3460;
    margin-right: 4px;
}

.btn-sm:hover { background: #1a4a80; }
.btn-sm.btn-start { background: #16c79a; }
.btn-sm.btn-start:hover { background: #1ad4a7; }
.btn-sm.btn-danger { background: #a44; }
.btn-sm.btn-danger:hover { background: #c44; }

.no-token {
    font-size: 12px;
    color: #555;
    font-style: italic;
}

.detail-row .detail-cell {
    padding: 8px 16px 16px;
    background: #151515;
}

.detail-links {
    font-size: 13px;
    color: #888;
}

.detail-links a {
    color: #4a8aff;
    text-decoration: none;
    word-break: break-all;
}

.detail-links a:hover {
    text-decoration: underline;
}

.detail-links div {
    margin-bottom: 4px;
}

#message {
    text-align: center;
    padding: 12px;
    margin-bottom: 16px;
    border-radius: 8px;
    display: none;
}

#message.error { display: block; background: #3a1a1a; color: #e94560; }
#message.success { display: block; background: #1a3a1a; color: #16c79a; }
