/* ═══════════════════════════════════════════════════════════════
   VS AMIGO — multiplayer game UI
   Used by Vokabel Lab (panel overlay) and DerDieDas (full screen).
═══════════════════════════════════════════════════════════════ */

/* ── Panel / screen wrapper ── */
.vs-panel {
  display: none;
  flex-direction: column;
  min-height: 100%;
  background: var(--bg, #f7f9fb);
  font-family: var(--font-sans, system-ui, sans-serif);
}
.vs-panel.vs-active { display: flex; }

/* ── Header ── */
.vs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border, #e5e5e5);
  background: var(--card, #fff);
  gap: 12px;
}
.vs-header-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.3px;
}
.vs-header-back {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
  line-height: 1;
  color: var(--text, #111);
}
.vs-header-back:hover { background: var(--border, #e5e5e5); }

/* ── Inner content ── */
.vs-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px 20px;
  gap: 20px;
  max-width: 540px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

/* ── Tab switch (crear / unirse) ── */
.vs-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: var(--border, #e8e8e8);
  padding: 4px;
  border-radius: 14px;
}
.vs-tab {
  padding: 10px;
  border: none;
  background: transparent;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  color: var(--muted, #888);
  transition: background .15s, color .15s;
}
.vs-tab.vs-tab-active {
  background: var(--card, #fff);
  color: var(--text, #111);
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

/* ── Section label ── */
.vs-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted, #888);
  margin-bottom: 8px;
}

/* ── Mode cards ── */
.vs-modes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.vs-mode-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 10px;
  border: 2px solid var(--border, #e5e5e5);
  border-radius: 16px;
  background: var(--card, #fff);
  cursor: pointer;
  font-family: inherit;
  transition: border-color .15s, background .15s;
}
.vs-mode-card:hover { border-color: var(--accent, #3aa9ab); }
.vs-mode-card.vs-mode-active {
  border-color: var(--accent, #3aa9ab);
  background: color-mix(in srgb, var(--accent, #3aa9ab) 8%, var(--card, #fff));
}
.vs-mode-icon { font-size: 28px; line-height: 1; }
.vs-mode-name { font-size: 12px; font-weight: 700; color: var(--text, #111); }
.vs-mode-desc { font-size: 11px; color: var(--muted, #888); text-align: center; line-height: 1.3; }

/* ── Config strip ── */
.vs-config-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.vs-config-btn {
  flex: 1;
  min-width: 64px;
  padding: 10px 8px;
  border: 2px solid var(--border, #e5e5e5);
  border-radius: 12px;
  background: var(--card, #fff);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  color: var(--muted, #888);
  transition: all .15s;
  text-align: center;
}
.vs-config-btn.vs-config-active {
  border-color: var(--accent, #3aa9ab);
  color: var(--accent, #3aa9ab);
  background: color-mix(in srgb, var(--accent, #3aa9ab) 8%, var(--card, #fff));
}

/* ── Input ── */
.vs-input {
  width: 100%;
  padding: 13px 16px;
  border: 2px solid var(--border, #e5e5e5);
  border-radius: 14px;
  font-size: 15px;
  font-family: inherit;
  background: var(--card, #fff);
  color: var(--text, #111);
  box-sizing: border-box;
  outline: none;
  transition: border-color .15s;
}
.vs-input:focus { border-color: var(--accent, #3aa9ab); }
.vs-input.vs-code-input {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: .18em;
  text-align: center;
  text-transform: uppercase;
}

/* ── Primary button ── */
.vs-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 14px;
  background: var(--accent, #3aa9ab);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  transition: opacity .15s;
  letter-spacing: -.1px;
}
.vs-btn:hover:not(:disabled) { opacity: .88; }
.vs-btn:disabled { opacity: .4; cursor: default; }
.vs-btn-ghost {
  background: transparent;
  border: 2px solid var(--border, #e5e5e5);
  color: var(--text, #111);
}

/* ── Room code display ── */
.vs-room-code {
  text-align: center;
  padding: 24px 20px;
  background: var(--card, #fff);
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 20px;
}
.vs-room-code-label { font-size: 13px; color: var(--muted, #888); margin-bottom: 10px; }
.vs-room-code-value {
  font-size: 48px;
  font-weight: 900;
  letter-spacing: .22em;
  color: var(--accent, #3aa9ab);
  line-height: 1;
  margin-bottom: 12px;
}
.vs-room-code-hint { font-size: 13px; color: var(--muted, #888); }
.vs-copy-btn {
  margin-top: 14px;
  padding: 8px 18px;
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 10px;
  background: var(--card, #fff);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .15s;
}
.vs-copy-btn:hover { border-color: var(--accent, #3aa9ab); }

/* ── Player slots ── */
.vs-players {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}
.vs-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 10px;
  border-radius: 16px;
  background: var(--card, #fff);
  border: 1px solid var(--border, #e5e5e5);
}
.vs-player-avatar { font-size: 32px; }
.vs-player-name { font-size: 14px; font-weight: 700; text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs-player-role { font-size: 11px; color: var(--muted, #888); }
.vs-player.vs-player-me { border-color: var(--accent, #3aa9ab); }
.vs-vs-badge {
  font-size: 18px;
  font-weight: 900;
  color: var(--muted, #888);
}
.vs-waiting-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--muted, #ccc);
  animation: vs-pulse 1.2s ease-in-out infinite;
}
@keyframes vs-pulse {
  0%, 100% { opacity: .3; }
  50%       { opacity: 1; }
}

/* ── Countdown ── */
.vs-countdown {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 96px;
  font-weight: 900;
  color: var(--accent, #3aa9ab);
  min-height: 200px;
  animation: vs-pop .4s ease;
}
@keyframes vs-pop {
  from { transform: scale(1.4); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* ── Live scoreboard ── */
.vs-scoreboard {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 8px;
  background: var(--card, #fff);
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 18px;
  overflow: hidden;
}
.vs-score-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 10px 10px;
  gap: 2px;
}
.vs-score-col.vs-score-me { background: color-mix(in srgb, var(--accent, #3aa9ab) 8%, var(--card, #fff)); }
.vs-score-name { font-size: 12px; font-weight: 700; color: var(--muted, #888); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs-score-value { font-size: 40px; font-weight: 900; letter-spacing: -1px; color: var(--text, #111); line-height: 1; }
.vs-score-lives { font-size: 18px; letter-spacing: 2px; min-height: 24px; }
.vs-score-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: var(--muted, #aaa);
  padding: 0 4px;
}

/* ── Timer bar ── */
.vs-timer-wrap {
  height: 6px;
  background: var(--border, #e5e5e5);
  border-radius: 3px;
  overflow: hidden;
}
.vs-timer-bar {
  height: 100%;
  background: var(--accent, #3aa9ab);
  border-radius: 3px;
  transition: width .5s linear;
}
.vs-timer-bar.vs-timer-warn { background: #e07a20; }
.vs-timer-bar.vs-timer-danger { background: #d93636; }
.vs-timer-label {
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted, #888);
  margin-top: 4px;
}

/* ── Word card (game area) ── */
.vs-word-card {
  text-align: center;
  padding: 28px 20px;
  background: var(--card, #fff);
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 20px;
}
.vs-word-translation { font-size: 13px; color: var(--muted, #888); margin-bottom: 8px; }
.vs-word-main { font-size: 42px; font-weight: 900; letter-spacing: -1.5px; line-height: 1; margin-bottom: 6px; }
.vs-word-type { font-size: 12px; color: var(--muted, #888); }

/* ── Article buttons ── */
.vs-articles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.vs-art-btn {
  padding: 18px 8px;
  border: 2px solid var(--border, #e5e5e5);
  border-radius: 16px;
  background: var(--card, #fff);
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
  font-family: inherit;
  transition: all .12s;
  color: var(--text, #111);
}
.vs-art-btn:hover:not(:disabled) { border-color: var(--accent, #3aa9ab); transform: translateY(-2px); }
.vs-art-btn:disabled { opacity: .5; cursor: default; }
.vs-art-btn.vs-correct {
  background: #d4f5e9;
  border-color: #2e9c6e;
  color: #1a6044;
}
.vs-art-btn.vs-wrong {
  background: #fde8e8;
  border-color: #d93636;
  color: #8b1a1a;
}

/* ── Result screen ── */
.vs-result {
  text-align: center;
  padding: 32px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.vs-result-trophy { font-size: 72px; line-height: 1; animation: vs-pop .4s ease; }
.vs-result-title { font-size: 28px; font-weight: 900; letter-spacing: -1px; }
.vs-result-subtitle { font-size: 15px; color: var(--muted, #888); }
.vs-result-scores {
  display: flex;
  gap: 16px;
  align-items: center;
  margin: 8px 0;
}
.vs-result-score-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.vs-result-score-num { font-size: 36px; font-weight: 900; color: var(--text, #111); }
.vs-result-score-name { font-size: 12px; color: var(--muted, #888); }

/* ── Status message ── */
.vs-status {
  text-align: center;
  font-size: 14px;
  color: var(--muted, #888);
  padding: 8px 0;
  min-height: 22px;
}
.vs-status-error { color: #d93636; }

/* ── Responsive ── */
@media (max-width: 480px) {
  .vs-modes { grid-template-columns: 1fr; gap: 8px; }
  .vs-mode-card { flex-direction: row; align-items: center; text-align: left; gap: 12px; }
  .vs-mode-icon { font-size: 24px; }
  .vs-mode-desc { display: none; }
  .vs-word-main { font-size: 34px; }
  .vs-countdown { font-size: 72px; }
  .vs-result-trophy { font-size: 56px; }
  .vs-result-title { font-size: 22px; }
}
