/* حياة واقعية — أنماط الواجهة (موبايل فقط) */
:root {
  --glass: rgba(8, 12, 24, 0.55);
  --glass-border: rgba(255, 255, 255, 0.12);
  --fg: #f4f6fb;
  --muted: rgba(244, 246, 251, 0.62);
  --accent: #ffb24a;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; overflow: hidden; background: #0b1020; color: var(--fg); font-family: 'Cairo', system-ui, sans-serif; touch-action: manipulation; }
#game-root { position: fixed; inset: 0; }
#game-container { position: absolute; inset: 0; }
#game-container canvas { display: block; width: 100% !important; height: 100% !important; }

.hud { position: absolute; left: 10px; right: 10px; background: var(--glass); border: 1px solid var(--glass-border); border-radius: 16px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); padding: 10px 12px; pointer-events: none; }
.hud button { pointer-events: auto; }
.muted { color: var(--muted); font-size: 12px; }

#hud-top { top: calc(10px + var(--safe-top)); display: flex; justify-content: space-between; align-items: center; }
#clock-block { display: flex; flex-direction: column; align-items: flex-start; }
#clock { font-size: 34px; font-weight: 900; letter-spacing: 1px; font-variant-numeric: tabular-nums; line-height: 1; direction: ltr; }
#date-block { display: flex; flex-direction: column; align-items: flex-end; text-align: right; font-size: 13px; font-weight: 600; }

#hud-weather { top: calc(86px + var(--safe-top)); }
#location-row { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
#location-row i { color: var(--accent); }
#location-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { background: rgba(255,255,255,0.1); border: 1px solid var(--glass-border); color: var(--fg); width: 32px; height: 32px; border-radius: 10px; font-size: 13px; }
#weather-row { display: flex; align-items: baseline; gap: 10px; margin-top: 4px; }
#weather-temp { font-size: 30px; font-weight: 900; direction: ltr; }
#weather-text { font-size: 13px; font-weight: 600; }
#weather-details { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 4px; }
#weather-details b { color: var(--fg); font-weight: 700; }

#hud-bottom { bottom: calc(10px + var(--safe-bottom)); }
#phase-label { font-weight: 800; font-size: 14px; margin-bottom: 6px; }
#phase-label i { color: var(--accent); }
#sun-moon-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.cell { background: rgba(255,255,255,0.06); border-radius: 12px; padding: 6px 6px 5px; display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.cell i { font-size: 14px; opacity: 0.85; }
.cell .k { font-size: 11px; color: var(--muted); }
.cell b { font-size: 13px; font-weight: 800; direction: ltr; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.cell .muted { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.sun-ic { color: #ffd166; } .moon-ic { color: #cfe0ff; }
#data-sources { margin-top: 6px; font-size: 10px; text-align: center; }

/* Splash */
#splash { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 28px; background: radial-gradient(ellipse at 50% 30%, #1b2a55 0%, #0b1020 70%); z-index: 20; transition: opacity .5s ease; }
#splash.hidden { opacity: 0; pointer-events: none; }
#splash h1 { font-size: 40px; font-weight: 900; margin: 0 0 6px; letter-spacing: 1px; }
#splash p { margin: 4px 0; font-size: 15px; }
#splash-status { min-height: 20px; }
.primary-btn { margin-top: 18px; background: linear-gradient(135deg, #ffb24a, #ff7a3d); color: #1a1207; border: none; font-family: inherit; font-weight: 900; font-size: 18px; padding: 14px 34px; border-radius: 16px; box-shadow: 0 8px 24px rgba(255,140,60,0.35); }
.primary-btn:disabled { opacity: 0.6; }
.ghost-btn { margin-top: 10px; background: transparent; color: var(--fg); border: 1px solid var(--glass-border); font-family: inherit; font-size: 14px; padding: 10px 20px; border-radius: 12px; }

/* Dialog */
dialog { border: none; border-radius: 20px; background: #121a30; color: var(--fg); width: min(92vw, 420px); padding: 20px; font-family: inherit; }
dialog::backdrop { background: rgba(0,0,0,0.6); }
#location-form { display: flex; flex-direction: column; gap: 10px; }
#location-form h2 { margin: 0 0 4px; font-size: 20px; }
#location-form label { font-size: 13px; color: var(--muted); margin-top: 6px; }
#city-input { font-family: inherit; font-size: 16px; padding: 12px; border-radius: 12px; border: 1px solid var(--glass-border); background: rgba(255,255,255,0.06); color: var(--fg); }
#city-results { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow: auto; }
#city-results li { padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,0.05); margin-bottom: 6px; font-size: 14px; cursor: pointer; }
#city-results li:active { background: rgba(255,178,74,0.25); }

@media (max-height: 640px) { #clock { font-size: 26px; } .cell .muted { display: none; } }
