/* الشكل العام: الألوان، الصفحات، الجداول، البطاقات، النوافذ، الأيقونات */
body {
font-family: Arial, sans-serif;
background: #0f172a;
color: white;
margin: 0;
padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px));
}

header {
position: relative;
text-align: center;
padding: 18px 15px 20px;
background: #1e293b;
color: #2563eb;
font-weight: bold;
border-bottom: 1px solid #334155;
}

.notif-bell-btn {
position: absolute;
top: 15px;
left: 15px;
width: 38px;
height: 38px;
border-radius: 50%;
background: #0f172a;
border: 1px solid #334155;
color: #facc15;
display: flex;
align-items: center;
justify-content: center;
font-size: 17px;
cursor: pointer;
box-shadow: 0 2px 8px rgba(0,0,0,0.3);
margin: 0;
padding: 0;
z-index: 10;
transition: transform 0.2s ease, background 0.2s ease;
}

.notif-bell-btn .notif-dot{position:absolute;top:6px;right:7px;width:8px;height:8px;border-radius:50%;background:#64748b;border:2px solid #0f172a;}
.notif-bell-btn.on .notif-dot{background:#22c55e;}
.notif-bell-btn.off{color:#64748b;}
.notif-bell-btn:active {
transform: scale(0.92);
background: #1e293b;
}

.logo-box {
width: 110px;
height: 110px;
margin: 0 auto 12px;
display: flex;
align-items: center;
justify-content: center;
}

.logo {
width: 100%;
height: 100%;
object-fit: contain;
border-radius: 24px;
box-shadow: 0 0 0 1px rgba(147,197,253,.25), 0 10px 30px rgba(37,99,235,.35);
}

.league-name {
font-size: 22px;
line-height: 1.4;
color: white;
margin-bottom: 3px;
font-weight: 800;
}

#adminTitle {
cursor: pointer;
user-select: none;
font-size: 14px;
color: #60a5fa;
letter-spacing: 1px;
}

button {
margin: 10px auto;
display: block;
padding: 9px 14px;
background: #2563eb;
border: none;
color: white;
border-radius: 8px;
cursor: pointer;
font-size: 14px;
font-weight: bold;
transition: all 0.2s ease;
}

button:active {
transform: scale(0.97);
opacity: 0.9;
}

button:disabled {
opacity: .6;
cursor: not-allowed;
}

.share-btn-wa {
background: #25d366 !important;
color: white;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 6px;
box-shadow: 0 4px 10px rgba(37,211,102,0.3);
margin: 10px auto;
padding: 10px 18px;
border-radius: 20px;
font-size: 13px;
}

.league-quick-summary {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 8px;
margin: 12px auto;
max-width: 480px;
padding: 0 5px;
}

.summary-card {
background: #1e293b;
border: 1px solid #334155;
border-radius: 10px;
padding: 10px 6px;
text-align: center;
}

.summary-card-val {
font-size: 16px;
font-weight: bold;
color: #60a5fa;
}

.summary-card-lbl {
font-size: 10px;
color: #94a3b8;
margin-top: 3px;
}

.bottom-nav {
position: fixed;
bottom: 0;
left: 0;
right: 0;
height: 60px;
background: #1e293b;
border-top: 1px solid #334155;
display: flex;
justify-content: space-around;
align-items: center;
z-index: 999999;
box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.5);
padding-bottom: env(safe-area-inset-bottom, 0px);
}

.bottom-nav .tab {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
color: #94a3b8;
font-size: 12px;
font-weight: bold;
padding: 4px 0;
cursor: pointer;
transition: all 0.2s ease;
background: transparent;
text-decoration: none;
border: none;
height: 100%;
}

.bottom-nav .tab-icon {
font-size: 18px;
margin-bottom: 2px;
line-height: 1;
}

.bottom-nav .tab.active {
color: #60a5fa;
background: rgba(37, 99, 235, 0.12);
border-top: 3px solid #2563eb;
}

.section {
display: none;
padding: 10px;
}

.section.active {
display: block;
}

table {
width: 100%;
border-collapse: collapse;
margin-top: 10px;
background: #1e293b;
border-radius: 10px;
overflow: hidden;
border: 1px solid #334155;
}

th, td {
border: 1px solid #334155;
padding: 10px 6px;
text-align: center;
vertical-align: middle;
font-size: 13px;
}

th {
background: #0f172a;
color: #60a5fa;
}

.table-player-cell {
display: flex;
align-items: center;
justify-content: flex-start;
gap: 8px;
text-align: right;
width: 100%;
}

.table-player-img {
width: 28px;
height: 28px;
border-radius: 50%;
object-fit: cover;
border: 1.5px solid #2563eb;
background: #0f172a;
flex-shrink: 0;
}

.verified-badge {
color: #38bdf8;
font-size: 12px;
margin-right: 2px;
flex-shrink: 0;
}

.clickable-profile {
cursor: pointer;
transition: opacity 0.2s;
}

.clickable-profile:hover {
opacity: 0.85;
}

.match-filter-box {
display: flex;
gap: 8px;
margin: 10px auto;
max-width: 420px;
}

.match-filter-box input, .match-filter-box select {
flex: 1;
padding: 8px 12px;
background: #1e293b;
border: 1px solid #334155;
color: white;
border-radius: 8px;
font-size: 13px;
}

.match {
display: grid;
grid-template-columns: 1fr auto 1fr;
align-items: center;
margin: 10px auto;
background: #1e293b;
padding: 12px;
border-radius: 12px;
gap: 10px;
max-width: 420px;
border: 1px solid #334155;
box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.match-player {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 6px;
text-align: center;
overflow: hidden;
}

.match-player-img {
width: 48px;
height: 48px;
border-radius: 50%;
object-fit: cover;
border: 2px solid #2563eb;
background: #0f172a;
box-shadow: 0 2px 6px rgba(0,0,0,0.3);
flex-shrink: 0;
}

.match-player-name {
font-size: 13px;
font-weight: bold;
color: white;
display: flex;
align-items: center;
justify-content: center;
gap: 4px;
word-break: break-word;
}

.match-score-box {
display: flex;
align-items: center;
justify-content: center;
gap: 6px;
}

.match input {
width: 45px;
text-align: center;
background: #334155;
color: white;
border: 1px solid #475569;
border-radius: 6px;
padding: 6px;
font-weight: bold;
font-size: 15px;
}

.match input:focus {
outline: none;
background: #2563eb;
border-color: #60a5fa;
}

.match input:disabled {
opacity: 1;
color: white;
background: #0f172a;
border-color: #334155;
}

input, select {
-webkit-appearance: none;
appearance: none;
}

.mini-tabs {
display: flex;
margin-bottom: 10px;
background: #1e293b;
border-radius: 8px;
padding: 4px;
max-width: 420px;
margin-left: auto;
margin-right: auto;
}

.mini-tab {
flex: 1;
padding: 8px;
text-align: center;
cursor: pointer;
background: #475569;
font-size: 13px;
border-radius: 6px;
margin: 2px;
font-weight: bold;
color: white;
}

.mini-tab.active {
background: #2563eb;
}

#firebaseStatus {
text-align: center;
font-size: 12px;
padding: 7px;
color: #94a3b8;
}

#debugBox {
margin: 10px;
padding: 12px;
background: #1e293b;
border: 1px solid #475569;
border-radius: 8px;
font-size: 13px;
line-height: 1.9;
}

.account-box {
background: #1e293b;
padding: 15px;
border-radius: 10px;
margin: 10px auto;
max-width: 400px;
text-align: center;
border: 1px solid #334155;
box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.account-box input, .account-box select {
display: block;
width: 90%;
max-width: 350px;
margin: 8px auto;
padding: 10px;
background: #334155;
border: 1px solid #475569;
border-radius: 6px;
color: white;
box-sizing: border-box;
}

.account-box input:focus, .account-box select:focus {
outline: none;
border-color: #2563eb;
}

.account-buttons {
display: flex;
gap: 8px;
justify-content: center;
flex-wrap: wrap;
margin-top: 10px;
}

.logout-button {
background: #dc2626;
}

.login-message {
font-size: 13px;
color: #94a3b8;
margin: 8px;
}

.prediction-match {
background: #1e293b;
padding: 14px;
border-radius: 14px;
margin: 12px auto;
max-width: 430px;
border: 1px solid #334155;
box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.prediction-round {
text-align: center;
color: #60a5fa;
font-weight: bold;
margin-bottom: 12px;
font-size: 13px;
background: #0f172a;
padding: 5px 10px;
border-radius: 8px;
display: inline-block;
width: fit-content;
margin-left: auto;
margin-right: auto;
}

.prediction-teams-box {
display: grid;
grid-template-columns: 1fr auto 1fr;
align-items: center;
gap: 10px;
margin-bottom: 12px;
}

.prediction-player {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 6px;
text-align: center;
}

.prediction-player-img {
width: 46px;
height: 46px;
border-radius: 50%;
object-fit: cover;
border: 2px solid #2563eb;
background: #0f172a;
box-shadow: 0 2px 6px rgba(0,0,0,0.3);
flex-shrink: 0;
}

.prediction-player-name {
font-size: 13px;
font-weight: bold;
color: white;
display: flex;
align-items: center;
gap: 3px;
word-break: break-word;
}

.prediction-score {
display: flex;
align-items: center;
justify-content: center;
gap: 6px;
}

.prediction-score input {
width: 44px;
padding: 8px;
text-align: center;
background: #334155;
border: 1px solid #475569;
border-radius: 8px;
color: white;
font-weight: bold;
font-size: 16px;
}

.prediction-score input:focus {
outline: none;
border-color: #2563eb;
}

.prediction-score input:disabled {
opacity: .8;
background: #0f172a;
}

.prediction-save {
margin: 8px auto 0;
font-size: 13px;
padding: 8px 16px;
border-radius: 8px;
}

.prediction-result {
text-align: center;
font-size: 12px;
margin-top: 8px;
color: #94a3b8;
}

.prediction-points {
text-align: center;
margin-top: 8px;
font-weight: bold;
font-size: 13px;
}

.ranking-loading, .empty-ranking, .error-ranking {
text-align: center;
padding: 20px;
color: #94a3b8;
}

.ranking-title {
text-align: center;
margin-top: 5px;
margin-bottom: 15px;
color: white;
font-weight: bold;
}

.prediction-tabs {
display: flex;
margin: 10px 0;
background: #1e293b;
border-radius: 8px;
padding: 4px;
max-width: 480px;
margin-left: auto;
margin-right: auto;
}

.prediction-tab {
flex: 1;
padding: 10px;
text-align: center;
cursor: pointer;
background: #475569;
font-size: 14px;
border-radius: 6px;
margin: 2px;
font-weight: bold;
color: white;
}

.prediction-tab.active {
background: #2563eb;
}

.prediction-page {
display: none;
}

.prediction-page.active {
display: block;
}

.ranking-cards-container {
display: flex;
flex-direction: column;
gap: 8px;
margin: 10px auto;
max-width: 480px;
width: 100%;
box-sizing: border-box;
}

.user-card {
display: flex;
align-items: center;
background: #1e293b;
padding: 8px 12px;
border-radius: 10px;
border: 1px solid #334155;
justify-content: space-between;
position: relative;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
cursor: pointer;
}

.user-card.is-me {
border: 1.5px solid #3b82f6;
background: #1e293b;
box-shadow: 0 0 10px rgba(37, 99, 235, 0.25);
}

.user-card-rank {
font-weight: bold;
font-size: 14px;
width: 28px;
height: 28px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
color: #94a3b8;
background: #0f172a;
flex-shrink: 0;
}

.user-card-rank.rank-1 {
background: #facc15;
color: #0f172a;
font-size: 15px;
}

.user-card-rank.rank-2 {
background: #94a3b8;
color: #0f172a;
}

.user-card-rank.rank-3 {
background: #d97706;
color: white;
}

.user-card-profile {
display: flex;
align-items: center;
gap: 10px;
flex: 1;
margin: 0 10px;
overflow: hidden;
}

.user-card-avatar {
width: 36px;
height: 36px;
border-radius: 50%;
background: linear-gradient(135deg, #2563eb, #1d4ed8);
display: flex;
align-items: center;
justify-content: center;
font-weight: bold;
font-size: 15px;
color: white;
box-shadow: 0 2px 6px rgba(0,0,0,0.2);
flex-shrink: 0;
border: 1.5px solid #334155;
overflow: hidden;
}

.user-card-avatar img {
width: 100%;
height: 100%;
object-fit: cover;
}

.user-card-info {
display: flex;
flex-direction: column;
text-align: right;
overflow: hidden;
}

.user-card-name {
font-weight: bold;
color: white;
font-size: 14px;
display: flex;
align-items: center;
gap: 6px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

.user-me-badge {
font-size: 9px;
padding: 1px 5px;
border-radius: 8px;
background: #2563eb;
color: white;
font-weight: normal;
}

.user-card-stats {
font-size: 10px;
color: #94a3b8;
margin-top: 2px;
}

.user-card-score {
text-align: center;
background: #0f172a;
padding: 4px 10px;
border-radius: 8px;
border: 1px solid #334155;
flex-shrink: 0;
min-width: 48px;
}

.user-card-points {
font-size: 15px;
font-weight: bold;
color: #60a5fa;
line-height: 1.1;
}

.user-card-points-label {
font-size: 9px;
color: #94a3b8;
margin-top: 1px;
}

.profile-full-page {
max-width: 500px;
margin: 0 auto;
padding: 15px 5px;
position: relative;
}

.profile-header-card {
position: relative;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
background: #1e293b;
padding: 28px 15px 22px;
border-radius: 18px;
border: 1px solid #334155;
text-align: center;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
margin-bottom: 15px;
}

.settings-gear-btn {
position: absolute;
top: 15px;
left: 15px;
width: 36px;
height: 36px;
border-radius: 50%;
background: #0f172a;
border: 1px solid #334155;
color: #60a5fa;
display: flex;
align-items: center;
justify-content: center;
font-size: 18px;
cursor: pointer;
box-shadow: 0 2px 6px rgba(0,0,0,0.3);
transition: transform 0.2s ease;
}

.settings-gear-btn:active {
transform: scale(0.9);
}

.profile-avatar-wrapper {
position: relative;
margin-bottom: 12px;
cursor: pointer;
}

.profile-avatar-large {
width: 95px;
height: 95px;
border-radius: 50%;
background: linear-gradient(135deg, #2563eb, #1d4ed8);
color: white;
font-size: 40px;
font-weight: bold;
display: flex;
align-items: center;
justify-content: center;
border: 3px solid #3b82f6;
box-shadow: 0 4px 18px rgba(37, 99, 235, 0.45);
overflow: hidden;
object-fit: cover;
}

.profile-avatar-large img {
width: 100%;
height: 100%;
object-fit: cover;
}

.upload-photo-btn {
position: absolute;
bottom: 0;
right: -4px;
background: #2563eb;
border: 2px solid #1e293b;
color: white;
border-radius: 50%;
width: 32px;
height: 32px;
display: flex;
align-items: center;
justify-content: center;
font-size: 14px;
cursor: pointer;
box-shadow: 0 2px 8px rgba(0,0,0,0.4);
margin: 0;
padding: 0;
}

.profile-name-container {
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
margin-top: 4px;
}

.profile-name-text {
font-size: 21px;
font-weight: bold;
color: #ffffff;
}

.edit-name-btn {
background: rgba(37, 99, 235, 0.2);
border: 1px solid #2563eb;
color: #60a5fa;
border-radius: 50%;
width: 28px;
height: 28px;
display: flex;
align-items: center;
justify-content: center;
font-size: 14px;
cursor: pointer;
margin: 0;
padding: 0;
transition: transform 0.2s;
}

.edit-name-btn:active {
transform: scale(0.9);
}

.profile-email-text {
font-size: 13px;
color: #94a3b8;
margin-top: 4px;
direction: ltr;
}

.stats-grid-box {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 10px;
margin-bottom: 15px;
}

.stat-box-item {
background: #1e293b;
padding: 12px 10px;
border-radius: 12px;
border: 1px solid #334155;
text-align: center;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.stat-box-value {
font-size: 20px;
font-weight: bold;
color: #f8fafc;
}

.stat-box-label {
font-size: 11px;
color: #94a3b8;
margin-top: 3px;
}

.videos-container {
max-width: 450px;
margin: 25px auto 10px;
padding: 0 5px;
}

.video-section-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 12px;
border-bottom: 1px solid #334155;
padding-bottom: 8px;
}

.video-section-header h3 {
margin: 0;
color: #60a5fa;
font-size: 16px;
display: flex;
align-items: center;
gap: 6px;
}

.add-video-btn {
margin: 0;
padding: 6px 12px;
font-size: 12px;
background: #2563eb;
border-radius: 6px;
font-weight: bold;
}

.video-upload-form {
background: #1e293b;
padding: 12px;
border-radius: 12px;
border: 1px dashed #2563eb;
margin-bottom: 15px;
box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.video-upload-form input[type="text"], 
.video-upload-form input[type="file"] {
width: 100%;
box-sizing: border-box;
margin-bottom: 10px;
padding: 9px;
background: #334155;
border: 1px solid #475569;
color: white;
border-radius: 6px;
font-size: 13px;
}

.upload-progress {
font-size: 12px;
color: #facc15;
text-align: center;
margin-bottom: 8px;
font-weight: bold;
}

.video-card {
background: #1e293b;
border-radius: 12px;
border: 1px solid #334155;
overflow: hidden;
margin-bottom: 15px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.video-card video {
width: 100%;
max-height: 280px;
background: #0f172a;
display: block;
border-bottom: 1px solid #334155;
}

.video-info {
padding: 10px 12px;
}

.video-title {
font-weight: bold;
font-size: 14px;
color: #ffffff;
margin-bottom: 6px;
line-height: 1.4;
}

.video-date {
font-size: 11px;
color: #94a3b8;
display: flex;
justify-content: space-between;
align-items: center;
}

.video-delete-btn {
background: #dc2626;
margin: 0;
padding: 3px 8px;
font-size: 11px;
border-radius: 4px;
}

.modal-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(15, 23, 42, 0.85);
backdrop-filter: blur(4px);
display: none;
align-items: center;
justify-content: center;
z-index: 9999999;
padding: 15px;
}

.modal-overlay.active {
display: flex;
}

.modal-content {
background: #1e293b;
border: 1px solid #334155;
border-radius: 16px;
width: 100%;
max-width: 420px;
padding: 20px;
box-shadow: 0 10px 25px rgba(0,0,0,0.5);
position: relative;
max-height: 90vh;
overflow-y: auto;
}

.modal-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 15px;
border-bottom: 1px solid #334155;
padding-bottom: 10px;
}

.modal-header h3 {
margin: 0;
color: #60a5fa;
font-size: 17px;
}

.modal-back-btn {
background: #334155;
border: 1px solid #475569;
color: #60a5fa;
font-size: 13px;
font-weight: bold;
cursor: pointer;
padding: 6px 12px;
border-radius: 8px;
margin: 0;
display: flex;
align-items: center;
gap: 5px;
transition: background 0.2s;
}

.modal-back-btn:active {
background: #1e293b;
}

.admin-controls-box {
background: #0f172a;
padding: 12px;
border-radius: 10px;
margin: 15px auto;
border: 1px solid #334155;
text-align: center;
max-width: 420px;
}
.admin-controls-box h4 {
margin: 0 0 10px 0;
color: #60a5fa;
font-size: 14px;
}
.admin-btn-group {
display: flex;
gap: 8px;
justify-content: center;
flex-wrap: wrap;
}


/* ===== أيقونات SVG حقيقية بدل الإيموجي ===== */
.ic{display:inline-block;width:1.2em;height:1.2em;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;vertical-align:-0.22em;flex-shrink:0;overflow:visible;}
.ic.gold{color:#facc15;}
.ic.m1{color:#facc15;}.ic.m2{color:#cbd5e1;}.ic.m3{color:#fb923c;}
.bottom-nav .tab-icon .ic{width:23px;height:23px;vertical-align:top;}
.notif-bell-btn .ic{width:19px;height:19px;vertical-align:middle;}
.settings-gear-btn .ic{width:19px;height:19px;vertical-align:middle;}
.upload-photo-btn .ic{width:16px;height:16px;vertical-align:middle;}
.edit-name-btn .ic{width:14px;height:14px;vertical-align:middle;}
.modal-back-btn .ic{width:15px;height:15px;vertical-align:middle;}
.verified-badge .ic{width:15px;height:15px;vertical-align:-3px;}
.user-card-rank .ic{width:22px;height:22px;vertical-align:middle;}
.rc-btn .ic{width:19px;height:19px;vertical-align:middle;}
.rc-send .ic{width:18px;height:18px;vertical-align:middle;}
.fx-ico .ic,.game-row-ico .ic{width:26px;height:26px;color:#60a5fa;vertical-align:middle;}
.room-offline-icon .ic{width:46px;height:46px;color:#64748b;}
.mic-slot-empty .ic{width:20px;height:20px;vertical-align:middle;}
.mic-slot-muted-icon .ic{width:9px;height:9px;stroke-width:2.6;vertical-align:0;}
.game-note.live .ic{color:#f87171;width:.7em;height:.7em;}
.agora-status .ic{width:15px;height:15px;vertical-align:-3px;}
.room-toast .ic{width:16px;height:16px;vertical-align:-3px;}
#matchSearchInput{padding-right:36px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 12px center;background-size:16px;}
