/*
Theme Name: OTV Gaming
Theme URI: https://otv.com
Author: OTV Team
Description: OTV - פורטל משחקים אונליין בעיצוב בהיר, RTL מלא
Version: 3.0.0
Text Domain: otv
Tags: gaming, rtl-language-support, right-to-left
*/

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --white:        #ffffff;
  --bg:           #f6f6f6;
  --bg-card:      #ffffff;
  --border:       #e8e8e8;
  --border-hover: #c8c8c8;
  --accent:       #5c6bc0;
  --accent-light: #e8eaf6;
  --accent-2:     #00bcd4;
  --text-dark:    #1a1a2e;
  --text-body:    #444460;
  --text-muted:   #888899;
  --radius-sm:    8px;
  --radius-md:    12px;
  --radius-lg:    16px;
  --radius-pill:  999px;
  --radius-card:  14px;
  --shadow-sm:    0 2px 8px rgba(0,0,0,0.08);
  --shadow-md:    0 6px 24px rgba(0,0,0,0.12);
  --shadow-hover: 0 10px 32px rgba(0,0,0,0.16);
  --header-h:     64px;
  --font:         'Assistant', 'Inter', 'Segoe UI', system-ui, sans-serif;
  --transition:   0.18s ease;
}

html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text-dark); line-height: 1.5; direction: ltr; text-align: left; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }
button, input { font-family: inherit; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f0f0f0; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }

/* LAYOUT */
#otv-wrapper { display: flex; flex-direction: column; min-height: 100vh; }
#otv-main { flex: 1; max-width: 1280px; margin: 0 auto; width: 100%; padding: 24px 20px 48px; }

/* HEADER */
#otv-header {
  position: sticky; top: 0; z-index: 500;
  background: var(--white); border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm); height: var(--header-h);
  display: flex; align-items: center; padding: 0 24px; gap: 16px;
}
.otv-logo { display: flex; align-items: center; gap: 8px; font-size: 1.5rem; font-weight: 800; color: var(--text-dark); flex-shrink: 0; letter-spacing: -0.5px; }
.otv-logo-icon { width: 36px; height: 36px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.otv-logo span { color: var(--accent); }

/* SEARCH */
.otv-search-wrap { flex: 1; max-width: 480px; position: relative; }
.otv-search-form { display: flex; align-items: center; position: relative; }
.otv-search-input {
  width: 100%; background: var(--bg); border: 2px solid var(--border);
  border-radius: var(--radius-pill); padding: 10px 18px 10px 100px;
  font-size: 0.9rem; color: var(--text-dark); outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.otv-search-input::placeholder { color: var(--text-muted); }
.otv-search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(92,107,192,0.15); background: var(--white); }
/* #9 חיפוש — כפתור בצד שמאל (RTL: ימין הוא התחלה, שמאל הוא סוף) */
.otv-search-btn {
  position: absolute; left: 6px;
  background: var(--accent); border: none; border-radius: var(--radius-pill);
  color: #fff; padding: 6px 14px; font-size: 0.8rem; font-weight: 600;
  cursor: pointer; transition: opacity var(--transition);
}
.otv-search-btn:hover { opacity: 0.85; }
.otv-search-icon { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.otv-search-results {
  position: absolute; top: calc(100% + 8px); right: 0; left: 0;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-md);
  z-index: 999; overflow: hidden; display: none;
}

/* HEADER ACTIONS — #3 הסרת כניסה/הרשמה: נשאר ריק או לוגו בלבד */
.otv-header-actions { display: flex; align-items: center; gap: 8px; margin-right: auto; flex-shrink: 0; }

/* CATEGORY BAR */
#otv-cat-bar { background: var(--white); border-bottom: 1px solid var(--border); position: sticky; top: var(--header-h); z-index: 400; }
.otv-cat-bar-inner { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; gap: 4px; padding: 0 20px; overflow-x: auto; scrollbar-width: none; }
.otv-cat-bar-inner::-webkit-scrollbar { display: none; }
.otv-cat-link { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 14px; color: var(--text-body); font-size: 0.78rem; font-weight: 600; white-space: nowrap; flex-shrink: 0; cursor: pointer; border-bottom: 3px solid transparent; transition: all var(--transition); text-decoration: none; }
.otv-cat-link:hover, .otv-cat-link.active { color: var(--accent); border-bottom-color: var(--accent); }
.otv-cat-link-icon { font-size: 1.3rem; line-height: 1; }
.otv-cat-link-label { line-height: 1; }

/* PAGE TITLE */
.otv-page-title { font-size: 1.5rem; font-weight: 800; color: var(--text-dark); margin-bottom: 20px; letter-spacing: -0.3px; }

/* SECTION HEADER */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-title { font-size: 1.05rem; font-weight: 700; color: var(--text-dark); display: flex; align-items: center; gap: 8px; }
.section-link { font-size: 0.8rem; font-weight: 600; color: var(--accent); }
.section-link:hover { text-decoration: underline; }

/* GAME GRID */
.games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(94px, 1fr)); gap: 12px; margin-bottom: 32px; }
.games-grid-md { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.games-grid-lg { grid-template-columns: repeat(auto-fill, minmax(204px, 1fr)); gap: 16px; }

/* GAME CARD */
.game-card { border-radius: var(--radius-card); overflow: hidden; cursor: pointer; background: var(--bg-card); transition: transform var(--transition), box-shadow var(--transition); position: relative; }
.game-card:hover { transform: translateY(-4px) scale(1.03); box-shadow: var(--shadow-hover); }
.game-card-thumb { width: 100%; aspect-ratio: 1/1; background: #e8eaf6; position: relative; overflow: hidden; }
.game-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.game-card:hover .game-card-thumb img { transform: scale(1.06); }
.game-card-thumb-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 2.8rem; background: linear-gradient(135deg, #e8eaf6, #f3f4fd); }
.game-card-play-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.35); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity var(--transition); }
.game-card:hover .game-card-play-overlay { opacity: 1; }
.play-btn-circle { width: 44px; height: 44px; background: var(--white); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; color: var(--accent); box-shadow: 0 4px 16px rgba(0,0,0,0.25); transform: scale(0.8); transition: transform var(--transition); }
.game-card:hover .play-btn-circle { transform: scale(1); }
.game-card-badge { position: absolute; top: 6px; right: 6px; background: var(--accent-2); color: #fff; font-size: 0.6rem; font-weight: 700; text-transform: uppercase; padding: 2px 7px; border-radius: var(--radius-pill); }
.game-card-title { font-size: 0.78rem; font-weight: 600; color: var(--text-dark); padding: 7px 8px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; background: var(--white); }

/* MOSAIC GRID */
.mosaic-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 32px; }
.mosaic-cell-lg { grid-column: span 2; grid-row: span 2; }
.mosaic-cell-md { grid-column: span 2; }
.mosaic-cell-sm { grid-column: span 1; }
.mosaic-card { border-radius: var(--radius-card); overflow: hidden; cursor: pointer; background: #e8eaf6; position: relative; transition: transform var(--transition), box-shadow var(--transition); aspect-ratio: 1/1; }
.mosaic-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.mosaic-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.mosaic-card:hover img { transform: scale(1.04); }
.mosaic-card-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 3.5rem; background: linear-gradient(135deg, #e8eaf6, #f3f4fd); }
.mosaic-card-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.3); opacity: 0; transition: opacity var(--transition); display: flex; align-items: center; justify-content: center; }
.mosaic-card:hover .mosaic-card-overlay { opacity: 1; }
.mosaic-card-title { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(to top, rgba(0,0,0,0.7), transparent); color: #fff; font-size: 0.82rem; font-weight: 600; padding: 20px 10px 8px; text-align: center; }

/* CATEGORY CARDS */
.category-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-bottom: 32px; }
.category-card { background: var(--white); border: 2px solid var(--border); border-radius: var(--radius-md); padding: 16px 10px 12px; text-align: center; cursor: pointer; transition: all var(--transition); }
.category-card:hover { border-color: var(--accent); background: var(--accent-light); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.cat-card-icon { font-size: 2rem; margin-bottom: 7px; display: block; }
.cat-card-name { font-size: 0.75rem; font-weight: 600; color: var(--text-body); }
.category-card:hover .cat-card-name { color: var(--accent); }

/* #4 BREADCRUMB — צד ימין */
.otv-breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 18px; justify-content: flex-end; }
.otv-breadcrumb a { color: var(--accent); }
.otv-breadcrumb a:hover { text-decoration: underline; }

/* CATEGORY HERO */
.category-hero { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px 28px; margin-bottom: 20px; display: flex; align-items: center; gap: 20px; box-shadow: var(--shadow-sm); }
.category-hero-icon-wrap { width: 72px; height: 72px; border-radius: var(--radius-md); background: var(--accent-light); display: flex; align-items: center; justify-content: center; font-size: 2.5rem; flex-shrink: 0; }
.category-hero-title { font-size: 1.4rem; font-weight: 800; margin-bottom: 4px; color: var(--text-dark); }
.category-hero-desc { color: var(--text-muted); font-size: 0.875rem; }

/* #11 CATEGORY TEXT AREAS */
.category-top-text { margin-bottom: 20px; color: var(--text-body); font-size: 0.9rem; line-height: 1.7; }
.category-bottom-text { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 0.875rem; line-height: 1.75; }
.category-bottom-text h2, .category-bottom-text h3 { color: var(--text-dark); margin-bottom: 8px; margin-top: 16px; }

/* #6 AD SLOTS */
.otv-ad-slot {
  background: var(--white); border: 2px dashed var(--border);
  border-radius: var(--radius-md); min-height: 90px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 0.75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
  margin: 20px 0; overflow: hidden;
}
.otv-ad-slot-leaderboard { min-height: 90px; }
.otv-ad-slot-rectangle { min-height: 250px; max-width: 300px; }
.otv-ad-slot-banner { min-height: 60px; }
.otv-ad-slot img, .otv-ad-slot ins, .otv-ad-slot > * { width: 100%; height: 100%; }

/* #7 GAME INFO SECTION (under game — like Poki) */
.game-info-section { margin-top: 28px; border-top: 1px solid var(--border); padding-top: 24px; }
.game-info-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.game-info-row:last-child { border-bottom: none; }
.game-info-label { font-weight: 700; color: var(--text-dark); display: flex; align-items: center; gap: 8px; }
.game-info-label-icon { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.9rem; flex-shrink: 0; }
.game-info-value { color: var(--text-body); }

/* GAME SINGLE */
.game-single-wrap { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }
.game-embed-area { background: #000; border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 16/9; position: relative; }
.game-embed-area iframe { width: 100%; height: 100%; border: none; }
.game-start-screen { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: #1a1a2e; color: #fff; }
.game-info-panel { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-sm); }
.game-info-title { font-size: 1.2rem; font-weight: 800; margin-bottom: 10px; }
.game-info-cats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.game-info-cat-badge { background: var(--accent-light); color: var(--accent); font-size: 0.72rem; font-weight: 600; padding: 4px 10px; border-radius: var(--radius-pill); }
/* #5 כפתור שחק — חץ שמאלה (RTL) */
.game-play-btn { width: 100%; padding: 14px; border: none; border-radius: var(--radius-md); background: var(--accent); color: #fff; font-size: 1rem; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; transition: all var(--transition); margin-bottom: 8px; box-shadow: 0 4px 12px rgba(92,107,192,0.3); }
.game-play-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.game-play-btn .play-arrow { font-size: 1rem; }
.game-fav-btn { width: 100%; padding: 10px; border: 2px solid var(--border); border-radius: var(--radius-md); background: transparent; color: var(--text-body); font-size: 0.875rem; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; transition: all var(--transition); }
.game-fav-btn:hover { border-color: #e91e63; color: #e91e63; }
.game-stats-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.game-stat-item { background: var(--bg); border-radius: var(--radius-sm); padding: 10px; text-align: center; }
.game-stat-value { font-size: 1rem; font-weight: 700; color: var(--accent); }
.game-stat-label { font-size: 0.68rem; color: var(--text-muted); margin-top: 2px; }

/* BUTTONS */
.otv-btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 20px; border-radius: var(--radius-pill); font-size: 0.85rem; font-weight: 600; cursor: pointer; border: none; transition: all var(--transition); }
.otv-btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 12px rgba(92,107,192,0.3); }
.otv-btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }

/* SEARCH PAGE */
.search-header { margin-bottom: 20px; }
.search-header h1 { font-size: 1.3rem; font-weight: 700; }
.search-count { color: var(--text-muted); font-size: 0.875rem; margin-top: 4px; }

/* LOAD MORE */
.load-more-wrap { text-align: center; margin: 8px 0 32px; }
.load-more-btn { display: inline-flex; align-items: center; gap: 8px; background: var(--white); border: 2px solid var(--border); border-radius: var(--radius-pill); padding: 11px 28px; font-size: 0.875rem; font-weight: 600; color: var(--text-body); cursor: pointer; transition: all var(--transition); }
.load-more-btn:hover { border-color: var(--accent); color: var(--accent); }

/* #1 FOOTER — Widget areas */
#otv-footer { background: var(--white); border-top: 1px solid var(--border); padding: 40px 24px 24px; margin-top: auto; }
.footer-inner { max-width: 1280px; margin: 0 auto; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 32px; }
.footer-brand-name { font-size: 1.3rem; font-weight: 800; margin-bottom: 10px; }
.footer-brand-name span { color: var(--accent); }
.footer-brand-desc { color: var(--text-muted); font-size: 0.85rem; line-height: 1.6; margin-bottom: 18px; }
.footer-socials { display: flex; gap: 8px; }
.footer-social-btn { width: 34px; height: 34px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 0.95rem; cursor: pointer; transition: all var(--transition); color: var(--text-body); text-decoration: none; }
.footer-social-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.footer-col-title { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 12px; }
.footer-nav-list { display: flex; flex-direction: column; gap: 8px; }
.footer-nav-list a { font-size: 0.85rem; color: var(--text-body); transition: color var(--transition); }
.footer-nav-list a:hover { color: var(--accent); }
.footer-widget-area { min-height: 40px; }
/* widget styles */
.footer-widget-area .widget { margin-bottom: 0; }
.footer-widget-area ul { display: flex; flex-direction: column; gap: 8px; }
.footer-widget-area ul li a { font-size: 0.85rem; color: var(--text-body); transition: color var(--transition); }
.footer-widget-area ul li a:hover { color: var(--accent); }
.footer-widget-area .widget-title { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 12px; }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 20px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.footer-copy { font-size: 0.8rem; color: var(--text-muted); }
.footer-legal { display: flex; gap: 16px; }
.footer-legal a { font-size: 0.78rem; color: var(--text-muted); }
.footer-legal a:hover { color: var(--accent); }

/* TOAST */
.otv-toast { position: fixed; bottom: 20px; left: 20px; z-index: 9999; background: var(--text-dark); color: #fff; border-radius: var(--radius-md); padding: 12px 18px; font-size: 0.875rem; font-weight: 500; display: flex; align-items: center; gap: 8px; box-shadow: var(--shadow-md); transform: translateY(80px); opacity: 0; transition: all 0.3s cubic-bezier(.34,1.56,.64,1); }
.otv-toast.show { transform: translateY(0); opacity: 1; }

.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* RESPONSIVE */
@media (max-width: 1024px) {
  .mosaic-grid { grid-template-columns: repeat(4, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .game-single-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  #otv-main { padding: 16px 12px 40px; }
  .mosaic-grid { grid-template-columns: repeat(3, 1fr); }
  .mosaic-cell-lg { grid-column: span 2; }
  .games-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 8px; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .category-hero { flex-direction: column; text-align: center; }
  .otv-search-input { padding: 10px 18px 10px 80px; }
}
@media (max-width: 480px) {
  .games-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .category-cards-grid { grid-template-columns: repeat(4, 1fr); }
  .mosaic-grid { grid-template-columns: repeat(2, 1fr); }
  .mosaic-cell-lg { grid-column: span 2; }
}
