/* Forge | game.css
   Gaming feel: glow on selection, animated gradient borders,
   tap ripples, floating avatar rings. Works in both themes. */

/* ---------- AVATAR PICKER ---------- */
.avatar-drop {
  width: 180px; height: 180px;
  margin: 0 auto;
  border-radius: 50%;
  position: relative;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  overflow: hidden;
  background: var(--surface-2);
  box-shadow:
    0 0 0 3px var(--surface),
    0 0 0 5px var(--primary),
    0 12px 32px rgba(79, 126, 255, 0.28);
  transition: transform var(--t-fast) var(--ease-in),
              box-shadow var(--t-fast) var(--ease-in);
}
.avatar-drop:active { transform: scale(0.97); }
.avatar-drop img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.avatar-drop .avatar-placeholder {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: var(--muted);
  gap: 6px;
}
.avatar-drop .avatar-placeholder svg {
  width: 42px; height: 42px;
  stroke: var(--primary);
}
.avatar-drop .avatar-placeholder span {
  font-size: 12px; font-weight: 500;
  color: var(--primary);
}
.avatar-drop .avatar-edit-badge {
  position: absolute;
  right: 6px; bottom: 6px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--gradient-forge);
  display: flex; align-items: center; justify-content: center;
  color: white;
  box-shadow: 0 4px 12px rgba(79, 126, 255, 0.5);
  pointer-events: none;
}
.avatar-drop .avatar-edit-badge svg {
  width: 18px; height: 18px;
  stroke: currentColor;
}

/* ---------- GAMES GRID ---------- */
.games-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-3);
  max-height: 56vh;
  overflow-y: auto;
  padding: 4px 4px 12px;
}
@media (min-width: 480px) {
  .games-grid { grid-template-columns: repeat(3, 1fr); }
}

.game-tile {
  position: relative;
  padding: var(--s-4) var(--s-3);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  transition:
    border-color var(--t-fast) var(--ease-in),
    background   var(--t-fast) var(--ease-in),
    transform    var(--t-fast) var(--ease-in),
    box-shadow   var(--t-fast) var(--ease-in);
}
.game-tile:active { transform: scale(0.96); }
.game-tile::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--gradient-soft);
  opacity: 0;
  transition: opacity var(--t-fast) var(--ease-in);
  pointer-events: none;
}
.game-tile.on {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow:
    0 0 0 3px rgba(79, 126, 255, 0.18),
    0 8px 22px rgba(79, 126, 255, 0.22);
}
.game-tile.on::before { opacity: 1; }

.game-tile .game-art {
  width: 46px; height: 46px;
  margin: 0 auto 10px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--gradient-forge);
  color: #fff;
  box-shadow: 0 6px 16px rgba(79, 126, 255, 0.28);
}
.game-tile .game-art svg {
  width: 24px; height: 24px;
  stroke: currentColor;
}
.game-tile .game-name {
  font-size: 12px; font-weight: 600;
  color: var(--text);
  line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  min-height: 30px;
}

.game-tile .check {
  position: absolute;
  top: 8px; right: 8px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transform: scale(0.4);
  transition:
    opacity var(--t-normal) var(--ease-in),
    transform var(--t-normal) var(--ease-in);
}
.game-tile.on .check {
  opacity: 1;
  transform: scale(1);
  animation: check-pop 380ms var(--ease-in);
}
.game-tile .check svg {
  width: 13px; height: 13px;
  stroke: currentColor;
  stroke-width: 3;
}
@keyframes check-pop {
  0%   { transform: scale(0.4); }
  60%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* ---------- STEP HEADERS (richer look) ---------- */
.ob-title {
  background: var(--gradient-forge);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.ob-sub {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  max-width: 420px;
}

/* ---------- STEP TRANSITIONS ---------- */
.ob-step.on {
  animation: step-slide 320ms var(--ease-in);
}
@keyframes step-slide {
  from { opacity: 0; transform: translateX(14px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ---------- PROGRESS DOTS (glowing active) ---------- */
.ob-dot.on {
  background: var(--gradient-forge);
  box-shadow: 0 0 8px rgba(79, 126, 255, 0.5);
}

/* ---------- BUTTONS: ripple on tap ---------- */
.btn-gradient {
  position: relative;
  overflow: hidden;
}
.btn-gradient::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transform: translate(-50%, -50%);
  transition: width 500ms var(--ease-in),
              height 500ms var(--ease-in),
              opacity 500ms var(--ease-in);
  opacity: 0;
  pointer-events: none;
}
.btn-gradient:active::after {
  width: 240px; height: 240px;
  opacity: 1;
  transition: 0s;
}

/* ---------- SEARCH INPUT: pill with icon ---------- */
.ob-search { position: relative; margin-bottom: var(--s-3); }
.ob-search input {
  padding-left: 44px;
  background: var(--surface);
  border-radius: var(--r-pill);
}
.ob-search::before {
  content: '';
  position: absolute;
  left: 16px; top: 50%;
  width: 14px; height: 14px;
  margin-top: -8px;
  border: 2px solid var(--muted-2);
  border-radius: 50%;
  pointer-events: none;
}
.ob-search::after {
  content: '';
  position: absolute;
  left: 29px; top: 50%;
  width: 6px; height: 2px;
  margin-top: 5px;
  background: var(--muted-2);
  transform: rotate(45deg);
  pointer-events: none;
}

/* ---------- SELECTED COUNTER (pill) ---------- */
.ob-counter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
}

/* ---------- GAME LETTER MARK (replaces generic gamepad) ---------- */
.game-art {
  width: 48px; height: 48px;
  margin: 0 auto 10px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: #FFFFFF;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.5px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28),
              inset 0 1px 0 rgba(255,255,255,0.22);
  position: relative;
  overflow: hidden;
}
.game-art::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.18), transparent);
  pointer-events: none;
}
.game-art-mark {
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 2px rgba(0,0,0,0.35);
}
.game-tile.on .game-art {
  transform: scale(1.05);
  transition: transform 240ms var(--ease-in);
}

/* ---------- LANGUAGE/CITY PICKER: style the native <select> ---------- */
select.input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238A93A8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px;
  padding-right: 44px;
  cursor: pointer;
}
select.input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
