@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

:root { --ink: #17231f; --muted: #65736e; --paper: #f7f7f2; --panel: #ffffff; --line: #dce3dc; --mint: #b5edce; --mint-strong: #16835c; --coral: #da5b4d; --shadow: 0 20px 60px rgba(23, 35, 31, .08); }
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; color: var(--ink); background: radial-gradient(circle at 10% 0%, #e5f8ea 0, transparent 30rem), var(--paper); font: 16px/1.5 'DM Sans', sans-serif; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { width: min(100% - 32px, 880px); margin: 0 auto; padding: 24px 0 48px; }
.view { animation: enter .35s ease-out both; }
.intro-mark { display: block; width: 72px; height: 72px; margin-bottom: 28px; border-radius: 16px; }
.eyebrow { color: var(--mint-strong); font-size: .72rem; font-weight: 700; letter-spacing: .14em; margin: 0 0 8px; }
h1, h2, h3 { font-family: 'Space Grotesk', sans-serif; letter-spacing: -.04em; line-height: 1.05; margin: 0; }
h1 { font-size: clamp(2.5rem, 10vw, 5.4rem); max-width: 700px; }
h2 { font-size: 1.6rem; }
.lede { color: var(--muted); font-size: 1.05rem; max-width: 520px; margin: 20px 0 34px; }
.stack-form { display: grid; gap: 10px; max-width: 560px; }
label { font-size: .85rem; font-weight: 700; margin-top: 8px; }
input, textarea { width: 100%; color: var(--ink); background: rgba(255,255,255,.8); border: 1px solid var(--line); border-radius: 10px; padding: 13px 14px; outline: 0; resize: vertical; }
input:focus, textarea:focus { border-color: var(--mint-strong); box-shadow: 0 0 0 3px rgba(22,131,92,.13); }
.field-note, .dialog-copy { color: var(--muted); font-size: .85rem; margin: 0 0 8px; }
.button { border: 0; border-radius: 10px; padding: 13px 16px; font-weight: 700; transition: transform .15s, box-shadow .15s, background .15s; }
.button:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(23,35,31,.12); }
.button-primary { color: var(--ink); background: var(--mint); }
.button-secondary { color: var(--ink); background: var(--panel); border: 1px solid var(--line); }
.button-danger { color: #a83d34; background: #fff0ee; border: 1px solid #f2c1ba; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin: 12px 0 24px; }
.topbar h1 { font-size: clamp(2.1rem, 8vw, 4rem); }
.icon-button, .close-button { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: var(--panel); font-size: 1.6rem; }
.status-banner { color: var(--muted); background: #eef4ef; border-left: 3px solid var(--mint-strong); border-radius: 8px; padding: 12px 14px; margin-bottom: 18px; }
.status-banner[data-kind="error"] { color: #8d322a; background: #fff0ee; border-color: var(--coral); }
.results { display: grid; gap: 16px; }
.empty-state { color: var(--muted); border: 1px dashed #bdc9c0; border-radius: 14px; padding: 28px 20px; text-align: center; }
.participant { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.participant.is-changed { border-color: var(--coral); box-shadow: 0 0 0 3px rgba(218,91,77,.12), var(--shadow); }
.participant-header { display: flex; justify-content: space-between; gap: 12px; padding: 18px 18px 14px; border-bottom: 1px solid var(--line); }
.participant-tools { display: flex; align-items: flex-start; gap: 10px; }
.participant-name { font-size: 1.25rem; }
.bib { color: var(--muted); font-size: .82rem; }
.change-label { color: var(--coral); font-size: .7rem; letter-spacing: .08em; }
.remove-button { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 50%; font-size: 1.25rem; line-height: 1; }
.remove-button:hover { color: var(--coral); border-color: var(--coral); }
.participant-error { color: #8d322a; background: #fff8f6; margin: 0; padding: 16px 18px; font-size: .9rem; }
.competition { padding: 18px; border-bottom: 1px solid #edf0ec; }
.competition:last-child { border-bottom: 0; }
.competition-title { font-size: 1.08rem; margin-bottom: 4px; }
.meta-line { color: var(--muted); font-size: .9rem; margin: 0 0 12px; }
.rounds { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px; }
.round { background: #f1f4f0; border-radius: 8px; padding: 9px 10px; min-height: 66px; }
.round-name { display: block; font-size: .78rem; font-weight: 700; text-transform: capitalize; }
.round-status { display: block; font-size: .84rem; margin-top: 4px; }
.round-status.in { color: var(--mint-strong); }.round-status.out { color: var(--coral); }
.heat { display: inline-block; color: #fff; background: #45534d; border-radius: 4px; padding: 1px 5px; font-size: .7rem; margin-top: 5px; }
.dashboard-actions { display: grid; gap: 10px; margin-top: 24px; }
.dialog { width: min(calc(100% - 32px), 480px); border: 0; border-radius: 16px; padding: 22px; box-shadow: 0 24px 80px rgba(23,35,31,.22); }
.dialog::backdrop { background: rgba(23,35,31,.38); backdrop-filter: blur(3px); }.dialog-heading { display: flex; justify-content: space-between; margin-bottom: 12px; }.close-button { width: 34px; height: 34px; font-size: 1.35rem; }.dialog-actions { display: grid; gap: 10px; }
.icon-button.is-loading { animation: spin .8s linear infinite; }
@media (min-width: 640px) { .app-shell { padding-top: 60px; }.dashboard-actions { grid-template-columns: 1fr auto; }.dialog-actions { grid-template-columns: 1fr 1fr; } }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-color-scheme: dark) {
	:root { --ink: #edf4ef; --muted: #a4b5ad; --paper: #101815; --panel: #18221e; --line: #304039; --mint: #9ce4c0; --mint-strong: #63d39e; --coral: #ff8476; --shadow: 0 20px 60px rgba(0, 0, 0, .22); }
	body { background: radial-gradient(circle at 10% 0%, #1c3b2d 0, transparent 30rem), var(--paper); }
	input, textarea { color: var(--ink); background: rgba(24,34,30,.9); }
	.button-primary { color: #102219; }
	.status-banner { background: #1e3228; }
	.status-banner[data-kind="error"] { color: #ffb0a7; background: #3b201e; }
	.empty-state { border-color: #52665b; }
	.competition { border-color: #26352e; }
	.round { background: #22302a; }
	.participant-error { color: #ffb0a7; background: #30201e; }
	.button-danger { color: #ffaaa0; background: #34201e; border-color: #6d3a34; }
	.dialog { color: var(--ink); background: var(--panel); }
}