:root {
    --bg: #0f172a;
    --panel: #111827;
    --panel-2: #1f2937;
    --text: #f9fafb;
    --muted: #cbd5e1;
    --accent: #22c55e;
    --border: #334155;
    --danger: #ef4444;
    --warn: #f59e0b;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

a {
    color: #93c5fd;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.card-image {
    display: block;
    width: 100%;
    max-width: 140px;
    height: auto;
    margin: 0 auto 10px;
    border-radius: 8px;
    background: #0b1220;
}

.card-tile {
    text-align: center;
}

.card-tile.playable {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.35);
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.card-tile.playable:hover {
    transform: translateY(-3px);
    border-color: #4ade80;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
}

.card-tile.cpu-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.card-back-image {
    display: block;
    width: 100%;
    max-width: 140px;
    height: auto;
    margin: 0 auto 10px;
    border-radius: 8px;
    background: #0b1220;
}

.play-button {
    margin-top: 10px;
    width: 100%;
}

.content-panel .cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}

.content-panel .card-image {
    max-width: 100px;
}

.card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-top: 8px;
}

.badge-bright { color: #fde68a; border-color: #fde68a55; }
.badge-animal { color: #93c5fd; border-color: #93c5fd55; }
.badge-ribbon { color: #f9a8d4; border-color: #f9a8d455; }
.badge-junk { color: #d1d5db; border-color: #d1d5db55; }

.badge {
    transition: transform 0.12s ease, border-color 0.12s ease;
}

.badge:hover {
    transform: translateY(-1px);
    border-color: var(--accent);
}

.card-tile.playable {
    cursor: pointer;
}

.notice {
    animation: fadeSlideIn 0.22s ease;
}

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

.card-tile {
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.site {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.brand h1 {
    margin: 0;
    font-size: 24px;
}

.brand p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.top-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.button,
button {
    appearance: none;
    border: 1px solid var(--border);
    background: var(--panel-2);
    color: var(--text);
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

.button:hover,
button:hover {
    border-color: var(--accent);
}

.button-primary {
    background: var(--accent);
    color: #052e16;
    border-color: var(--accent);
    font-weight: bold;
}

.button-danger {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
}

.layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
}

.sidebar,
.content-panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
}

.section {
    margin-bottom: 20px;
}

.section:last-child {
    margin-bottom: 0;
}

.section h2,
.section h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 18px;
}

.meta-list,
.score-list,
.card-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.meta-list li,
.score-list li,
.card-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.meta-list li:last-child,
.score-list li:last-child,
.card-list li:last-child {
    border-bottom: none;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    background: var(--panel-2);
    color: var(--muted);
    border: 1px solid var(--border);
}

.badge-success {
    background: rgba(34, 197, 94, 0.15);
    color: #86efac;
    border-color: rgba(34, 197, 94, 0.4);
}

.badge-warn {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
    border-color: rgba(245, 158, 11, 0.4);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.4);
}

.board {
    display: grid;
    gap: 20px;
}

.board-row {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
}

.board-row h2 {
    margin-top: 0;
    margin-bottom: 12px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.card-tile {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
}

.card-tile strong {
    display: block;
    margin-bottom: 6px;
}

.card-meta {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 8px;
}

.inline-form {
    display: inline;
}

.notice {
    margin-bottom: 16px;
    padding: 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--panel-2);
}

.notice-success {
    border-color: rgba(34, 197, 94, 0.5);
}

.notice-warn {
    border-color: rgba(245, 158, 11, 0.5);
}

.empty {
    color: var(--muted);
    font-style: italic;
}

.footer {
    margin-top: 24px;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

@media (max-width: 900px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }
}
