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

:root {
    --bg: #0f172a;
    --surface: #1e293b;
    --surface-hover: #334155;
    --border: #334155;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --primary: #6366f1;
    --primary-hover: #818cf8;
    --danger: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;
    --radius: 8px;
}

body {
    font-family: 'Overpass', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

h1, h2, h3 {
    font-weight: 600;
    letter-spacing: -0.01em;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary);
    text-decoration: none;
}
.navbar-right { display: flex; gap: 0.5rem; align-items: center; }

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

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    font-size: 0.875rem;
    text-decoration: none;
    transition: background 0.15s;
}
.btn:hover { background: var(--surface-hover); }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-sm { padding: 0.25rem 0.75rem; font-size: 0.8rem; }

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
.badge-ideation { background: var(--warning); color: #000; }
.badge-reveal { background: var(--primary); }
.badge-discussion { background: var(--success); color: #000; }
.badge-archived { background: var(--bg-tertiary); color: var(--text-muted); }

.board {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.5rem;
    overflow-x: auto;
    min-height: calc(100vh - 120px);
}
.column {
    flex: 1;
    min-width: 480px;
    background: var(--surface);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
}
.column-header {
    padding: 1rem;
    font-weight: 700;
    font-size: 1.1rem;
    border-bottom: 2px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.column-cards {
    padding: 0.75rem;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 0.5rem;
    overflow-y: auto;
}
.column .column-cards.revealed-cards { flex: 1 1 0; min-height: 0; padding-bottom: 0.5rem; }
.column .column-cards.private-cards { flex: 1 1 0; min-height: 0; padding-top: 0.5rem; }

.section-label {
    padding: 0.5rem 0.75rem 0.25rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
}
.section-label.private-label {
    color: var(--warning);
    border-top: 1px dashed var(--border);
    margin-top: 0.25rem;
}

/* Outside ideation: no private cards exist — hide that section entirely */
.board:not(.board-ideation) .section-label { display: none; }
.board:not(.board-ideation) .column .column-cards.private-cards { display: none; }
.board:not(.board-ideation) .column .column-cards.revealed-cards { flex: 1 1 auto; padding-bottom: 0; }

.card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 0.85rem;
    position: relative;
    flex: 0 1 calc(33.333% - 0.34rem);
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 80px;
    max-width: 100%;
}
.card-text {
    margin-bottom: 0.4rem;
    line-height: 1.3;
    font-size: 0.8rem;
    word-break: break-word;
    overflow-wrap: break-word;
}
.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.65rem;
    color: var(--text-muted);
    gap: 0.4rem;
}
.card-author {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 55%;
}
.card-actions button,
.icon-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.2rem;
    line-height: 0;
    border-radius: 4px;
    transition: background 0.1s, color 0.1s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn svg { flex-shrink: 0; pointer-events: none; }
.icon-btn svg, .card-actions svg { display: block; pointer-events: none; }
.card-actions button:hover,
.icon-btn:hover {
    background: var(--surface-hover);
    color: var(--text);
}
.card-private { border-left: 3px solid var(--warning); opacity: 0.8; }
.card-actions { display: flex; gap: 0.25rem; }
.card-actions button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 0.8rem;
}
.card-actions button:hover { color: var(--text); }

.card-input {
    width: 100%;
    min-height: 60px;
    padding: 0.5rem;
    background: var(--bg);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    color: var(--text);
    resize: none;
    font-family: inherit;
    font-size: 0.875rem;
}
.card-input:focus { outline: none; border-color: var(--primary); }

.timer {
    font-size: 1.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.timer-expired { color: var(--danger); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: 0.5; } }

.retro-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.participants {
    display: flex;
    gap: 0.35rem;
    margin-left: auto;
    flex-wrap: wrap;
}
.participant {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    cursor: default;
}

.team-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--surface);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s;
}
.team-card:hover { background: var(--surface-hover); }
.team-card h3 { font-size: 1.1rem; }

.retro-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s;
}
.retro-item:hover { background: var(--surface-hover); }
.retro-item-right { display: flex; align-items: center; gap: 0.75rem; }

.team-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    gap: 1rem;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}
.modal-content {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem;
    min-width: 400px;
    max-width: 500px;
}
.modal-content h3 { margin-bottom: 1rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.25rem; font-size: 0.875rem; color: var(--text-muted); }
.form-group input, .form-group select {
    width: 100%;
    padding: 0.5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.875rem;
}
.modal-actions { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 1.5rem; }
.preset-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.hidden { display: none !important; }

.members-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}
.members-table th, .members-table td {
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
}
.members-table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
}

.board-locked::after {
    content: 'Board is locked';
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--danger);
    padding: 0.5rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
}
