:root {
    --green: #2ecc71;
    --purple: #9b59b6;
    --blue: #3498db;
    --bg: #11131a;
    --card: #1c1f2b;
    --text: #f2f4f8;
    --muted: #9aa3b2;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-text-size-adjust: 100%;
}

.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 1rem 1rem 3rem;
}

h1 { font-size: 1.8rem; }

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .5rem 0 1rem;
    border-bottom: 1px solid #2a2e3c;
    margin-bottom: 1rem;
}
.topbar a { color: var(--blue); text-decoration: none; }

a { color: var(--blue); }

.card {
    background: var(--card);
    border-radius: 14px;
    padding: 1rem 1.2rem;
    margin-bottom: 1rem;
}

label {
    display: block;
    margin: .75rem 0;
    color: var(--muted);
    font-size: .9rem;
}

input[type="text"],
input[type="email"],
input[type="password"] {
    display: block;
    width: 100%;
    margin-top: .35rem;
    padding: .8rem;
    font-size: 1rem;
    border: 1px solid #353a4a;
    border-radius: 10px;
    background: #0e1017;
    color: var(--text);
}

button {
    width: 100%;
    padding: .9rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    background: var(--blue);
    color: white;
    cursor: pointer;
    margin-top: .5rem;
}
button:disabled { opacity: .4; cursor: not-allowed; }
button.secondary { background: #353a4a; }
button.danger, button.danger:hover { background: #e74c3c; width: auto; padding: .5rem .9rem; }

.controls { display: flex; gap: .5rem; }
.controls button { margin-top: 0; }

/* Affirmations (shared by participant / present / manage) */
.affirmation {
    display: flex;
    align-items: center;
    gap: .75rem;
    width: 100%;
    text-align: left;
    padding: 1rem;
    margin: .5rem 0;
    border-radius: 12px;
    border: 3px solid transparent;
    background: var(--card);
    color: var(--text);
    font-size: 1.05rem;
}
.affirmation .badge {
    flex: 0 0 auto;
    width: 1.9rem; height: 1.9rem;
    display: grid; place-items: center;
    border-radius: 50%;
    font-weight: 700;
    color: #0e1017;
}
.affirmation .text { flex: 1; }
.affirmation .count {
    flex: 0 0 auto;
    font-weight: 700;
    font-size: 1.3rem;
    min-width: 2rem;
    text-align: right;
}

.color-green  .badge { background: var(--green); }
.color-purple .badge { background: var(--purple); }
.color-blue   .badge { background: var(--blue); }
.color-green  { border-left: 6px solid var(--green); }
.color-purple { border-left: 6px solid var(--purple); }
.color-blue   { border-left: 6px solid var(--blue); }

button.affirmation.selected { border-color: #ffd54a; }
.affirmation.is-lie { box-shadow: 0 0 0 3px #ffd54a inset; }

.tag {
    background: #ffd54a; color: #0e1017;
    font-size: .75rem; font-weight: 700;
    padding: .15rem .5rem; border-radius: 6px;
}

.hint, .muted, .status { color: var(--muted); }
.error { color: #e74c3c; }
.status { margin-top: .75rem; min-height: 1.2rem; }

.pill {
    background: #353a4a; padding: .35rem .75rem;
    border-radius: 999px; font-size: .9rem;
}

.group-list { list-style: none; padding: 0; }
.group-list li { margin: .4rem 0; }
.group-pick { background: #353a4a; }

/* Tabs (participant) */
.tabs { display: flex; gap: .5rem; margin-bottom: 1rem; }
.tab {
    flex: 1; margin-top: 0;
    background: var(--card); color: var(--muted);
    border: 1px solid #353a4a;
}
.tab.active { background: var(--blue); color: #fff; border-color: var(--blue); }

/* Photo upload + gallery */
.upload-btn {
    display: block; text-align: center; cursor: pointer;
    margin: 0; color: #fff; font-weight: 600;
    background: var(--blue); padding: .9rem; border-radius: 12px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: .5rem;
}
.photo {
    position: relative; display: block;
    aspect-ratio: 1; border-radius: 10px; overflow: hidden;
    border: 2px solid transparent;
}
.photo.mine { border-color: #ffd54a; }
.photo img, .photo-admin img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.photo-tag {
    position: absolute; top: 4px; left: 4px;
    background: #ffd54a; color: #0e1017;
    font-size: .7rem; font-weight: 700;
    padding: .1rem .4rem; border-radius: 6px;
}
.photo-admin {
    margin: 0; background: var(--card); border-radius: 10px; overflow: hidden;
    display: flex; flex-direction: column;
}
.photo-admin a { aspect-ratio: 1; display: block; }
.photo-admin figcaption { padding: .5rem; font-size: .8rem; line-height: 1.3; word-break: break-word; }
.photo-admin .danger { margin: 0 .5rem .5rem; }

.group-head { display: flex; justify-content: space-between; align-items: center; }
.aff-list { list-style: none; padding: 0; }
.aff-row { display: flex; align-items: center; gap: .6rem; padding: .4rem; border-radius: 8px; margin: .3rem 0; }
.aff-row input[type="text"] { margin-top: 0; }
fieldset { border: 1px solid #353a4a; border-radius: 10px; margin: 1rem 0; }
legend { color: var(--muted); padding: 0 .4rem; }
