/* WingDerby game UI — works inside any theme; the WingDerby theme sets the same tokens. */
.wd-app {
	--wd-ink: #17212b;
	--wd-slate: #5a6b7b;
	--wd-line: #d6dee6;
	--wd-wash: #eef3f7;
	--wd-paper: #ffffff;
	--wd-band: #b8322a;
	--wd-band-soft: #f6e3e1;
	--wd-field: #2f6b4f;
	--wd-field-soft: #e2efe8;
	--wd-sun: #d9a441;
	--wd-font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
	--wd-display: "Bricolage Grotesque", var(--wd-font);
	--wd-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
	font-family: var(--wd-font);
	color: var(--wd-ink);
	line-height: 1.5;
	font-size: 16px;
	max-width: 1080px;
	margin: 0 auto;
}
.wd-app *, .wd-app *::before, .wd-app *::after { box-sizing: border-box; }
.wd-app h1, .wd-app h2, .wd-app h3 { font-family: var(--wd-display); line-height: 1.15; margin: 0 0 .5rem; letter-spacing: -.01em; }
.wd-app h1 { font-size: 1.75rem; font-weight: 700; }
.wd-app h2 { font-size: 1.35rem; font-weight: 650; margin-top: 1.75rem; }
.wd-app h3 { font-size: 1.1rem; font-weight: 600; margin-top: 1.25rem; }
.wd-app h2 small, .wd-app h3 small { font-family: var(--wd-font); font-weight: 400; color: var(--wd-slate); font-size: .85rem; margin-left: .35rem; }
.wd-app p { margin: 0 0 .75rem; }
.wd-app a { color: var(--wd-ink); text-decoration-color: var(--wd-line); text-underline-offset: 3px; }
.wd-app a:hover { text-decoration-color: var(--wd-band); }
.wd-hint { color: var(--wd-slate); font-size: .92rem; max-width: 70ch; }
.wd-ring { font-family: var(--wd-mono); font-size: .9em; letter-spacing: .02em; white-space: nowrap; background: var(--wd-wash); padding: .1em .35em; border-radius: 3px; text-decoration: none; }
.wd-money { font-family: var(--wd-mono); font-variant-numeric: tabular-nums; }
.wd-money::before { content: "€"; opacity: .6; margin-right: .1em; }

/* Header */
.wd-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1rem 0 .75rem; border-bottom: 2px solid var(--wd-ink); }
.wd-loftname { margin: 0; }
.wd-loftmeta { color: var(--wd-slate); margin: .2rem 0 0; font-size: .9rem; }
.wd-cash { font-size: 1.35rem; font-weight: 600; white-space: nowrap; padding-top: .25rem; }

/* Navigation */
.wd-nav { display: flex; gap: .25rem; overflow-x: auto; padding: .5rem 0; margin: 0 0 .5rem; border-bottom: 1px solid var(--wd-line); scrollbar-width: none; }
.wd-nav::-webkit-scrollbar { display: none; }
.wd-nav a { flex: 0 0 auto; padding: .45rem .8rem; border-radius: 999px; text-decoration: none; color: var(--wd-slate); font-weight: 500; font-size: .95rem; }
.wd-nav a.is-active { background: var(--wd-ink); color: #fff; }
.wd-nav a:hover:not(.is-active) { background: var(--wd-wash); color: var(--wd-ink); }
.wd-main { padding-bottom: 2rem; }

/* Flash */
.wd-flash { margin: .75rem 0; padding: .7rem 1rem; border-radius: 6px; background: var(--wd-field-soft); border-left: 4px solid var(--wd-field); font-size: .95rem; }
.wd-flash.is-error { background: var(--wd-band-soft); border-left-color: var(--wd-band); }
.wd-flash[hidden] { display: none; }

/* Buttons & forms */
.wd-btn { display: inline-block; font: inherit; font-weight: 600; font-size: .95rem; padding: .55rem 1rem; border: 1.5px solid var(--wd-ink); border-radius: 6px; background: var(--wd-paper); color: var(--wd-ink); cursor: pointer; text-decoration: none; line-height: 1.2; }
.wd-btn:hover { background: var(--wd-wash); }
.wd-btn-primary { background: var(--wd-ink); color: #fff; }
.wd-btn-primary:hover { background: #24384c; }
.wd-btn-small { padding: .25rem .6rem; font-size: .8rem; }
.wd-btn[disabled] { opacity: .5; cursor: wait; }
.wd-form label { display: block; margin: 0 0 .9rem; font-weight: 500; }
.wd-form input[type=text], .wd-form input[type=number], .wd-form select { display: block; width: 100%; max-width: 420px; font: inherit; padding: .55rem .7rem; margin-top: .3rem; border: 1.5px solid var(--wd-line); border-radius: 6px; background: #fff; color: var(--wd-ink); }
.wd-form input:focus, .wd-form select:focus, .wd-btn:focus-visible, .wd-nav a:focus-visible { outline: 3px solid var(--wd-sun); outline-offset: 2px; }
.wd-form fieldset { border: 1px solid var(--wd-line); border-radius: 8px; padding: .75rem 1rem; margin: 0 0 1rem; }
.wd-form legend { font-weight: 600; padding: 0 .4rem; }
.wd-radio { display: flex; gap: .6rem; align-items: baseline; font-weight: 400; margin: .35rem 0; }
.wd-radio small { color: var(--wd-slate); }
.wd-inline { display: inline-flex; gap: .4rem; align-items: center; margin: .3rem .5rem .3rem 0; flex-wrap: wrap; }
.wd-inline input { max-width: 140px; margin: 0; }
.wd-inline label { margin: 0; }

/* Today / tasks */
.wd-tasks, .wd-news, .wd-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.wd-tasks li { padding: .6rem 0 .6rem 1.2rem; border-bottom: 1px solid var(--wd-line); position: relative; }
.wd-tasks li::before { content: ""; position: absolute; left: 0; top: 1.1rem; width: .5rem; height: .5rem; border-radius: 50%; background: var(--wd-field); }
.wd-tasks li.wd-warn::before { background: var(--wd-band); }
.wd-news li { padding: .45rem 0; border-bottom: 1px dashed var(--wd-line); font-size: .95rem; }
.wd-news time { display: inline-block; min-width: 5.5rem; color: var(--wd-slate); font-family: var(--wd-mono); font-size: .8rem; }
.wd-news li.wd-warn { color: var(--wd-band); }
.wd-list li { padding: .4rem 0; border-bottom: 1px solid var(--wd-line); }

/* Race cards */
.wd-racelist { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.wd-racecard { display: flex; flex-direction: column; gap: .15rem; padding: .8rem .9rem; border: 1px solid var(--wd-line); border-left: 5px solid var(--wd-slate); border-radius: 6px; text-decoration: none; background: var(--wd-paper); }
.wd-racecard:hover { border-color: var(--wd-ink); }
.wd-racecard strong { font-family: var(--wd-display); font-size: 1.15rem; }
.wd-racecard span { font-size: .85rem; color: var(--wd-slate); }
.wd-racetype { font-size: .8rem; color: var(--wd-slate); }
.wd-racestatus { font-size: .8rem; }
.wd-type-training { border-left-color: #8fa3b5; }
.wd-type-speed { border-left-color: var(--wd-field); }
.wd-type-middle { border-left-color: var(--wd-sun); }
.wd-type-long { border-left-color: var(--wd-band); }
.wd-type-extreme { border-left-color: var(--wd-ink); }
.wd-racehead { padding: .5rem 0 .5rem 1rem; border-left: 6px solid var(--wd-slate); margin-bottom: 1rem; }
.wd-racehead h2 { margin: 0; font-size: 1.6rem; }
.wd-weather { background: var(--wd-wash); padding: .6rem .9rem; border-radius: 6px; display: inline-block; }

/* Tables */
.wd-tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -.25rem 1rem; }
.wd-table { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 560px; }
.wd-table th { text-align: left; font-weight: 600; color: var(--wd-slate); font-size: .8rem; padding: .5rem .5rem; border-bottom: 2px solid var(--wd-ink); white-space: nowrap; }
.wd-table td { padding: .55rem .5rem; border-bottom: 1px solid var(--wd-line); vertical-align: middle; white-space: nowrap; }
.wd-table td:last-child, .wd-news td { white-space: normal; }
.wd-table tr.wd-mine td { background: var(--wd-field-soft); }
.wd-table tr.wd-disabled td { opacity: .5; }
.wd-results td:first-child, .wd-results td:nth-child(7) { font-family: var(--wd-mono); font-variant-numeric: tabular-nums; }
.wd-results tr:first-child td:first-child { color: var(--wd-band); font-weight: 700; }
.wd-sick { color: var(--wd-band); font-weight: 600; }
.wd-neg { color: var(--wd-band); }
.wd-pos { color: var(--wd-field); }

/* Stars & bars */
.wd-stars { display: inline-block; width: 60px; height: 8px; background: var(--wd-line); border-radius: 4px; overflow: hidden; vertical-align: middle; }
.wd-stars i { display: block; height: 100%; background: var(--wd-ink); }
.wd-bar { display: inline-block; width: 60px; height: 8px; background: var(--wd-line); border-radius: 4px; overflow: hidden; vertical-align: middle; }
.wd-bar i { display: block; height: 100%; background: var(--wd-field); }
.wd-bar-fatigue i { background: var(--wd-band); }

/* Pigeon detail */
.wd-pigeon-head h2 { font-size: 1.6rem; }
.wd-pigeon-head p { color: var(--wd-slate); }
.wd-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.wd-traits { display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem; margin: 0 0 1rem; align-items: center; }
.wd-traits dt { font-weight: 500; }
.wd-traits dd { margin: 0; }
.wd-traits dd span { color: var(--wd-slate); font-size: .85rem; margin-left: .4rem; }
.wd-traits-compact { gap: .2rem .6rem; font-size: .85rem; }

/* Pedigree */
.wd-ped { display: flex; align-items: center; gap: .75rem; }
.wd-ped-bird { display: block; font-size: .85rem; padding: .35rem .5rem; border: 1px solid var(--wd-line); border-radius: 6px; text-decoration: none; background: #fff; min-width: 150px; }
.wd-ped-bird em { color: var(--wd-field); font-style: normal; font-size: .8rem; }
.wd-ped-parents { display: flex; flex-direction: column; gap: .5rem; padding-left: .75rem; border-left: 2px solid var(--wd-line); }
.wd-ped-unknown { color: var(--wd-slate); font-size: .8rem; padding: .35rem .5rem; }

/* Auctions */
.wd-auctions { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.wd-auction { border: 1px solid var(--wd-line); border-radius: 8px; padding: 1rem; background: var(--wd-paper); }
.wd-auction h3 { margin-top: 0; }
.wd-auction p { font-size: .9rem; color: var(--wd-slate); }
.wd-auction-bid { color: var(--wd-ink) !important; }
.wd-sums { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; margin-bottom: 1rem; font-size: .9rem; }

/* Welcome */
.wd-welcome { padding: 2rem 0; max-width: 60ch; }
.wd-welcome h1 { font-size: 2.2rem; }
.wd-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.25rem; }
.wd-howto { max-width: 70ch; }

/* Clocking board (front page) */
.wd-board { background: var(--wd-ink, #17212b); color: #fff; border-radius: 10px; padding: 1.1rem 1.25rem; font-family: "IBM Plex Sans", system-ui, sans-serif; }
.wd-board-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .25rem 1rem; font-size: .85rem; opacity: .85; margin-bottom: .6rem; }
.wd-board-title { font-family: "Bricolage Grotesque", system-ui, sans-serif; font-size: 1.05rem; font-weight: 600; opacity: 1; }
.wd-board-list { list-style: none; margin: 0; padding: 0; font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: .9rem; }
.wd-board-list li { display: grid; grid-template-columns: 2rem 1fr 1fr auto auto; gap: .75rem; padding: .35rem 0; border-top: 1px solid rgba(255,255,255,.12); align-items: baseline; }
.wd-board-list li:first-child .wd-board-rank { color: #f0b74d; }
.wd-board-list .wd-ring { background: rgba(255,255,255,.08); color: #fff; }
.wd-board-loft { font-family: "IBM Plex Sans", system-ui, sans-serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wd-board-time { opacity: .7; }
.wd-board-vel { font-weight: 600; }
.wd-board-more { display: inline-block; margin-top: .75rem; color: #fff; font-size: .85rem; }
.wd-board-empty strong { display: block; font-family: "Bricolage Grotesque", system-ui, sans-serif; font-size: 1.5rem; margin: .25rem 0; }

/* Phones */
@media (max-width: 720px) {
	.wd-app { font-size: 15px; }
	.wd-top { flex-direction: column; gap: .25rem; }
	.wd-cash { font-size: 1.2rem; }
	.wd-grid2 { grid-template-columns: 1fr; }
	.wd-board-list li { grid-template-columns: 1.5rem 1fr auto; }
	.wd-board-loft, .wd-board-time { display: none; }
	.wd-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: #fff; border-top: 1px solid var(--wd-line); border-bottom: 0; margin: 0; padding: .35rem .5rem calc(.35rem + env(safe-area-inset-bottom)); justify-content: space-between; }
	.wd-nav a { padding: .4rem .45rem; font-size: .76rem; }
	.wd-main { padding-bottom: 5rem; }
	.wd-welcome h1 { font-size: 1.8rem; }
}
@media (prefers-reduced-motion: no-preference) {
	.wd-flash { animation: wd-in .25s ease-out; }
	@keyframes wd-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
}
