/* FRIV2027 — Friv-style theme prototype (MORE vibrant than friv.com).
   Original design: dark purple gradient, neon-green graffiti logo,
   orange-yellow glossy buttons, capsule game tiles.
   The layout is inspired by Friv's style; no Friv logo, art or assets
   are used. All game art is our own. */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(1000px 500px at 15% -5%, rgba(255, 0, 200, .35), transparent 60%),
    radial-gradient(900px 500px at 90% 10%, rgba(0, 200, 255, .28), transparent 60%),
    linear-gradient(180deg, #5b00b8 0%, #7b00ff 30%, #4a00a0 55%, #2a0051 100%);
  background-attachment: fixed;
  color: #fff;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
.container { max-width: 1400px; margin: 0 auto; padding: 0 16px; }

/* ===== Hero — big graffiti logo, star, search icon (Friv-style) ===== */
.hero { padding: 26px 16px 8px; position: relative; }
.hero-inner { max-width: 1400px; margin: 0 auto; display: flex; align-items: center; justify-content: center; position: relative; min-height: 96px; }
.hero-star { position: absolute; left: 8px; top: 6px; font-size: 44px; color: #39ff14; text-shadow: 0 0 18px rgba(57, 255, 20, .9), 3px 3px 0 #000; transform: rotate(-12deg); }
.logo { font-family: "Arial Black", Arial, sans-serif; font-size: 72px; font-weight: 900; letter-spacing: 2px; line-height: 1; transform: rotate(-2deg) skewX(-4deg); text-decoration: none; }
.logo-letters { color: #39ff14; text-shadow: 3px 3px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 0 0 26px rgba(57, 255, 20, .75); }
.logo-digits { background: linear-gradient(180deg, #ffe259 0%, #ffa751 55%, #ff7a00 100%); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; filter: drop-shadow(3px 3px 0 #000) drop-shadow(0 0 18px rgba(255, 170, 0, .6)); }
.search-icon { position: absolute; right: 8px; top: 14px; width: 52px; height: 52px; border: 2px solid rgba(255, 255, 255, .35); border-radius: 14px; background: rgba(0, 0, 0, .45); color: #fff; font-size: 24px; cursor: pointer; }
.search-icon:hover { background: rgba(0, 0, 0, .65); border-color: #39ff14; }
.hero-tag { text-align: center; color: #e9d5ff; font-size: 17px; font-weight: 700; margin: 4px 0 14px; text-shadow: 1px 1px 2px rgba(0, 0, 0, .6); }
/* Compact hero (play page): slim bar, small logo, no tagline. */
.hero-compact { padding: 10px 16px; }
.hero-compact .hero-inner { min-height: 44px; justify-content: space-between; }
.hero-compact .hero-star { position: static; font-size: 26px; }
.hero-compact .logo { font-size: 30px; transform: none; }
.hero-compact .search-icon { position: static; width: 42px; height: 42px; font-size: 19px; }

/* ===== Category / A–Z overlay menu (opened by the search icon) ===== */
.menu-overlay { position: fixed; inset: 0; background: rgba(18, 0, 38, .94); z-index: 100; display: none; overflow-y: auto; padding: 30px 16px; }
.menu-overlay.open { display: block; }
.menu-panel { max-width: 920px; margin: 0 auto; background: linear-gradient(180deg, #4a00a0, #2a0051); border: 2px solid #b57cff; border-radius: 20px; padding: 28px 24px; position: relative; }
.menu-close { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 50%; border: 2px solid #fff; background: #ff5a5a; color: #fff; font-size: 17px; font-weight: 900; cursor: pointer; }
.menu-search { display: flex; margin: 6px 0 20px; }
.menu-search input { flex: 1; padding: 13px 16px; border: 2px solid #b57cff; border-right: none; border-radius: 999px 0 0 999px; font-size: 16px; outline: none; background: rgba(0, 0, 0, .35); color: #fff; }
.menu-search input::placeholder { color: #c9a8ff; }
.menu-search button { padding: 13px 22px; border: 2px solid #b57cff; border-radius: 0 999px 999px 0; background: linear-gradient(180deg, #ffd23f, #ff7a00); cursor: pointer; font-size: 17px; font-weight: 800; color: #4a1e00; }
.menu-heading { font-size: 18px; margin: 18px 0 10px; color: #ffd23f; }
.az-row { display: flex; flex-wrap: wrap; gap: 8px; }
.az-btn { min-width: 42px; height: 42px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; background: linear-gradient(180deg, #ffd23f 0%, #ff9d00 55%, #ff7a00 100%); color: #4a1e00; font-weight: 900; font-size: 17px; box-shadow: 0 3px 0 rgba(0, 0, 0, .45), inset 0 2px 0 rgba(255, 255, 255, .6); }
.az-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.cat-row { display: flex; flex-wrap: wrap; gap: 10px; }
.cat-btn { padding: 10px 18px; border-radius: 999px; background: rgba(255, 255, 255, .12); border: 2px solid #b57cff; font-weight: 800; font-size: 15px; }
.cat-btn:hover, .cat-btn.active { background: #39ff14; color: #0a2a00; border-color: #39ff14; }
.menu-foot { margin-top: 24px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .2); display: flex; gap: 20px; flex-wrap: wrap; font-weight: 700; }
.menu-foot a:hover { color: #39ff14; }
.topnav-user { font-weight: 700; color: #e9d5ff; }

/* ===== Page headings ===== */
.page-title { font-size: 26px; margin: 22px 0 6px; }
.page-sub { color: #d9b8ff; margin-bottom: 14px; line-height: 1.5; }
.filter-note { background: rgba(0, 0, 0, .4); border: 1px solid #b57cff; border-radius: 999px; padding: 10px 18px; margin: 14px 0; display: inline-block; }
.filter-note a { color: #ffd23f; font-weight: 800; }
.section-title { font-size: 22px; margin: 26px 0 14px; text-shadow: 1px 1px 3px rgba(0, 0, 0, .6); }
.friv-h1 { font-size: 24px; line-height: 1.4; margin: 30px 0 10px; text-shadow: 1px 1px 3px rgba(0, 0, 0, .6); }

/* ===== Friv-style capsule grid — one continuous grid, 5 per row ===== */
.friv-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 24px; }
.friv-tile { position: relative; display: block; aspect-ratio: 67 / 20; border-radius: 999px; overflow: hidden; border: 2px solid #b57cff; background: #3d0070; transition: transform .15s, box-shadow .15s, border-color .15s; }
.friv-tile:hover { transform: scale(1.04); border-color: #39ff14; box-shadow: 0 0 22px rgba(57, 255, 20, .55); z-index: 2; }
.friv-tile img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; display: block; }
.friv-tile-title { position: absolute; top: 0; left: 0; right: 0; padding: 16px 28px 0; font-size: 17px; font-weight: 900; color: #fff; text-shadow: 2px 2px 3px #000, 0 0 8px rgba(0, 0, 0, .8); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.2; }

/* ===== Game of the Day ===== */
.daily-card { display: flex; gap: 22px; align-items: stretch; background: rgba(0, 0, 0, .35); border: 2px solid #ffd23f; border-radius: 20px; padding: 18px; margin-bottom: 24px; }
.daily-card .friv-tile { flex: 0 0 420px; max-width: 420px; }
.daily-info { flex: 1; min-width: 0; }
.daily-info h3 { font-size: 22px; margin-bottom: 8px; }
.daily-info p { color: #e9d5ff; line-height: 1.5; }
.daily-meta { margin: 10px 0 14px; font-weight: 700; color: #fff; }

/* ===== Empty Google Ads slots — reserved space, no ads loaded yet ===== */
.ad-slot { border-radius: 12px; background: linear-gradient(180deg, #2f7bff, #1d4ed8); min-height: 90px; display: flex; align-items: center; justify-content: center; margin: 18px 0; }
.ad-leaderboard { max-width: 728px; height: 90px; margin: 18px auto; }
.ad-slot .ad-label { color: rgba(255, 255, 255, .85); font-size: 12px; letter-spacing: 2px; text-transform: uppercase; }
.ad-slot.ad-sidebar { min-height: 250px; }

/* ===== Play page — near-full-viewport stage + splash ===== */
.friv-stage { position: relative; width: 100%; height: min(84vh, 900px); min-height: 480px; display: flex; justify-content: center; background: #1a0033; border: 2px solid #b57cff; border-radius: 18px; overflow: hidden; margin: 14px 0 6px; box-shadow: 0 0 34px rgba(123, 0, 255, .5); }
.friv-stage iframe { border: 0; display: block; background: #79c7e8; }
.friv-stage.portrait iframe { height: min(100%, 166vw); aspect-ratio: 3 / 5; }
.friv-stage.square iframe { height: min(100%, 100vw); aspect-ratio: 1 / 1; }
.friv-stage.landscape iframe { width: min(100%, 160vh); aspect-ratio: 8 / 5; }
.friv-splash { position: absolute; inset: 0; z-index: 5; background: linear-gradient(180deg, rgba(75, 0, 184, .88) 0%, rgba(42, 0, 81, .92) 100%); display: flex; align-items: center; justify-content: center; transition: opacity .3s; }
.friv-stage.playing .friv-splash { opacity: 0; pointer-events: none; }
.rating-pill { position: absolute; top: 16px; right: 16px; background: rgba(0, 0, 0, .55); border: 1px solid rgba(255, 255, 255, .35); border-radius: 999px; padding: 8px 14px; font-weight: 900; font-size: 16px; }
.rating-pill .stars { color: #ffd23f; letter-spacing: 1px; }
.splash-play { width: 104px; height: 104px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, .9); background: radial-gradient(circle at 35% 30%, #ffe259 0%, #ffa751 45%, #ff7a00 100%); color: #fff; font-size: 42px; line-height: 1; cursor: pointer; box-shadow: 0 0 34px rgba(255, 170, 0, .8), inset 0 -6px 14px rgba(0, 0, 0, .25); text-shadow: 2px 2px 4px rgba(0, 0, 0, .45); padding-left: 8px; transition: transform .15s; }
.splash-play:hover { transform: scale(1.08); }
.splash-panel { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 22px; background: linear-gradient(180deg, transparent, rgba(26, 0, 51, .95) 40%); text-align: center; }
.splash-panel h1 { font-size: 26px; margin-bottom: 6px; }
.splash-panel p { color: #e9d5ff; line-height: 1.5; max-width: 720px; margin: 0 auto; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.play-title { font-size: 24px; margin: 16px 0 6px; }
.play-desc { color: #e9d5ff; line-height: 1.6; margin-bottom: 12px; }
.play-stats { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 10px 0; }
.stat { background: rgba(0, 0, 0, .4); border: 1px solid #b57cff; border-radius: 999px; padding: 8px 14px; font-weight: 700; font-size: 14px; }
.like-btn { border: none; background: linear-gradient(180deg, #ffd23f, #ff9d00); color: #4a1e00; border-radius: 999px; padding: 10px 18px; font-size: 15px; font-weight: 800; cursor: pointer; box-shadow: 0 3px 0 rgba(0, 0, 0, .4); }
.like-btn.liked { background: linear-gradient(180deg, #ff8fa3, #ff4d6d); color: #fff; }
.like-btn:disabled { opacity: .7; cursor: default; }

/* Forms / admin */
.form-card { background: #fff; color: #0f0f0f; border: 1px solid #e5e5e5; border-radius: 14px; padding: 20px; max-width: 640px; margin: 22px auto; }
.form-card label { display: block; font-weight: 700; margin: 12px 0 4px; }
.form-card input[type=text], .form-card input[type=password], .form-card select, .form-card textarea { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 8px; font-size: 15px; }
.form-card textarea { min-height: 90px; resize: vertical; }
.btn { display: inline-block; border: none; background: linear-gradient(180deg, #ffd23f, #ff7a00); color: #4a1e00; border-radius: 999px; padding: 11px 22px; font-size: 15px; font-weight: 800; cursor: pointer; box-shadow: 0 3px 0 rgba(0, 0, 0, .4); }
.btn:hover { filter: brightness(1.08); }
.btn.danger { background: #c0392b; color: #fff; }
.btn.small { padding: 7px 14px; font-size: 13px; }
.btn-play { font-size: 17px; padding: 13px 28px; }
.table { width: 100%; border-collapse: collapse; background: #fff; color: #0f0f0f; }
.table th, .table td { border: 1px solid #e5e5e5; padding: 9px; text-align: left; font-size: 14px; }
.table th { background: #f0f0f0; }
.notice { background: #fff3d6; color: #0f0f0f; border: 1px solid #f0c36d; border-radius: 10px; padding: 12px 14px; margin: 16px 0; }
.error { background: #fdecea; color: #0f0f0f; border: 1px solid #f5b7b1; border-radius: 10px; padding: 12px 14px; margin: 16px 0; }
.footer { border-top: 1px solid rgba(255, 255, 255, .25); background: rgba(0, 0, 0, .35); padding: 22px 0; margin-top: 30px; color: #e9d5ff; font-size: 14px; }
.footer .muted { font-size: 12px; margin-top: 6px; color: #c9a8ff; }

@media (max-width: 1100px) {
  .friv-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 900px) {
  .friv-grid { grid-template-columns: repeat(3, 1fr); }
  .logo { font-size: 52px; }
  .daily-card { flex-direction: column; }
  .daily-card .friv-tile { flex: none; max-width: none; }
}
@media (max-width: 520px) {
  .friv-grid { grid-template-columns: repeat(2, 1fr); }
  .logo { font-size: 38px; }
  .hero-star { font-size: 30px; }
  .search-icon { width: 44px; height: 44px; font-size: 20px; }
  .friv-tile-title { font-size: 14px; padding: 10px 28px 0; }
  .friv-stage { height: min(78vh, 700px); min-height: 380px; }
  .splash-play { width: 84px; height: 84px; font-size: 34px; }
  .splash-panel h1 { font-size: 20px; }
}

/* ===== Admin top bar (admin pages use their own header) ===== */
.topbar { background: rgba(0, 0, 0, .45); border-bottom: 1px solid rgba(255, 255, 255, .2); }
.topbar-inner { max-width: 1200px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 16px; }
.admin-logo { font-size: 20px; font-weight: 900; color: #fff; white-space: nowrap; }

/* ===== Admin v2 ===== */
.admin-nav { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.admin-nav a { color: #fff; text-decoration: none; font-weight: 700; font-size: 14px; padding: 8px 10px; border-radius: 8px; }
.admin-nav a:hover { background: rgba(255,255,255,.15); }
.admin-nav a.active { background: #ffd93d; color: #0f0f0f; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 18px 0; }
.stat-card { background: #fff; color: #0f0f0f; border: 1px solid #e5e5e5; border-radius: 14px; padding: 18px; text-align: center; }
.stat-num { font-size: 34px; font-weight: 900; line-height: 1.1; }
.stat-label { color: #666; font-weight: 700; margin-top: 6px; }
.admin-thumb { width: 40px; height: 56px; object-fit: cover; border-radius: 6px; vertical-align: middle; margin-right: 8px; }
.admin-filter { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; align-items: center; }
.admin-filter input[type=search] { flex: 1; min-width: 200px; padding: 10px; border: 1px solid #ccc; border-radius: 8px; font-size: 15px; }
.admin-filter select { padding: 10px; border: 1px solid #ccc; border-radius: 8px; font-size: 15px; }
.form-card input[readonly] { background: #f5f5f5; color: #666; }

/* ===== Player accounts + comments (v4) ===== */
.social-btn { text-decoration: none; }
.social-google { background: #fff; color: #0f0f0f; border: 1px solid #ccc; }
.social-google:hover { background: #f0f0f0; }
.social-facebook { background: #1877f2; color: #fff; }
.social-facebook:hover { background: #0d65d9; }
.comment-form { background: #fff; color: #0f0f0f; border: 1px solid #e5e5e5; border-radius: 14px; padding: 16px; margin: 16px 0; }
.comment-form textarea { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 8px; font-size: 15px; font-family: inherit; resize: vertical; }
.comment-list { margin: 16px 0 24px; }
.comment { display: flex; gap: 12px; background: #fff; color: #0f0f0f; border: 1px solid #e5e5e5; border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.comment-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.comment-avatar-initial { display: inline-flex; align-items: center; justify-content: center; background: #ffd93d; color: #0f0f0f; font-weight: 900; font-size: 18px; }
.comment-body { flex: 1; min-width: 0; }
.comment-body p { color: #333; font-size: 14px; line-height: 1.5; word-wrap: break-word; }
.comment-meta { margin-bottom: 4px; }
.comment-delete { background: none; border: none; color: #c0392b; font-size: 13px; cursor: pointer; padding: 0; margin-top: 6px; }
.comment-delete:hover { text-decoration: underline; }
.muted { color: #c9a8ff; font-size: 13px; }
/* Inside white cards the muted text needs a darker grey. */
.comment .muted, .form-card .muted { color: #909090; }
