:root {
  --green-dark:    #1a4a1a;
  --green-mid:     #2d6a2d;
  --green-light:   #4a8a4a;
  --green-pale:    #e8f4e8;
  --green-bg:      #f0f4f0;
  --white:         #ffffff;
  --text-primary:  #1a1a1a;
  --text-secondary:#555555;
  --text-muted:    #888888;
  --border:        #c8d8c8;
  --card-radius:   12px;
  --btn-radius:    8px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--green-bg);
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}
.app-header { background: var(--green-dark); padding: 16px; text-align: center; color: var(--white); }
.app-header img { width: 64px; height: 64px; border-radius: 50%; border: 2px solid var(--green-light); display: block; margin: 0 auto 8px; }
.app-header h1 { font-size: 20px; font-weight: 600; }
.app-header p  { font-size: 18px; font-weight: 700; color: #ffffff; margin-top: 4px; }
.top-nav { background: var(--green-mid); display: flex; overflow-x: auto; padding: 6px 8px; gap: 4px; }
.top-nav a { font-size: 13px; color: #c8e8c8; padding: 6px 12px; border-radius: 16px; text-decoration: none; white-space: nowrap; }
.top-nav a.active, .top-nav a:hover { background: var(--green-dark); color: var(--white); }
.page-body { max-width: 600px; margin: 0 auto; padding: 12px 12px 70px; }
.card { background: var(--white); border-radius: var(--card-radius); border: 0.5px solid var(--border); padding: 12px 14px; margin-bottom: 10px; }
.card h3 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.card p  { font-size: 13px; color: var(--text-secondary); }
.card .meta { font-size: 11px; color: var(--text-muted); margin-top: 6px; }
.section-label { font-size: 11px; font-weight: 600; color: var(--green-mid); text-transform: uppercase; letter-spacing: 0.5px; margin: 14px 0 6px; }
.tag { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 10px; margin-bottom: 6px; font-weight: 500; }
.tag-notice  { background: var(--green-pale); color: var(--green-mid); }
.tag-results { background: #e8eef8; color: #1a4a8a; }
.tag-social  { background: #f8f0e8; color: #8a5a1a; }
.tag-alert   { background: #fce8e8; color: #8a1a1a; }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.quick-tile { background: var(--white); border-radius: var(--card-radius); border: 0.5px solid var(--border); padding: 14px 12px; text-align: center; text-decoration: none; color: var(--text-primary); display: block; }
.quick-tile:hover { background: var(--green-pale); }
.quick-tile .tile-icon { display: none; }
.quick-tile h4 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.quick-tile p  { font-size: 14px; color: var(--text-primary); margin-top: 4px; }
.btn { display: block; width: 100%; padding: 12px; border-radius: var(--btn-radius); border: none; font-size: 15px; font-weight: 600; cursor: pointer; text-align: center; text-decoration: none; }
.btn-primary { background: var(--green-mid); color: var(--white); }
.btn-primary:hover { background: var(--green-dark); }
.btn-secondary { background: var(--white); color: var(--green-mid); border: 1px solid var(--green-mid); }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 4px; color: var(--text-secondary); }
.form-group input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--btn-radius); font-size: 15px; background: var(--white); }
.form-group input:focus { outline: none; border-color: var(--green-mid); }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--green-bg); }
.login-card { background: var(--white); border-radius: 16px; padding: 28px 24px; width: 100%; max-width: 360px; border: 0.5px solid var(--border); }
.login-card .logo { display: block; width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 10px; border: 2px solid var(--green-light); }
.login-card h1 { text-align: center; font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.login-card .subtitle { text-align: center; font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }
.locked-banner { background: #f5f0fc; border: 0.5px solid #d0b8f0; border-radius: var(--card-radius); padding: 12px 14px; margin-bottom: 10px; font-size: 13px; color: #5a1a8a; }
.locked-banner a { color: var(--green-mid); font-weight: 600; text-decoration: none; }
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; background: var(--white); border-top: 0.5px solid var(--border); display: flex; justify-content: space-around; padding: 8px 0 12px; z-index: 100; }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; color: var(--text-muted); font-size: 10px; }
.bottom-nav a.active { color: var(--green-mid); }
.nav-icon { font-size: 20px; }
.selector-card { background: #f4fbf4; border-color: #a8c8a8; }
.alert { padding: 10px 14px; border-radius: var(--btn-radius); font-size: 13px; margin-bottom: 10px; }
.alert-error { background: #fce8e8; color: #8a1a1a; border: 0.5px solid #f0b8b8; }

/* Desktop — centre the app at phone width */
@media (min-width: 640px) {
  body { background: #d8e8d8; }
  .app-header, .top-nav { max-width: 600px; margin: 0 auto; border-radius: 0; }
  .app-header { border-radius: 12px 12px 0 0; margin-top: 20px; }
  .top-nav { border-radius: 0; }
  .page-body { margin-top: 0; }
  body::before { content: ''; display: block; height: 20px; }
}
/* Menu tiles — front page */
.menu-tile {
  display: block;
  border-radius: var(--card-radius);
  border: 1px solid #c8d4c8;
  padding: 32px 22px;
  margin-bottom: 16px;
  text-decoration: none;
  color: var(--text-primary);
  text-align: center;
}
.menu-tile-icon { display: none; }
.menu-tile-arrow { display: none; }
.menu-tile-text h3 { font-size: 22px; font-weight: 600; color: #2a2a2a; margin-bottom: 8px; }
.menu-tile-text p  { font-size: 15px; color: #666666; }
.menu-tile.midweek  { background: #eef2ee; border: 2px solid #8a7a6a; }
.menu-tile.saturday { background: #eef0f8; border: 2px solid #8a7a6a; }
.menu-tile.notices  { background: #f8f4ee; border: 2px solid #8a7a6a; }
.menu-tile.midweek:hover  { background: #e4ebe4; }
.menu-tile.saturday:hover { background: #e4e8f4; }
.menu-tile.notices:hover  { background: #f0ece4; }
/* ── Availability page ───────────────────────── */
.avail-next-round {
    background: #eef2ee;
    border: 2px solid #8a7a6a;
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 24px;
}

.avail-round-label {
    font-size: 16px;
    margin-bottom: 12px;
    color: #333;
}

.avail-big-tick {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    cursor: pointer;
}

.avail-big-tick input[type="checkbox"] {
    width: 28px;
    height: 28px;
    cursor: pointer;
}
.avail-future {
    margin-bottom: 24px;
}

.avail-future h2, .avail-who-out h2 {
    color: #4a6741;
    margin-bottom: 12px;
    border-bottom: 1px solid #c8d8c8;
    padding-bottom: 6px;
}

.avail-round-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    font-size: 16px;
}

.avail-round-row input[type="checkbox"] {
    width: 22px;
    height: 22px;
    cursor: pointer;
}

.avail-round-name {
    flex: 1;
}

.avail-round-date {
    color: #888;
    font-size: 14px;
}

.avail-submit {
    margin: 24px 0;
    text-align: center;
}
.avail-who-out {
    margin-top: 32px;
}

.avail-round-block {
    margin-bottom: 20px;
}

.avail-round-heading {
    font-size: 15px;
    font-weight: bold;
    color: #333;
    margin-bottom: 6px;
}

.avail-none {
    color: #aaa;
    font-size: 14px;
    font-style: italic;
    margin: 0;
}

.avail-names {
    list-style: none;
    padding: 0;
    margin: 0;
}

.avail-names li {
    padding: 4px 0;
    font-size: 15px;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
}


/* ── Availability header ───────────────────────── */
.avail-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avail-header h1 {
    flex: 1;
    margin: 0;
}

.avail-save-top {
    font-size: 20px;
    padding: 8px 20px;
    white-space: nowrap;
}

/* ── App container ───────────────────────── */
.app-wrap {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
}

/* ── Availability two-column grid ───────────────────────── */
.avail-future-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 16px;
    margin-bottom: 24px;
}

/* ── Fix Future rounds heading spanning grid ───────────────────────── */
.avail-future-grid h2 {
    grid-column: 1 / -1;
}


/* ── Back link ───────────────────────── */
.back-link {
    display: inline-block;
    color: #ffffff;
    text-decoration: none;
    background: #4a6741;
    border: 2px solid #4a6741;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 14px;
    white-space: nowrap;
}
.back-link:hover {
    background: #3a5331;
}
/* ── Page header bar ───────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f5f0ea;
    border: 2px solid #8a7a6a;
    border-radius: 10px;
    padding: 10px 16px;
    margin-bottom: 20px;
}

.page-header h1 {
    flex: 1;
    margin: 0;
    font-size: 22px;
    color: #4a6741;
}


.btn-primary.avail-save-top {
    background: #f5f0ea;
    color: #ffffff;
    border: 2px solid #8a7a6a;
    font-size: 16px;
    padding: 6px 16px;
    border-radius: 6px;
}

.btn-primary.avail-save-top:hover {
    background: #3a5331;
}

}

/* ── Centre page header heading ───────────────────────── */
.page-header h1 {
    text-align: center;
}

/* ── Teams page ───────────────────────── */
.teams-round-label { text-align:center; font-size:14px; color:#4a6741; font-weight:600; margin-bottom:16px; }
.teams-card { background:#fff; border:1px solid #c8d8c8; border-radius:10px; margin-bottom:16px; overflow:hidden; }
.teams-card-header { background:#eef2ee; padding:10px 14px; display:flex; justify-content:space-between; align-items:center; }
.teams-name { font-size:16px; font-weight:700; color:#4a6741; }
.teams-div { font-size:12px; color:#666; margin-left:8px; }
.teams-ha { font-size:12px; font-weight:700; padding:2px 8px; border-radius:4px; }
.teams-ha.home { background:#d4edda; color:#155724; }
.teams-ha.away { background:#d1ecf1; color:#0c5460; }
.teams-ha.bye { background:#e2e3e5; color:#383d41; }
.teams-opponent { font-size:13px; color:#333; margin-left:6px; }
.teams-manager { font-size:13px; color:#555; padding:6px 14px; border-bottom:1px solid #eee; }
.teams-table { width:100%; border-collapse:collapse; font-size:13px; }
.teams-table th { background:#f5f0ea; color:#4a6741; font-weight:600; padding:6px 8px; text-align:left; border-bottom:1px solid #ddd; }
.teams-table td { padding:7px 8px; border-bottom:1px solid #f0f0f0; }
.teams-table tr:last-child td { border-bottom:none; }
.teams-table .rink-num { width:40px; text-align:center; font-weight:700; color:#4a6741; }
.teams-not-published { font-size:13px; color:#888; padding:12px 14px; }
