/* ============================================================
   base.css
   Global resets, typography, and shared utility styles
   used across every page of the site.
   ============================================================ */

/* ── Reset ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html { scroll-behavior: smooth; height: 100%; }

body {
  font-family: 'Lato', sans-serif;
  background: var(--bg-deep);
  color: var(--text);
  min-height: 100%;
  overflow-x: hidden;
}

/* ── Scrollbar ── */
::-webkit-scrollbar       { width: 4px; }
::-webkit-scrollbar-thumb { background: rgba(201,168,76,.2); border-radius: 2px; }

/* ── Animations ── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes pulse {
  0%,100% { opacity:1; transform:scale(1); }
  50%     { opacity:.6; transform:scale(1.15); }
}

/* ── Shared form inputs ── */
.form-label {
  font-family: 'Cinzel', serif;
  font-size: .62rem;
  letter-spacing: .11em;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
}

.form-input {
  background: var(--bg-surface2);
  border: 1px solid rgba(201,168,76,.18);
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--text);
  font-family: 'Lato', sans-serif;
  font-size: 1rem;
  outline: none;
  transition: border-color .18s;
  width: 100%;
  -webkit-appearance: none;
}
.form-input:focus        { border-color: var(--gold); }
.form-input::placeholder { color: rgba(154,144,128,.45); }
.form-input.has-error    { border-color: var(--error); }

.form-select {
  appearance: none;
  background: var(--bg-surface2)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7'%3E%3Cpath d='M1 1l4.5 4.5L10 1' stroke='%239a9080' fill='none' stroke-width='1.5'/%3E%3C/svg%3E")
    no-repeat right 10px center;
  border: 1px solid rgba(201,168,76,.18);
  border-radius: var(--radius);
  padding: 10px 28px 10px 12px;
  color: var(--text);
  font-family: 'Lato', sans-serif;
  font-size: 1rem;
  outline: none;
  width: 100%;
  cursor: pointer;
}
.form-select:focus { border-color: var(--gold); }

/* ── Shared buttons ── */
.btn-gold {
  padding: 12px 24px;
  background: var(--gold);
  color: #000;
  font-family: 'Cinzel', serif;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .09em;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .18s, transform .1s;
  width: 100%;
}
.btn-gold:hover           { background: var(--gold-light); }
.btn-gold:active          { transform: scale(.98); }
.btn-gold:disabled        { opacity: .45; cursor: not-allowed; transform: none; }

.btn-outline {
  padding: 12px 24px;
  background: transparent;
  color: var(--text-muted);
  font-family: 'Cinzel', serif;
  font-size: .73rem;
  letter-spacing: .07em;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .18s;
  width: 100%;
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }

/* ── Loading spinner ── */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(201,168,76,.25);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

/* ── Toast notification ── */
.toast {
  position: fixed;
  bottom: calc(var(--mob-tab-h) + var(--safe-bottom) + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--gold);
  color: #000;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-family: 'Cinzel', serif;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .05em;
  z-index: 900;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity .28s, transform .28s;
  opacity: 0;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
@media (min-width: 600px) { .toast { bottom: 2rem; } }

/* ── Modal overlay ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.85);
  z-index: 600;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
@media (min-width: 500px) {
  .modal-overlay { align-items: center; }
}

.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 440px;
  padding: 2rem 1.5rem;
  padding-bottom: max(2rem, var(--safe-bottom));
  animation: slideUp .22s ease-out;
}
@media (min-width: 500px) {
  .modal-box { border-radius: var(--radius-lg); padding: 2rem; }
}

/* ── Section title shared style ── */
.section-eyebrow {
  font-family: 'Cinzel', serif;
  font-size: .64rem;
  letter-spacing: .28em;
  color: var(--gold);
  margin-bottom: .7rem;
}

/* ── Grade colour classes ── */
.g-gem    { --g: #a855f7; }
.g-mint   { --g: #22c55e; }
.g-near   { --g: #84cc16; }
.g-good   { --g: #eab308; }
.g-played { --g: #f97316; }

.grade-dot   { width:7px; height:7px; border-radius:50%; background:var(--g,var(--text-muted)); }
.grade-label { font-size:.68rem; font-weight:700; letter-spacing:.04em; color:var(--g,var(--text-muted)); }
