/* SmarTokPlay: EduGames — dark theme matching the Android app */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #000;
  --surface: #111;
  --surface2: #1a1a1a;
  --border: #222;
  --pink: #ff4c68;
  --cyan: #00f3ff;
  --gold: #ffd700;
  --text: #fff;
  --muted: #888;
}

html, body { background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif; min-height: 100%; }
body { display: flex; flex-direction: column; min-height: 100vh; }

/* ═══ Header ═══ */
.topbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  background: rgba(0,0,0,0.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--surface2);
}
.icon-btn {
  background: none; border: none; color: var(--text);
  font-size: 1.4rem; cursor: pointer; padding: 4px 8px; line-height: 1;
}
.brand { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.brand-logo { width: 36px; height: 36px; border-radius: 8px; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-size: 1.15rem; font-weight: 800; letter-spacing: 0.3px; }
.brand-sub { font-size: 0.68rem; color: var(--muted); }
.header-right { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; }
.store-badge {
  font-size: 0.68rem; font-weight: 700; color: var(--cyan);
  border: 1px solid var(--cyan); border-radius: 20px; padding: 4px 10px;
  white-space: nowrap;
}
.lang-select {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 6px 8px; font-size: 0.8rem; cursor: pointer;
}

/* ═══ Drawer ═══ */
.drawer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  z-index: 190; opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.drawer-overlay.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; bottom: 0; inset-inline-start: 0;
  width: 280px; max-width: 85vw; z-index: 200;
  background: #0d0d0d; border-inline-end: 1px solid var(--border);
  transform: translateX(-105%); transition: transform 0.25s ease;
  overflow-y: auto; padding: 14px 12px 24px;
}
[dir="rtl"] .drawer { transform: translateX(105%); }
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.drawer-logo { width: 30px; height: 30px; border-radius: 7px; }
.drawer-title { font-weight: 700; flex: 1; }
.drawer-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: none; border: none; color: var(--text);
  font-size: 0.95rem; padding: 11px 12px; border-radius: 10px;
  cursor: pointer; text-align: start;
}
.drawer-item:hover { background: var(--surface2); }
.drawer-item.active { background: rgba(255,76,104,0.15); color: var(--pink); }
.drawer-section { margin: 16px 12px 6px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.drawer-categories .drawer-item { padding: 8px 12px; font-size: 0.85rem; color: #ccc; }

/* ═══ Search ═══ */
.searchbar {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; margin: 14px 16px 4px; padding: 10px 14px;
}
.search-icon { color: var(--muted); font-size: 0.9rem; }
#search-input {
  flex: 1; min-width: 0; background: none; border: none; outline: none;
  color: var(--text); font-size: 0.95rem; font-family: inherit;
}
#search-input::placeholder { color: #555; }
.search-clear { display: none; color: var(--muted); font-size: 0.9rem; }

/* ═══ Grid ═══ */
.content { flex: 1; padding: 12px 16px 24px; }
.games-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px)  { .games-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px)  { .games-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1280px) { .games-grid { grid-template-columns: repeat(5, 1fr); } }
@media (min-width: 1680px) { .games-grid { grid-template-columns: repeat(6, 1fr); } }

.game-card {
  position: relative; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  cursor: pointer; transition: transform 0.15s ease, border-color 0.15s;
}
.game-card:hover { transform: scale(1.025); border-color: var(--pink); }
.card-cover { width: 100%; aspect-ratio: 2 / 3; overflow: hidden; background: var(--surface2); }
.card-cover img {
  width: 100%; height: 100%; object-fit: cover;
  object-position: top center; display: block;
}
.card-star {
  position: absolute; top: 6px; inset-inline-end: 6px;
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(0,0,0,0.55); border: 1px solid rgba(255,255,255,0.15);
  color: #ddd; font-size: 0.95rem; cursor: pointer; z-index: 2;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}
.card-star.fav { color: var(--gold); }
.card-info { padding: 8px 10px 10px; min-height: 52px; }
.card-title {
  color: var(--text); font-size: 0.78rem; font-weight: 700; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-cat { color: var(--cyan); font-size: 0.65rem; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.loading { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 60px 0; }
.empty-state { text-align: center; padding: 70px 20px; }
.empty-icon { font-size: 3rem; color: #333; }
.empty-title { font-size: 1.1rem; font-weight: 700; margin-top: 12px; }
.empty-sub { color: var(--muted); font-size: 0.85rem; margin-top: 6px; }

/* ═══ Footer ═══ */
.footer { border-top: 1px solid var(--surface2); padding: 18px 16px 24px; text-align: center; }
.footer-badge {
  display: inline-block; font-size: 0.72rem; font-weight: 700; color: var(--cyan);
  border: 1px solid var(--cyan); border-radius: 20px; padding: 5px 14px; margin-bottom: 10px;
}
.footer-text { color: var(--muted); font-size: 0.75rem; }

/* ═══ Player overlay ═══ */
.player-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: #000; display: flex; flex-direction: column;
}
.player-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; background: rgba(13,13,13,0.95);
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.player-btn {
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 7px 12px; font-size: 0.85rem; font-weight: 600; cursor: pointer;
  white-space: nowrap;
}
.player-btn:hover { border-color: var(--pink); }
.player-title {
  flex: 1; text-align: center; font-size: 0.9rem; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.player-actions { display: flex; gap: 8px; }
#player-fav.fav { color: var(--gold); }
.player-frame { flex: 1; width: 100%; border: none; background: #000; }

@media (max-width: 480px) {
  .store-badge { display: none; }
  .brand-sub { display: none; }
  .player-btn span { display: none; }
  .player-title { font-size: 0.8rem; }
}
