/* =========================================================
   أركيد بلاي — هوية بصرية بطابع "كارتردج الألعاب القديمة"
   ألوان: خلفية بنفسجية داكنة + إضاءات ذهبية ووردية وسماوية
   ========================================================= */

:root{
    --bg-deep:      #12101B;
    --bg-panel:     #1E1B2E;
    --bg-panel-2:   #262138;
    --line:         #35304a;
    --text-main:    #F4F1EA;
    --text-muted:   #9A93B0;
    --gold:         #FFC857;
    --pink:         #FF4D6D;
    --cyan:         #4EA8DE;
    --green:        #8CD867;
    --font-display: 'Cairo', sans-serif;
    --font-body:    'Tajawal', sans-serif;
    --font-pixel:   'Press Start 2P', cursive;
    --radius: 14px;
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }

body{
    margin:0;
    background: var(--bg-deep);
    background-image:
        radial-gradient(circle at 15% 0%, rgba(255,200,87,.08), transparent 45%),
        radial-gradient(circle at 90% 20%, rgba(255,77,109,.08), transparent 40%),
        radial-gradient(circle at 50% 100%, rgba(78,168,222,.07), transparent 40%);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
}

.container{ max-width: 1180px; margin: 0 auto; padding: 0 20px; }

a{ color: inherit; text-decoration: none; }
img{ max-width: 100%; display:block; }

::selection{ background: var(--pink); color: #12101B; }

:focus-visible{
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}

/* ---------- الترويسة ---------- */
.site-header{
    position: sticky; top:0; z-index: 50;
    background: rgba(18,16,27,.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.header-inner{
    display:flex; align-items:center; gap:24px;
    height:72px;
}
.logo{ display:flex; align-items:center; gap:10px; flex-shrink:0; }
.logo-badge{
    font-family: var(--font-pixel);
    font-size: 12px;
    color: var(--bg-deep);
    background: var(--gold);
    padding:6px 8px;
    border-radius: 6px;
    letter-spacing: 2px;
}
.logo-text{
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 22px;
}
.logo-accent{ color: var(--pink); }

.header-search{
    flex:1;
    display:flex;
    max-width: 420px;
    background: var(--bg-panel);
    border: 1px solid var(--line);
    border-radius: 999px;
    overflow:hidden;
}
.header-search input{
    flex:1;
    background:transparent;
    border:0;
    color: var(--text-main);
    padding: 10px 16px;
    font-family: var(--font-body);
    font-size: 14px;
}
.header-search input:focus{ outline:0; }
.header-search button{
    background: var(--gold);
    border:0;
    padding: 0 18px;
    cursor:pointer;
    font-size: 15px;
}

.header-nav{ display:flex; gap:20px; flex-shrink:0; }
.header-nav a{
    font-weight:700;
    font-size: 14px;
    color: var(--text-muted);
    transition: color .15s;
}
.header-nav a:hover{ color: var(--gold); }

/* ---------- الهيرو ---------- */
.hero{
    position:relative;
    padding: 64px 0 48px;
    overflow:hidden;
    border-bottom: 1px solid var(--line);
}
.hero-inner{ position:relative; z-index:2; text-align:center; }
.hero-eyebrow{
    display:inline-block;
    font-family: var(--font-pixel);
    font-size: 10px;
    color: var(--bg-deep);
    background: var(--green);
    padding: 6px 10px;
    border-radius: 6px;
    margin-bottom: 18px;
    letter-spacing: 1px;
}
.hero h1{
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(32px, 5vw, 54px);
    margin: 0 0 14px;
    line-height:1.2;
}
.hero h1 .hl{
    background: linear-gradient(90deg, var(--gold), var(--pink));
    -webkit-background-clip:text;
    background-clip:text;
    color:transparent;
}
.hero p{
    color: var(--text-muted);
    font-size: 17px;
    max-width: 560px;
    margin: 0 auto 30px;
}
.hero-marquee{
    display:flex; justify-content:center; gap:10px; flex-wrap:wrap;
}
.marquee-bulb{
    width:10px; height:10px; border-radius:50%;
    background: var(--gold);
    box-shadow: 0 0 10px var(--gold);
    animation: blink 1.6s infinite ease-in-out;
}
.marquee-bulb:nth-child(3n+1){ background: var(--pink); box-shadow:0 0 10px var(--pink); animation-delay:.2s; }
.marquee-bulb:nth-child(3n+2){ background: var(--cyan); box-shadow:0 0 10px var(--cyan); animation-delay:.4s; }
@keyframes blink{ 0%,100%{opacity:.35} 50%{opacity:1} }
@media (prefers-reduced-motion: reduce){
    .marquee-bulb{ animation: none; }
}

/* ---------- تصفية التصنيفات ---------- */
.filters{
    display:flex; gap:10px; flex-wrap:wrap; justify-content:center;
    padding: 26px 0 6px;
}
.filter-chip{
    font-family: var(--font-display);
    font-weight:700;
    font-size: 14px;
    padding: 9px 18px;
    border-radius: 999px;
    border: 2px solid var(--line);
    background: var(--bg-panel);
    color: var(--text-muted);
    transition: transform .12s, border-color .12s, color .12s;
}
.filter-chip:hover{ transform: translateY(-2px); }
.filter-chip.active{
    color: var(--bg-deep);
    background: var(--gold);
    border-color: var(--gold);
}

/* ---------- قسم عنوان ---------- */
.section{ padding: 40px 0; }
.section-title{
    font-family: var(--font-display);
    font-weight:900;
    font-size: 24px;
    margin: 0 0 22px;
    display:flex; align-items:center; gap:10px;
}
.section-title .num{
    font-family: var(--font-pixel);
    font-size: 12px;
    color: var(--bg-deep);
    background: var(--cyan);
    padding: 5px 8px;
    border-radius: 6px;
}

/* ---------- شبكة الألعاب (بطاقات "كارتردج") ---------- */
.games-grid{
    display:grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 22px;
}
.game-card{
    position:relative;
    background: var(--bg-panel);
    border:1px solid var(--line);
    border-radius: var(--radius);
    overflow:hidden;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
    display:flex; flex-direction:column;
}
.game-card:hover{
    transform: translateY(-6px);
    border-color: var(--card-accent, var(--gold));
    box-shadow: 0 14px 30px -12px var(--card-accent, var(--gold));
}
.game-card-thumb{
    position:relative;
    height: 150px;
    display:flex; align-items:center; justify-content:center;
    font-size: 54px;
    background:
        linear-gradient(160deg, color-mix(in srgb, var(--card-accent, var(--gold)) 30%, transparent), transparent 60%),
        var(--bg-panel-2);
}
.card-ribbon{
    position:absolute; top:12px; inset-inline-start:12px;
    font-family: var(--font-pixel);
    font-size: 9px;
    padding: 5px 8px;
    border-radius: 5px;
    background: var(--card-accent, var(--gold));
    color: var(--bg-deep);
}
.game-card-body{ padding: 16px; display:flex; flex-direction:column; gap:8px; flex:1; }
.game-card-body h3{
    font-family: var(--font-display);
    font-size: 17px;
    margin:0;
}
.game-card-body p{
    color: var(--text-muted);
    font-size: 13px;
    margin:0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.game-card-meta{
    margin-top:auto;
    display:flex; justify-content:space-between; align-items:center;
    font-size:12px; color: var(--text-muted);
    padding-top: 8px;
}
.game-card-meta .rating{ color: var(--gold); }
.card-play-btn{
    display:block; text-align:center;
    margin: 4px 16px 16px;
    padding: 10px;
    border-radius: 10px;
    font-family: var(--font-display);
    font-weight: 700;
    background: var(--card-accent, var(--gold));
    color: var(--bg-deep);
}

.empty-state{
    text-align:center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state .emoji{ font-size:42px; margin-bottom:10px; }

/* ---------- صفحة اللعبة ---------- */
.game-play-header{ padding: 26px 0 10px; }
.breadcrumb{ font-size:13px; color: var(--text-muted); margin-bottom:14px; }
.breadcrumb a{ color: var(--cyan); }
.game-title-row{
    display:flex; flex-wrap:wrap; align-items:center; gap:14px; justify-content:space-between;
}
.game-title-row h1{
    font-family: var(--font-display);
    font-weight:900;
    font-size: 30px;
    margin:0;
    display:flex; align-items:center; gap:10px;
}
.badge{
    font-family: var(--font-pixel);
    font-size: 9px;
    padding: 6px 9px;
    border-radius: 6px;
    background: var(--accent, var(--cyan));
    color: var(--bg-deep);
}

.arcade-cabinet{
    margin-top: 22px;
    background: linear-gradient(180deg, var(--bg-panel-2), var(--bg-panel));
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 18px;
    box-shadow: inset 0 0 0 2px rgba(255,255,255,.02);
}
.arcade-screen{
    position:relative;
    border-radius: 12px;
    overflow:hidden;
    background: #000;
    aspect-ratio: 16/10;
    border: 3px solid var(--bg-deep);
}
.arcade-screen iframe{
    width:100%; height:100%; border:0; display:block;
}
.arcade-cabinet-footer{
    display:flex; justify-content:space-between; align-items:center;
    padding-top: 14px; flex-wrap:wrap; gap:12px;
}
.play-count-tag{
    font-size:13px; color: var(--text-muted);
}

.rating-widget{ display:flex; align-items:center; gap:6px; }
.rating-widget button{
    background:none; border:0; cursor:pointer;
    font-size: 22px; color: var(--line);
    transition: color .12s, transform .12s;
}
.rating-widget button:hover,
.rating-widget button.active{ color: var(--gold); transform: scale(1.15); }
.rating-note{ font-size:12px; color: var(--text-muted); margin-inline-start:6px; }

.game-description{
    margin-top: 26px;
    background: var(--bg-panel);
    border:1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
}
.game-description h2{ font-family: var(--font-display); font-size:17px; margin-top:0; }
.game-description p{ color: var(--text-muted); margin-bottom:0; }

/* ---------- تذييل ---------- */
.site-footer{
    border-top: 1px solid var(--line);
    padding: 30px 0;
    text-align:center;
}
.footer-marquee{ display:flex; justify-content:center; gap:8px; margin-bottom:12px; color: var(--line); font-size:10px;}
.footer-marquee span:nth-child(odd){ color: var(--gold); }
.footer-links{ display:flex; justify-content:center; gap:18px; margin-bottom:10px; }
.footer-links a{ font-size:13px; color: var(--text-muted); font-weight:700; }
.footer-links a:hover{ color: var(--gold); }
.footer-inner p{ color: var(--text-muted); font-size:13px; margin:0; }

/* ---------- عناصر لوحة التحكم ---------- */
.admin-shell{ min-height:100vh; display:flex; }
.admin-sidebar{
    width: 230px; flex-shrink:0;
    background: var(--bg-panel);
    border-inline-end: 1px solid var(--line);
    padding: 22px 16px;
}
.admin-sidebar .logo{ margin-bottom: 30px; }
.admin-sidebar nav a{
    display:block; padding: 10px 12px; border-radius:8px;
    color: var(--text-muted); font-weight:700; font-size:14px; margin-bottom:4px;
}
.admin-sidebar nav a:hover, .admin-sidebar nav a.active{ background: var(--bg-panel-2); color: var(--gold); }
.admin-main{ flex:1; padding: 30px; max-width: 980px; }
.admin-topbar{ display:flex; justify-content:space-between; align-items:center; margin-bottom:24px; }
.admin-topbar h1{ font-family: var(--font-display); font-size:24px; margin:0; }

.stat-cards{ display:grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap:16px; margin-bottom: 28px;}
.stat-card{ background: var(--bg-panel); border:1px solid var(--line); border-radius: var(--radius); padding:18px; }
.stat-card .value{ font-family: var(--font-display); font-size:28px; font-weight:900; color: var(--gold); }
.stat-card .label{ color: var(--text-muted); font-size:13px; }

.admin-table{ width:100%; border-collapse: collapse; background: var(--bg-panel); border-radius: var(--radius); overflow:hidden; }
.admin-table th, .admin-table td{ padding: 12px 14px; text-align: start; border-bottom: 1px solid var(--line); font-size:14px; }
.admin-table th{ color: var(--text-muted); font-weight:700; background: var(--bg-panel-2); }
.admin-table tr:last-child td{ border-bottom:0; }
.table-actions a{ font-size:13px; margin-inline-end:10px; color: var(--cyan); font-weight:700; }
.table-actions a.danger{ color: var(--pink); }

.btn{
    display:inline-block; font-family: var(--font-display); font-weight:700;
    padding: 10px 20px; border-radius: 10px; border:0; cursor:pointer; font-size:14px;
}
.btn-primary{ background: var(--gold); color: var(--bg-deep); }
.btn-secondary{ background: var(--bg-panel-2); color: var(--text-main); border:1px solid var(--line); }
.btn-danger{ background: var(--pink); color: #24040c; }

.form-card{ background: var(--bg-panel); border:1px solid var(--line); border-radius: var(--radius); padding: 24px; max-width: 640px; }
.form-group{ margin-bottom:18px; }
.form-group label{ display:block; font-weight:700; margin-bottom:6px; font-size:14px; }
.form-group input, .form-group select, .form-group textarea{
    width:100%; padding: 10px 12px; border-radius:8px; border:1px solid var(--line);
    background: var(--bg-deep); color: var(--text-main); font-family: var(--font-body); font-size:14px;
}
.form-group textarea{ min-height: 100px; resize: vertical; }
.form-hint{ font-size:12px; color: var(--text-muted); margin-top:5px; }

.alert{ padding: 12px 16px; border-radius:10px; margin-bottom:18px; font-size:14px; }
.alert-error{ background: rgba(255,77,109,.12); border:1px solid var(--pink); color:#ffb3c0; }
.alert-success{ background: rgba(140,216,103,.12); border:1px solid var(--green); color:#c9f0b0; }

.login-shell{
    min-height:100vh; display:flex; align-items:center; justify-content:center;
    padding: 20px;
}
.login-card{
    width:100%; max-width:380px;
    background: var(--bg-panel); border:1px solid var(--line); border-radius: var(--radius);
    padding: 30px;
    text-align:center;
}
.login-card .logo{ justify-content:center; margin-bottom: 20px; }

@media (max-width: 720px){
    .header-search{ display:none; }
    .admin-shell{ flex-direction:column; }
    .admin-sidebar{ width:100%; border-inline-end:0; border-bottom:1px solid var(--line); }
}
