.rp-main { max-width: 980px; }

.rp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.rp-head h1 { margin: 0; font-size: 1.8rem; }
.rp-controls { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.rp-controls select,
.rp-accounts input {
  height: 38px;
  padding: 0 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
}

#rp-student { min-width: 220px; }

.rp-name { margin: 0 0 0.8rem; font-size: 1.4rem; }

.rp-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.rp-tile {
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: grid;
  gap: 0.2rem;
}

.rp-tile small { color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; }
.rp-tile strong { font-size: 1.05rem; color: var(--gold-light); }

.rp-card { margin-bottom: 1rem; }
.rp-card h2 { margin: 0 0 0.4rem; font-size: 1.2rem; }
.rp-intro { margin: 0 0 0.6rem; }
.rp-big { margin: 0 0 0.8rem; }
.rp-table td, .rp-table th { white-space: nowrap; }
.rp-yes { color: #7fcf9a; }
.rp-no { color: #e06c6c; }

.rp-chart-wrap { margin: 0.4rem 0 1rem; }
.rp-chart { width: 100%; height: auto; display: block; background: rgba(255, 255, 255, 0.02); border-radius: 8px; }
.rp-grid { stroke: rgba(255, 255, 255, 0.08); stroke-width: 1; }
.rp-axis { fill: var(--muted); font-size: 11px; font-family: inherit; }

.rp-legend { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; margin-top: 0.4rem; font-size: 0.85rem; }
.rp-legend i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; margin-right: 0.35rem; vertical-align: middle; }

.rp-accounts { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.8rem; }
.rp-accounts input { flex: 1 1 180px; min-width: 0; }
.rp-site h3 { margin: 0.8rem 0 0.2rem; font-family: var(--font-body); font-size: 1rem; }
.rp-site h3 a { color: var(--gold-light); }

/* Targets */
.tg-block { margin-bottom: 1rem; }
.tg-block h3 { margin: 0 0 0.5rem; font-family: var(--font-body); font-size: 1rem; }
.tg-row { display: grid; gap: 0.25rem; padding: 0.55rem 0; border-top: 1px solid var(--border); }
.tg-goal { font-weight: 500; }
.tg-bar { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.tg-bar span { display: block; height: 100%; background: var(--gold); border-radius: 4px; }
.tg-row.met .tg-bar span { background: #7fcf9a; }
.tg-row.missed .tg-bar span { background: #e06c6c; }
.tg-result { font-size: 0.88rem; color: var(--muted); }
.tg-row.met .tg-result strong { color: #7fcf9a; }
.tg-row.missed .tg-result strong { color: #e06c6c; }
.tg-list-row small { display: inline; }

.tg-dialog { width: min(640px, calc(100% - 1.5rem)); }
.tg-form { display: grid; gap: 0.8rem; }
.tg-form-title { margin: 0; }
.tg-form .field { display: grid; gap: 0.3rem; font-size: 0.9rem; }
.tg-form input,
.tg-form select {
  height: 36px;
  padding: 0 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
}
.tg-form input[type="checkbox"] { height: auto; }
.tg-period { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.tg-items { display: grid; gap: 0.5rem; margin-bottom: 0.6rem; }
.tg-item { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.7rem; padding: 0.5rem 0.6rem; border-radius: 8px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border); }
.tg-item strong { flex: 1 1 100%; font-size: 0.88rem; }
.tg-item input[type="number"] { width: 5.5em; }
.tg-add { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* Tournaments */
.tn-card { padding: 0.8rem 0; border-top: 1px solid var(--border); }
.tn-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.8rem; flex-wrap: wrap; }
.tn-card h3 { margin: 0; font-family: var(--font-body); font-size: 1rem; }
.tn-prize { color: var(--gold-light); font-weight: 600; }
.tn-actions { display: flex; gap: 0.8rem; }
.tn-facts { margin: 0.25rem 0 0.4rem; font-size: 0.88rem; color: var(--muted); }
.tn-photos { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 0.4rem; }
.tn-photo { margin: 0; display: grid; gap: 0.25rem; width: 140px; }
.tn-photo-btn { padding: 0; border: 0; background: none; cursor: zoom-in; }
.tn-photo img { width: 140px; height: 175px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); background: rgba(255, 255, 255, 0.04); display: block; }
.tn-photo .ad-link { text-align: left; font-size: 0.82rem; }
.tn-dialog { width: min(680px, calc(100% - 1.5rem)); }
.tn-form h2 { margin: 0 0 0.8rem; }
.tn-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem 0.8rem; }
.tn-grid .field { display: grid; gap: 0.25rem; font-size: 0.85rem; }
.tn-grid .tn-wide { grid-column: 1 / -1; }
.tn-grid input,
.tn-grid select,
.tn-grid textarea {
  min-height: 36px;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
}
.tn-grid input[type="file"] { padding: 0.3rem; }
.tn-thumbs { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.7rem; }
.tn-thumb { display: grid; gap: 0.2rem; width: 90px; }
.tn-thumb img { width: 90px; height: 110px; object-fit: cover; border-radius: 6px; }
.tn-view { width: auto; max-width: min(900px, calc(100% - 1rem)); }
.tn-view img { display: block; max-width: 100%; max-height: 80vh; margin: 0 auto; border-radius: 8px; }

@media (max-width: 640px) {
  .tn-grid { grid-template-columns: 1fr 1fr; }
  .rp-head h1 { font-size: 1.4rem; }
  #rp-student { min-width: 0; flex: 1 1 100%; }
  .rp-tiles { grid-template-columns: repeat(2, 1fr); }
}
