:root {
  --green: #16a34a;
  --green-dark: #15803d;
  --red: #dc2626;
  --amber: #d97706;
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.4;
}

#app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- header + nav ---- */
header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--green);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
header h1 {
  font-size: 18px;
  margin: 0;
  font-weight: 600;
}
header .who {
  font-size: 13px;
  opacity: 0.9;
}
header button {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
}

nav {
  display: flex;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 52px;
  z-index: 9;
}
nav button {
  flex: 1;
  background: none;
  border: none;
  padding: 12px 4px;
  font-size: 13px;
  color: var(--muted);
  border-bottom: 3px solid transparent;
  font-weight: 500;
}
nav button.active {
  color: var(--green);
  border-bottom-color: var(--green);
}

main {
  flex: 1;
  padding: 16px;
}

/* ---- cards ---- */
.card {
  background: var(--card);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 16px;
}
.card h2 {
  margin: 0 0 12px;
  font-size: 16px;
}
.muted {
  color: var(--muted);
  font-size: 14px;
}
.center {
  text-align: center;
}

/* ---- balance hero ---- */
.hero {
  text-align: center;
  padding: 20px 16px;
}
.hero .big {
  font-size: 40px;
  font-weight: 700;
  line-height: 1.1;
}
.hero .big.ahead {
  color: var(--green);
}
.hero .big.behind {
  color: var(--red);
}
.hero .label {
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
}
.stats {
  display: flex;
  justify-content: space-around;
  margin-top: 16px;
}
.stats .stat {
  text-align: center;
}
.stats .stat .v {
  font-size: 18px;
  font-weight: 600;
}
.stats .stat .k {
  font-size: 12px;
  color: var(--muted);
}

/* ---- forms ---- */
label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 4px;
  font-weight: 500;
}
input,
select {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
}
.field {
  margin-bottom: 14px;
}
.row {
  display: flex;
  gap: 10px;
}
.row .field {
  flex: 1;
}

button.btn {
  width: 100%;
  padding: 13px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  background: var(--green);
  color: #fff;
}
button.btn:active {
  background: var(--green-dark);
}
button.btn.secondary {
  background: #e2e8f0;
  color: var(--text);
}
button.btn.danger {
  background: var(--red);
}
button.btn.small {
  width: auto;
  padding: 8px 12px;
  font-size: 14px;
}

/* ---- tables ---- */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th,
td {
  text-align: left;
  padding: 9px 6px;
  border-bottom: 1px solid var(--border);
}
th {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.pos {
  color: var(--red);
}
.neg {
  color: var(--green);
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.badge.win {
  background: #dcfce7;
  color: var(--green-dark);
}
.badge.miss {
  background: #fef3c7;
  color: var(--amber);
}
.badge.me {
  background: #e0e7ff;
  color: #4338ca;
}

.day-missing {
  background: #fffbeb;
}
.day-row input {
  padding: 8px;
  font-size: 15px;
}
.day-row td {
  padding: 6px 4px;
}

/* ---- misc ---- */
.notice {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 14px;
}
.notice.error {
  background: #fee2e2;
  color: var(--red);
}
.notice.ok {
  background: #dcfce7;
  color: var(--green-dark);
}
.notice.info {
  background: #e0f2fe;
  color: #075985;
}

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 360px;
}
.login-card .logo {
  text-align: center;
  font-size: 44px;
  margin-bottom: 8px;
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}
.list-item:last-child {
  border-bottom: none;
}
.list-item .name {
  font-weight: 500;
}
.list-item .actions {
  display: flex;
  gap: 6px;
}

hr.sep {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

.winner-banner {
  background: linear-gradient(135deg, #16a34a, #22c55e);
  color: #fff;
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 16px;
  text-align: center;
}
.winner-banner .title {
  font-size: 14px;
  opacity: 0.9;
}
.winner-banner .names {
  font-size: 20px;
  font-weight: 700;
  margin-top: 4px;
}
