/* ============================================================
   MEYCOIN — oyun seçim ekranı (çatı)
   Çatı NÖTR kalır; renk her kartın kendi oyunundan gelir.
   Böylece kartlar birer kapı gibi okunur: yeşil saha, petrol masa.
   ============================================================ */

#screen-hub {
  /* Çatı NÖTR: renk her kartın kendi oyunundan gelir. Değerler
     tokens.css'ten türer. */
  --ink: var(--ink-950);
  --ink-2: var(--ink-900);
  --line: var(--ink-600);
  --dim: var(--text-dim);
  --coin: var(--gold-400);
  --pitch: #2e7d32;
  --pitch-deep: #14361b;
  --felt: var(--teal-500);
  --felt-deep: var(--teal-600);
  font-family: var(--font);

  justify-content: flex-start;
  padding: 0;
  gap: 0;
  overflow-y: auto;
  color: var(--text);
  background:
    radial-gradient(1100px 520px at 50% -10%, rgba(232, 184, 75, 0.10), transparent 70%),
    radial-gradient(700px 400px at 12% 108%, rgba(46, 125, 50, 0.16), transparent 70%),
    radial-gradient(700px 400px at 88% 108%, rgba(27, 109, 140, 0.18), transparent 70%),
    linear-gradient(180deg, var(--ink-2), var(--ink));
}

.hub {
  width: 100%;
  max-width: 1060px;
  margin: 0 auto;
  padding: 16px 18px 40px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* ---------- üst şerit ---------- */
.hub-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.hub-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hub-user img {
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid var(--coin); object-fit: cover;
}
.hub-name { font-weight: 700; cursor: pointer; }
.hub-name:hover { color: var(--coin); }

.hub-chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hub-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.84rem;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}
.hub-chip-coin { color: var(--coin); font-weight: 700; }
button.hub-chip, a.hub-chip { cursor: pointer; }
button.hub-chip:hover, a.hub-chip:hover { border-color: var(--coin); }

/* ---------- kahraman ---------- */
.hub-hero { text-align: center; padding: 14px 0 2px; }
.hub-word {
  font-size: clamp(2.4rem, 9vw, 4.2rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 0.95;
  text-wrap: balance;
}
.hub-word span { color: var(--coin); }
.hub-sub {
  margin-top: 8px;
  color: var(--dim);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.74rem;
}

/* ---------- oyun kartları ---------- */
.hub-games {
  list-style: none;
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.hub-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
.hub-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}
.hub-card-futbol:hover { border-color: var(--pitch); }
.hub-card-okey:hover { border-color: var(--felt); }

/* Kart üstü: oyunun dünyasından bir kesit */
.hub-art {
  position: relative;
  height: 130px;
  overflow: hidden;
}
.hub-art-futbol {
  background: linear-gradient(160deg, var(--pitch), var(--pitch-deep));
}
/* Saha: orta çizgi + santra dairesi */
.hub-art-futbol::before {
  content: '';
  position: absolute;
  left: 50%; top: 0; bottom: 0;
  width: 2px;
  background: rgba(255, 255, 255, 0.28);
}
.hub-art-futbol::after {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  width: 74px; height: 74px;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
}
.hub-art-okey {
  background: linear-gradient(160deg, var(--felt), var(--felt-deep));
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
/* Masaya serpilmiş birkaç taş */
.hub-mini-tile {
  width: 34px; height: 48px;
  border-radius: 5px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 1.05rem;
  background: linear-gradient(180deg, var(--ivory-50), var(--ivory-200));
  box-shadow: inset 0 1px 0 #fff, 0 4px 8px rgba(0, 0, 0, 0.35);
}
.hub-mini-tile:nth-child(1) { transform: rotate(-7deg); color: var(--tile-red); }
.hub-mini-tile:nth-child(2) { transform: translateY(-6px); color: var(--tile-blue); }
.hub-mini-tile:nth-child(3) { transform: rotate(6deg); color: var(--tile-yellow); }

.hub-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px 18px;
  flex: 1;
}
.hub-card h3 { font-size: 1.25rem; }
.hub-blurb { color: var(--dim); font-size: 0.9rem; line-height: 1.45; }
.hub-meta {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-top: 2px;
}
.hub-tag {
  font-size: 0.72rem;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--dim);
}
.hub-build {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.68rem;
  color: var(--text-faint);
  letter-spacing: 0.06em;
}

.hub-tag-live { color: var(--ok-300); border-color: rgba(110, 227, 155, 0.4); }

.hub-play {
  margin-top: auto;
  padding: 12px 18px;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
}
.hub-card-futbol .hub-play { background: linear-gradient(180deg, #3a9a41, #1f6b27); }
.hub-card-okey .hub-play { background: linear-gradient(180deg, var(--teal-400), #10556f); }
.hub-play:hover { filter: brightness(1.12); }
.hub-play:focus-visible { outline: 2px solid var(--coin); outline-offset: 2px; }

@media (max-width: 560px) {
  .hub { padding: 12px 12px 32px; gap: 16px; }
  .hub-art { height: 106px; }
  .hub-hero { padding: 6px 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hub-card { transition: none; }
  .hub-card:hover { transform: none; }
}

/* ============================================================
   MEYCHIP — gösterge, günlük bonus ve görev paneli
   Tasarım sistemi (tokens.css) dışına çıkmaz. MeyChip'in kendi rengi
   vardır (--chip-400): altın MeyCoin demek olduğu için ikisi hub
   başlığında yan yana görüldüğünde ayırt edilebilmeli.
   ============================================================ */

.hub-chip-meychip {
  position: relative;
  border-color: var(--chip-500);
  color: var(--chip-300);
  cursor: pointer;
}
.hub-chip-meychip b { color: var(--chip-300); }
button.hub-chip-meychip:hover { border-color: var(--chip-400); }

/* Bekleyen ödül varsa yanan nokta: oyuncu paneli açmadan da fark etsin */
.chips-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ok-400);
  box-shadow: 0 0 0 2px var(--ink-900), 0 0 10px rgba(70, 192, 125, 0.8);
  animation: chipsPulse 1.8s ease-in-out infinite;
}
@keyframes chipsPulse { 50% { transform: scale(1.25); } }

.chips-card {
  position: relative;
  width: min(460px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--s4);
  padding: var(--s5);
  border-radius: var(--r-lg);
  background: var(--ink-900);
  border: 1px solid var(--ink-600);
  box-shadow: var(--e3);
  color: var(--text);
  font-family: var(--font);
}

.chips-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s3);
}
.chips-total { display: flex; flex-direction: column; gap: 2px; }
.chips-total-label {
  font-size: var(--fs-xs);
  letter-spacing: var(--track-wide);
  color: var(--chip-300);
}
.chips-total b {
  font-size: var(--fs-2xl);
  line-height: 1;
  color: var(--chip-400);
  font-variant-numeric: tabular-nums;
}
.chips-reset {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  margin-left: auto;
  margin-right: var(--s2);
  font-size: var(--fs-xs);
  color: var(--text-faint);
}
.chips-reset b { color: var(--text-dim); font-variant-numeric: tabular-nums; }

/* --- günlük bonus --- */
.chips-bonus {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
  border-radius: var(--r-md);
  background: var(--ink-800);
  border: 1px solid var(--chip-500);
}
.chips-bonus.done { border-color: var(--ink-600); opacity: 0.7; }
.chips-bonus-text { display: flex; flex-direction: column; gap: 2px; }
.chips-bonus-text b { font-size: var(--fs-md); }
.chips-bonus-text span { font-size: var(--fs-xs); color: var(--text-dim); }
.chips-bonus .okey-btn { margin-left: auto; flex: 0 0 auto; }

/* --- görevler --- */
.chips-quests { display: flex; flex-direction: column; gap: var(--s2); }
.chips-quests-title {
  margin: 0;
  font-size: var(--fs-xs);
  letter-spacing: var(--track-wide);
  color: var(--text-faint);
  text-transform: uppercase;
}
.chips-quest-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}
.chips-quest {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3);
  border-radius: var(--r-md);
  background: var(--ink-800);
  border: 1px solid var(--ink-600);
}
/* Durum RENKLE de anlatılır: hazır olan öne çıkar, kilitli geri çekilir */
.chips-quest.is-ready { border-color: var(--ok-400); }
.chips-quest.is-claimed { opacity: 0.6; }
.chips-quest.is-locked { opacity: 0.5; }

.chips-quest-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s2);
}
.chips-quest-head b { font-size: var(--fs-sm); font-weight: 650; }
.chips-quest-reward {
  color: var(--chip-300);
  font-size: var(--fs-sm);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.chips-bar {
  height: 6px;
  border-radius: var(--r-pill);
  background: rgba(0, 0, 0, 0.4);
  overflow: hidden;
}
.chips-bar span {
  display: block;
  height: 100%;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--chip-500), var(--chip-400));
  transition: width var(--t-mid) var(--ease);
}
.chips-quest.is-ready .chips-bar span {
  background: linear-gradient(90deg, #1d7a4a, var(--ok-400));
}

.chips-quest-foot {
  display: flex;
  justify-content: space-between;
  gap: var(--s2);
  font-size: var(--fs-xs);
  color: var(--text-faint);
}
.chips-quest-count { font-variant-numeric: tabular-nums; }
.chips-quest.is-ready .chips-quest-state { color: var(--ok-400); }
.chips-quest-main {
  flex: 1 1 auto;
  min-width: 0;          /* uzun gorev metni satiri tasirmasin */
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chips-quest-btn { flex: 0 0 auto; }

.chips-note {
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--text-faint);
  text-align: center;
}

/* Okey lobisindeki bakiye MeyChip'tir; rengi de öyle olsun */
.okey-chip-balance { color: var(--chip-300); }
.okey-chip-balance b { color: var(--chip-400); }

@media (prefers-reduced-motion: reduce) { .chips-dot { animation: none; } }

@media (max-width: 560px) {
  .chips-card { padding: var(--s4); gap: var(--s3); }
  .chips-total b { font-size: var(--fs-xl); }
}

/* Yatay telefon: dikey alan kit — panel ici kaydirmak yerine sikilasir */
@media (max-height: 560px) {
  .chips-card { padding: var(--s3) var(--s4); gap: var(--s2); }
  .chips-total b { font-size: var(--fs-xl); }
  .chips-bonus { padding: var(--s2) var(--s3); }
  .chips-quest { padding: var(--s2) var(--s3); }
  .chips-note { display: none; }
}
