/* ═══════════════════════════════════════════════════════════
   GOLGRID — Estilos
═══════════════════════════════════════════════════════════ */

:root {
  --g: #22c55e;
  --g-d: #16a34a;
  --g-glow: rgba(34,197,94,0.18);
}

/* ── Header ──────────────────────────────────────────────── */

.wc-header {
  position: sticky; top: 0; z-index: 900;
  height: 52px;
  background: rgba(7,18,7,0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(34,197,94,0.12);
}
.wc-header-inner {
  max-width: 720px; height: 100%;
  margin: 0 auto; padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.wc-back { color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 500; transition: color var(--t); }
.wc-back:hover { color: var(--g); }
.wc-logo-wrap { display: flex; align-items: center; gap: 7px; }
.wc-ball { font-size: 20px; }
.wc-logo { font-family: var(--font-d); font-size: 24px; letter-spacing: 1px; color: #fff; }
.wc-ucl-badge { width: 22px; height: 22px; object-fit: contain; }
.wc-header-date { font-size: 11px; color: var(--muted); }

/* ── Main ────────────────────────────────────────────────── */

.wc-main {
  height: calc(100dvh - 52px);
  display: flex; flex-direction: column;
  align-items: center;
  padding: 10px 12px 0;
  overflow: hidden;
  gap: 0;
}

.wc-loading {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: var(--muted); gap: 12px; font-size: 13px;
}
.wc-spinner {
  width: 30px; height: 30px;
  border: 3px solid rgba(34,197,94,0.12);
  border-top-color: var(--g);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.wc-error-msg { padding: 40px; text-align: center; color: var(--red); font-size: 14px; }
.wc-error-msg small { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; }

/* ── Game container ──────────────────────────────────────── */

.wc-game {
  width: 100%; max-width: 680px;
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* ── Grid ────────────────────────────────────────────────── */

.wc-grid-wrap {
  flex: 1; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  width: 100%;
}

.wc-grid {
  display: grid;
  gap: 6px;
}

/* ── Corner ──────────────────────────────────────────────── */

.wc-corner {
  background: transparent;
  border-radius: var(--r);
}

/* ── Column headers ──────────────────────────────────────── */

.wc-col-hdr, .wc-row-hdr {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: var(--surface);
  border: 1px solid rgba(34,197,94,0.15);
  border-radius: var(--r);
  gap: 4px; padding: 6px 4px;
  text-align: center;
  overflow: hidden;
}
.wc-club-logo {
  width: clamp(24px, 4.5vw, 40px);
  height: clamp(24px, 4.5vw, 40px);
  object-fit: contain;
  flex-shrink: 0;
}
.wc-club-short {
  font-size: clamp(7px, 1.3vw, 10px);
  font-weight: 700;
  color: var(--muted);
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ── Cells ───────────────────────────────────────────────── */

.wc-cell {
  border-radius: var(--r);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  overflow: hidden; padding: 4px;
  position: relative;
  transition: border-color var(--t), background var(--t);
}

.wc-cell--empty {
  background: var(--surface);
  border: 1.5px dashed rgba(255,255,255,0.08);
}
.wc-cell--empty .wc-plus-icon {
  width: clamp(18px, 3vw, 26px); height: clamp(18px, 3vw, 26px);
  color: var(--dim);
  transition: color var(--t);
}

.wc-cell--ok {
  background: linear-gradient(145deg, rgba(34,197,94,0.12), rgba(34,197,94,0.05));
  border: 1.5px solid rgba(34,197,94,0.45);
  box-shadow: 0 0 12px rgba(34,197,94,0.08);
  animation: cellPop 0.35s cubic-bezier(0.34,1.56,0.64,1);
}

.wc-cell--ko {
  background: rgba(239,68,68,0.07);
  border: 1.5px solid rgba(239,68,68,0.35);
  animation: cellShake 0.35s ease;
}

.wc-cell-check {
  font-size: clamp(14px, 2.5vw, 20px);
  margin-bottom: 4px;
  line-height: 1;
}
.wc-cell-name {
  font-size: clamp(8px, 1.5vw, 11px);
  font-weight: 700;
  color: var(--g);
  text-align: center;
  line-height: 1.3;
  word-break: break-word;
  max-width: 100%;
  padding: 0 3px;
}
.wc-cell-x       { font-size: clamp(18px, 3vw, 26px); color: var(--red); font-weight: 700; margin-bottom: 2px; }
.wc-cell-ko-name { font-size: clamp(7px, 1.2vw, 9px); color: rgba(239,68,68,0.7); text-align: center; line-height: 1.2; word-break: break-word; padding: 0 3px; }

@keyframes cellPop   { 0%,100%{ transform: scale(1); } 50%{ transform: scale(1.06); } }
@keyframes cellShake { 0%,100%{ transform: translateX(0); } 25%,75%{ transform: translateX(-5px); } 50%{ transform: translateX(5px); } }

/* ── End game ────────────────────────────────────────────── */

.wc-endgame {
  display: flex; align-items: center; justify-content: center;
  gap: 14px; flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid rgba(34,197,94,0.2);
  border-radius: var(--r-lg);
  width: 100%;
  animation: fadeUp 0.3s ease;
}
.wc-end-ring {
  display: inline-flex; align-items: baseline; justify-content: center;
  width: 56px; height: 56px; border-radius: 50%;
  border: 2.5px solid var(--g);
  font-family: var(--font-d); font-size: 22px; color: var(--g);
  flex-shrink: 0;
}
.wc-end-total { font-size: 13px; color: var(--muted); }
.wc-end-info  { flex: 1; min-width: 120px; }
.wc-end-label { font-weight: 700; font-size: 14px; color: var(--text); }
.wc-end-sub   { font-size: 11px; color: var(--muted); margin-top: 2px; }
.wc-share-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px;
  background: var(--g); color: #fff;
  border: none; border-radius: var(--r);
  font-size: 13px; font-weight: 700; font-family: var(--font);
  cursor: pointer; transition: var(--t); flex-shrink: 0;
}
.wc-share-btn:hover { background: var(--g-d); transform: translateY(-1px); }
.wc-copied { font-size: 11px; color: var(--g); display: none; width: 100%; text-align: center; margin: 0; }

/* ── Search bar (bottom) ─────────────────────────────────── */

.wc-searchbar {
  width: 100%; padding: 8px 0 12px; flex-shrink: 0;
}
.wc-searchbar-inner { position: relative; }

/* Dropdown: aparece hacia arriba */
.wc-dropdown {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid rgba(34,197,94,0.22);
  border-radius: var(--r-lg);
  max-height: 240px;
  overflow-y: auto;
  z-index: 500;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.45);
  display: none;
}
.wc-dropdown.open { display: block; animation: fadeUp 0.15s ease; }

.wc-opt {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; cursor: pointer; font-size: 13px;
  transition: background var(--t);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.wc-opt:last-child { border-bottom: none; }
.wc-opt:hover      { background: var(--surface-2); }
.wc-opt--used      { opacity: 0.35; cursor: not-allowed; }
.wc-opt-img {
  width: 32px; height: 32px; border-radius: 50%;
  object-fit: cover; background: var(--surface-3); flex-shrink: 0;
}
.wc-opt-name { flex: 1; font-weight: 500; }
.wc-opt-tag  { font-size: 10px; color: var(--muted); background: var(--surface-3); padding: 2px 7px; border-radius: 20px; }
.wc-no-results { padding: 18px; text-align: center; font-size: 13px; color: var(--muted); }

/* Pill de feedback */
.wc-feedback-pill {
  font-size: 12px; font-weight: 500;
  padding: 7px 14px; border-radius: var(--r);
  margin-bottom: 6px;
  animation: fadeUp 0.2s ease;
}
.wc-feedback--ok { color: var(--g);   background: rgba(34,197,94,0.1); }
.wc-feedback--ko { color: var(--red); background: rgba(239,68,68,0.08); }

/* Input row */
.wc-input-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 0 14px;
  transition: border-color var(--t), box-shadow var(--t);
}
.wc-input-row:focus-within {
  border-color: var(--g);
  box-shadow: 0 0 0 3px rgba(34,197,94,0.12);
}
.wc-input-icon { color: var(--muted); width: 16px; height: 16px; flex-shrink: 0; }
.wc-search-field {
  flex: 1; padding: 13px 0;
  font-size: 14px; font-family: var(--font);
  background: transparent; border: none;
  color: var(--text); outline: none;
}
.wc-search-field::placeholder { color: var(--dim); }
.wc-search-field:disabled { opacity: 0.35; cursor: not-allowed; }
.wc-clear-btn {
  display: flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface-3); border: none;
  color: var(--muted); font-size: 11px;
  cursor: pointer; transition: var(--t); flex-shrink: 0;
  font-family: var(--font);
}
.wc-clear-btn:hover { background: var(--red); color: #fff; }
