/* Portail multi-jeux — Valentine & Cassandre (Mobile + iPad Portrait & Paysage) */

:root {
  --ink: #2D1E4B;
  --ink-soft: #665884;
  --surface: #FFFFFF;
  --font-round: 'SF Pro Rounded', 'Nunito', 'Quicksand', ui-rounded, 'Trebuchet MS', system-ui, -apple-system, sans-serif;
  --shadow-card: 0 10px 26px rgba(74, 44, 109, 0.10);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100svh;
  max-width: 100%;
  overflow-x: clip;
  font-family: var(--font-round);
  color: var(--ink);
  background: radial-gradient(circle at 12% 8%, #FFFDF8 0%, #FFF3E3 45%, #F2EBFF 100%);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.hidden {
  display: none !important;
}

.hub-shell {
  width: 100%;
  min-height: 100svh;
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: calc(14px + env(safe-area-inset-top, 0px))
           calc(14px + env(safe-area-inset-right, 0px))
           calc(12px + env(safe-area-inset-bottom, 0px))
           calc(14px + env(safe-area-inset-left, 0px));
  gap: 14px;
}

/* ==================== HEADER & FILTRES ==================== */
.hub-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 0 0 auto;
}

.hub-brand {
  width: 100%;
  border: 3px solid #FFD6BF;
  border-radius: 26px;
  background: linear-gradient(135deg, #FFFFFF 0%, #FFF7EA 100%);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 7px 0 rgba(255, 122, 89, 0.15), var(--shadow-card);
  cursor: pointer;
  font-family: inherit;
  color: inherit;
}

.hub-brand:active {
  transform: scale(0.98);
}

.hub-brand-icons {
  font-size: 32px;
  line-height: 1;
}

.hub-brand-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1 1 auto;
}

.hub-title {
  font-size: clamp(22px, 4.8vw, 32px);
  font-weight: 900;
  line-height: 1.08;
  background: linear-gradient(90deg, #FF5D73, #FF8C3B, #7E5BFF);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hub-subtitle {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-soft);
}

.hub-sound-pill {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #FFE599;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.profile-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.profile-tab {
  border: 2.5px solid #E9DEFF;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  padding: 10px 8px;
  font-family: inherit;
  font-size: clamp(14px, 3.4vw, 17px);
  font-weight: 900;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(74, 44, 109, 0.10);
  transition: transform 130ms ease, background 150ms ease, color 150ms ease;
}

.profile-tab:active {
  transform: scale(0.96);
}

.profile-tab--active {
  background: linear-gradient(135deg, #FF7A59, #FF5D9E);
  color: #FFFFFF;
  border-color: #FFFFFF;
  box-shadow: 0 5px 0 #C7336D;
}

.profile-tab--cassandre.profile-tab--active {
  background: linear-gradient(135deg, #7E5BFF, #32B8FF);
  box-shadow: 0 5px 0 #3E39B5;
}

/* ==================== SECTIONS & CARTES DE JEUX ==================== */
.hub-content {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.profile-section {
  background: rgba(255, 255, 255, 0.64);
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 26px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 8px 22px rgba(74, 44, 109, 0.06);
}

.profile-section--valentine {
  background: linear-gradient(180deg, rgba(255, 245, 238, 0.92), rgba(255, 236, 244, 0.84));
  border-color: #FFD5C4;
}

.profile-section--cassandre {
  background: linear-gradient(180deg, rgba(242, 238, 255, 0.92), rgba(232, 246, 255, 0.84));
  border-color: #D2C5FF;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.section-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: clamp(19px, 4.2vw, 24px);
  font-weight: 900;
}

.level-chip {
  font-size: 12px;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 999px;
  background: #FFFFFF;
  color: var(--ink-soft);
  box-shadow: 0 2px 6px rgba(74, 44, 109, 0.08);
}

.games-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.game-card {
  position: relative;
  text-decoration: none;
  border-radius: 22px;
  padding: 15px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #FFFFFF;
  border: 3px solid rgba(255, 255, 255, 0.45);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: transform 140ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 140ms ease;
}

.game-card:active {
  transform: scale(0.97);
}

.game-card--coral {
  background: linear-gradient(135deg, #FF7A59 0%, #FF4F93 100%);
  box-shadow: 0 7px 0 #C7336D, 0 12px 24px rgba(255, 79, 147, 0.26);
}

.game-card--sky {
  background: linear-gradient(135deg, #38BDF8 0%, #3B7BFF 100%);
  box-shadow: 0 6px 0 #2456BD;
}

.game-card--mint {
  background: linear-gradient(135deg, #22C58B 0%, #0EA5A0 100%);
  box-shadow: 0 6px 0 #0D7A72;
}

.game-card--violet {
  background: linear-gradient(135deg, #8B5CF6 0%, #6366F1 100%);
  box-shadow: 0 6px 0 #4F46E5;
}

.game-card--berry {
  background: linear-gradient(135deg, #D946EF 0%, #EC4899 100%);
  box-shadow: 0 6px 0 #A21CAF;
}

.game-card--amber {
  background: linear-gradient(135deg, #F59E0B 0%, #F97316 100%);
  box-shadow: 0 6px 0 #C2410C;
}

.game-card--soon {
  opacity: 0.72;
  filter: saturate(0.75);
}

.game-icon {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.24);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  flex: 0 0 auto;
}

.game-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
}

.game-top-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.game-title {
  font-size: clamp(19px, 4.4vw, 23px);
  font-weight: 900;
  line-height: 1.1;
}

.game-badge {
  font-size: 11px;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  color: #FFFFFF;
}

.game-subtitle {
  font-size: 13px;
  font-weight: 800;
  opacity: 0.94;
}

.game-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.game-stat-pill {
  font-size: 12px;
  font-weight: 900;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
}

.game-go {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 900;
  flex: 0 0 auto;
}

/* ==================== FOOTER & TOAST ==================== */
.hub-footer {
  flex: 0 0 auto;
  text-align: center;
  padding-top: 2px;
}

.hub-footer-note {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.78);
  padding: 6px 14px;
  border-radius: 999px;
}

.hub-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #2D1E4B;
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 800;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: 0 12px 26px rgba(45, 30, 75, 0.3);
  z-index: 50;
  white-space: nowrap;
}

/* ==================== IPAD PORTRAIT & PAYSAGE ==================== */
@media (min-width: 720px) {
  .hub-shell {
    padding: 20px 24px 16px;
    gap: 18px;
  }

  .hub-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .hub-brand {
    flex: 1 1 380px;
  }

  .profile-tabs {
    flex: 0 1 420px;
  }

  .games-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) and (orientation: landscape) {
  .hub-content.hub-content--dual {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    align-items: start;
  }

  .hub-content.hub-content--dual .games-grid {
    grid-template-columns: 1fr;
  }

  .hub-content:not(.hub-content--dual) .games-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
