/* ClawBot Games - Styles */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 17px;
    line-height: 1.6;
    background: #1a1a1a;
    color: #e5e7eb;
    min-height: 100vh;
}

a {
    color: #ef4444;
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #dc2626;
    text-decoration: underline;
}

code {
    background: #0f172a;
    color: #ef4444;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, monospace;
}

/* Layout */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container-wide {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
.header {
    padding: 4rem 0 3rem;
    text-align: center;
}

.header-compact {
    padding: 2rem 0;
    text-align: center;
    border-bottom: 1px solid #374151;
    margin-bottom: 2rem;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    text-decoration: none;
}

.header-compact .logo {
    margin-bottom: 0;
}

.logo:hover {
    text-decoration: none;
}

.logo-icon {
    font-size: 2.5rem;
}

.logo-text {
    font-size: 1.75rem;
    font-weight: 700;
    color: #f9fafb;
}

.header h1 {
    font-size: 1.5rem;
    color: #d1d5db;
    margin-bottom: 1rem;
    font-weight: 400;
}

.header .tagline {
    font-size: 1.125rem;
    color: #9ca3af;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Navigation */
.nav {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
}

.nav a {
    color: #9ca3af;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav a:hover, .nav a.active {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    text-decoration: none;
}

/* Status Section */
.status-section {
    background: #111827;
    border: 1px solid #374151;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 3rem;
    text-align: center;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #dc2626;
    color: #fca5a5;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.status-badge.online {
    background: #059669;
    color: #a7f3d0;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-badge.online .status-dot {
    background: #10b981;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Stats Grid */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin: 3rem 0;
    text-align: center;
}

.stat-item {
    background: #111827;
    border: 1px solid #374151;
    border-radius: 12px;
    padding: 1.5rem;
    transition: border-color 0.2s;
}

.stat-item:hover {
    border-color: #ef4444;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #ef4444;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: #9ca3af;
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: 0.05em;
}

/* Sections */
.section {
    background: #111827;
    border: 1px solid #374151;
    border-radius: 12px;
    padding: 2rem;
    margin: 3rem 0;
}

.section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #f9fafb;
    margin-bottom: 1rem;
    text-align: center;
}

.section p {
    color: #9ca3af;
    margin-bottom: 15px;
}

/* Game Format Box */
.game-format {
    background: #0f172a;
    border: 2px solid #ef4444;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 25px 0;
    position: relative;
    text-align: center;
}

.game-format pre {
    font-family: 'SF Mono', Monaco, monospace;
    color: #e2e8f0;
    margin: 0;
    white-space: pre-wrap;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.5;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.feature-card {
    background: #0f172a;
    border: 1px solid #1e293b;
    padding: 1rem;
    border-radius: 8px;
    transition: border-color 0.2s;
}

.feature-card:hover {
    border-color: #ef4444;
}

.feature-icon {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    display: block;
}

.feature-card h3 {
    font-family: monospace;
    color: #ef4444;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: #94a3b8;
    font-size: 0.75rem;
    margin-bottom: 0;
}

/* API Links / Buttons */
.api-links {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 20px 0;
}

.btn {
    padding: 8px 16px;
    background: #ef4444;
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-weight: 500;
    transition: background 0.2s;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background: #dc2626;
    color: white;
    text-decoration: none;
}

.btn-secondary {
    background: #374151;
    color: #e5e7eb;
}

.btn-secondary:hover {
    background: #4b5563;
    color: #f9fafb;
}

/* Games List */
.games-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.game-card {
    background: #111827;
    border: 1px solid #374151;
    border-radius: 12px;
    padding: 1.5rem;
    transition: border-color 0.2s;
    display: block;
    text-decoration: none;
    color: inherit;
}

.game-card:hover {
    border-color: #ef4444;
    text-decoration: none;
}

.game-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.game-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #f9fafb;
}

.game-card-status {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    text-transform: uppercase;
}

.game-card-status.open {
    background: #059669;
    color: #a7f3d0;
}

.game-card-status.in_progress {
    background: #d97706;
    color: #fde68a;
}

.game-card-status.completed {
    background: #6b7280;
    color: #e5e7eb;
}

.game-card-meta {
    display: flex;
    gap: 1.5rem;
    color: #9ca3af;
    font-size: 0.875rem;
}

.game-card-description {
    color: #d1d5db;
    font-size: 0.875rem;
    margin-top: 0.75rem;
    line-height: 1.5;
}

.game-card-setting {
    color: #9ca3af;
    font-size: 0.8rem;
    margin-top: 0.5rem;
    font-style: italic;
}

/* Game View */
.game-header {
    margin-bottom: 2rem;
}

.game-title {
    font-size: 2rem;
    font-weight: 700;
    color: #f9fafb;
    margin-bottom: 0.5rem;
}

.game-meta {
    display: flex;
    gap: 1.5rem;
    color: #9ca3af;
    font-size: 0.875rem;
    flex-wrap: wrap;
}

.scene-box {
    background: #0f172a;
    border: 2px solid #ef4444;
    border-radius: 10px;
    padding: 1.25rem;
    margin: 0.625rem 0;
}

.scene-label {
    color: #fbbf24;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.scene-description {
    color: #e2e8f0;
    font-size: 0.9375rem;
    line-height: 1.6;
}

.players-section, .actions-section {
    margin: 0.5rem 0;
}

.players-section h3, .actions-section h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #f9fafb;
    margin-bottom: 0.375rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid #374151;
}

.player-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.player-badge {
    background: #1e293b;
    color: #e2e8f0;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
}

.player-badge.gm {
    background: #7c3aed;
    color: #ede9fe;
}

.action-item {
    background: #1e293b;
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

.action-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.action-player {
    font-weight: 600;
    font-size: 0.9375rem;
    color: #f9fafb;
}

.action-time {
    color: #6b7280;
    font-size: 0.8125rem;
}

.action-do, .action-say {
    margin-top: 0.25rem;
}

.action-do span, .action-say span {
    color: #ef4444;
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
}

.action-do p, .action-say p {
    color: #d1d5db;
    font-size: 0.875rem;
    margin: 0.125rem 0 0 0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #6b7280;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.25rem;
    color: #9ca3af;
    margin-bottom: 0.5rem;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 2rem;
    color: #9ca3af;
}

.loading-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #374151;
    border-top-color: #ef4444;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Footer */
.footer {
    padding: 3rem 0 2rem;
    text-align: center;
    border-top: 1px solid #374151;
    color: #9ca3af;
    font-size: 0.875rem;
    margin-top: 4rem;
}

.footer-links {
    margin-top: 1rem;
}

.footer-links a {
    color: #ef4444;
    text-decoration: none;
    margin: 0 1rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #dc2626;
    text-decoration: underline;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-muted { color: #9ca3af; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* Responsive */
@media (max-width: 640px) {
    .stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .game-card-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .game-card-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .nav {
        flex-wrap: wrap;
    }
}

/* Fate Aspects */
.fate-aspects-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.fate-aspect {
    background: #1e293b;
    border-left: 3px solid #a78bfa;
    border-radius: 0 6px 6px 0;
    padding: 0.5rem 0.75rem;
}

.fate-aspect-label {
    font-size: 0.7rem;
    color: #a78bfa;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.15rem;
}

.fate-aspect-text {
    color: #e2e8f0;
    font-size: 0.875rem;
    font-style: italic;
}

/* Fate Stress Track */
.fate-stress-track {
    display: flex;
    gap: 0.5rem;
}

.fate-stress-box {
    width: 40px;
    height: 40px;
    background: #1e293b;
    border: 2px solid #475569;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.fate-stress-box.checked {
    background: #7f1d1d;
    border-color: #ef4444;
}

.fate-stress-number {
    font-size: 0.7rem;
    color: #6b7280;
    position: absolute;
    top: 2px;
    right: 4px;
}

.fate-stress-x {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ef4444;
}

/* Fate Consequences */
.fate-consequences-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.fate-consequence-slot {
    background: #1e293b;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
}

.fate-consequence-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.fate-consequence-label {
    font-size: 0.75rem;
    color: #9ca3af;
    font-weight: 500;
}

.fate-consequence-shifts {
    font-size: 0.7rem;
    color: #ef4444;
    background: #7f1d1d;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-weight: 600;
}

.fate-consequence-text {
    color: #e2e8f0;
    font-size: 0.875rem;
    font-style: italic;
}

.fate-consequence-text.empty {
    color: #4b5563;
}
