/* =========================================================================
   nicoow.link — page publique
   Direction : « papeterie chaleureuse ». Fond crème pêché, encre cacao,
   accent corail et touche de sauge. Cartes-autocollants qui s'enfoncent
   au clic, typo arrondie. Assumé clair et joyeux, pas de version sombre.
   ========================================================================= */

:root {
  /* fonds */
  --paper:      #FFF6EE;
  --paper-2:    #FFEDE0;
  --card:       #FFFFFF;
  --line:       #F0D9C7;
  --line-soft:  #F7E6D9;
  --shadow:     #EBCDB8;

  /* encre */
  --ink:        #4B3226;
  --ink-2:      #6E5142;
  --muted:      #9C8072;

  /* couleurs */
  --accent:     #F0705C;
  --accent-ink: #FFFFFF;
  --accent-soft:#FFE3DC;
  --sage:       #6FAE92;
  --sage-soft:  #DCF0E7;
  --gold:       #E9A23B;
  --live:       #D92D20;

  /* marques */
  --c-twitch:    #7B3FF2;
  --c-discord:   #4A57D6;
  --c-x:         #2B2B2E;
  --c-instagram: #D62A6E;
  --c-youtube:   #E01B2E;
  --c-tiktok:    #12A5A0;
  --c-kick:      #3FA51A;
  --c-link:      #F0705C;

  /* typo */
  --f-display: 'Fredoka', 'Trebuchet MS', system-ui, sans-serif;
  --f-body:    'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono:    'DM Mono', ui-monospace, Consolas, monospace;

  /* rythme */
  --deck: 33rem;
  --r-md: 18px;
  --r-lg: 24px;
}

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

/* `hidden` doit toujours gagner : sinon un display:grid/flex plus spécifique
   laisse l'élément « invisible » intercepter les clics. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100svh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2 { margin: 0; font-family: var(--f-display); font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; }
p { margin: 0; }
ol, ul { margin: 0; padding: 0; list-style: none; }

::selection { background: var(--accent-soft); color: var(--ink); }

:where(a, button, input, select, textarea):focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}

.skip {
  position: absolute; left: 50%; top: -60px; transform: translateX(-50%);
  z-index: 50; border-radius: 999px;
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 1.1rem;
  background: var(--accent); color: #fff; font-weight: 800; font-size: .85rem;
}
.skip:focus { top: 12px; }

/* ------------------------------------------------------------- ambiance -- */

.ambient { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }

.orb { position: absolute; border-radius: 50%; filter: blur(80px); will-change: transform; }
.orb-a {
  width: 42vmax; height: 42vmax; top: -16vmax; left: -12vmax;
  background: radial-gradient(circle, #FFC9B4 0%, transparent 70%);
  opacity: .75;
  animation: drift-a 26s ease-in-out infinite alternate;
}
.orb-b {
  width: 38vmax; height: 38vmax; bottom: -15vmax; right: -12vmax;
  background: radial-gradient(circle, #D8EDE2 0%, transparent 70%);
  opacity: .45;
  animation: drift-b 32s ease-in-out infinite alternate;
}
.orb-c {
  width: 26vmax; height: 26vmax; top: 45%; left: 58%;
  background: radial-gradient(circle, #FFE1A8 0%, transparent 72%);
  opacity: .45;
  animation: drift-c 38s ease-in-out infinite alternate;
}
@keyframes drift-a { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(6vmax,4vmax,0) scale(1.12); } }
@keyframes drift-b { from { transform: translate3d(0,0,0) scale(1.06); } to { transform: translate3d(-5vmax,-6vmax,0) scale(.95); } }
@keyframes drift-c { from { transform: translate3d(0,0,0); } to { transform: translate3d(-8vmax,5vmax,0); } }

/* petits pois façon papier à motifs — volontairement discrets */
.grain {
  position: absolute; inset: 0;
  background-image: radial-gradient(var(--line) 1px, transparent 1.1px);
  background-size: 26px 26px;
  opacity: .28;
}
.spot, .vignette { display: none; }

/* ---------------------------------------------------------------- deck -- */

/* la page est large pour laisser respirer la grille de la semaine,
   mais l'identité, les boutons et le pied restent dans une colonne étroite */
.deck {
  position: relative;
  z-index: 1;
  width: min(68rem, 100% - 2rem);
  margin-inline: auto;
  padding: clamp(2.25rem, 8vh, 3.75rem) 0 3rem;
  display: flex;
  flex-direction: column;
  gap: 2.1rem;
}
.id, .foot { width: 100%; max-width: var(--deck); margin-inline: auto; }

.rise {
  opacity: 0;
  transform: translateY(16px);
  animation: rise .75s cubic-bezier(.2,.75,.25,1) forwards;
  animation-delay: var(--d, 0ms);
}
@keyframes rise { to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------ identité -- */

.id { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .2rem; }

.avatar { position: relative; width: 128px; height: 128px; margin-bottom: 1rem; display: grid; place-items: center; }
.avatar img {
  width: 112px; height: 112px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--card);
  position: relative; z-index: 2;
  border: 4px solid var(--card);
  box-shadow: 0 8px 0 var(--shadow), 0 14px 26px rgba(120,80,55,.14);
}
/* anneau pointillé qui tourne doucement */
.avatar-ring {
  position: absolute; inset: -4px;
  border-radius: 50%;
  border: 3px dashed var(--accent);
  opacity: .55;
  animation: spin 26s linear infinite;
  z-index: 1;
}
@keyframes spin { to { transform: rotate(1turn); } }

.avatar-tally {
  position: absolute; inset: -12px;
  border-radius: 50%;
  border: 3px solid var(--live);
  opacity: 0;
  animation: tally 2.1s ease-out infinite;
  z-index: 0;
}
@keyframes tally {
  0%   { transform: scale(.94); opacity: .7; }
  70%  { transform: scale(1.14); opacity: 0; }
  100% { transform: scale(1.14); opacity: 0; }
}

.name {
  font-size: clamp(2.15rem, 8.5vw, 2.85rem);
  font-weight: 700;
  line-height: 1.05;
  color: var(--ink);
}
.handle {
  font-family: var(--f-mono);
  font-size: .84rem;
  color: var(--accent);
  font-weight: 500;
}
.tagline {
  margin-top: .6rem;
  max-width: 30ch;
  color: var(--ink-2);
  font-size: .98rem;
  line-height: 1.5;
  text-wrap: pretty;
}

/* pastille de statut */
.status {
  margin-top: 1.15rem;
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .5rem 1rem .5rem .85rem;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: var(--card);
  box-shadow: 0 3px 0 var(--shadow);
  font-size: .85rem;
  font-weight: 700;
  color: var(--ink-2);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.status:hover { transform: translateY(-2px); box-shadow: 0 5px 0 var(--shadow); border-color: var(--accent); }
.status:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--shadow); }

.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--sage); flex: none; }
.status.is-live { border-color: var(--live); color: var(--live); background: #FFF1EF; }
.status.is-live .status-dot { background: var(--live); animation: blip 1.8s ease-out infinite; }
@keyframes blip {
  0%   { box-shadow: 0 0 0 0 rgba(217,45,32,.55); }
  70%  { box-shadow: 0 0 0 10px rgba(217,45,32,0); }
  100% { box-shadow: 0 0 0 0 rgba(217,45,32,0); }
}
.status-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: min(42ch, 68vw); }
.status .live-tag {
  font-family: var(--f-mono);
  font-size: .7rem; font-weight: 500; letter-spacing: .1em;
  color: var(--live);
}

/* -------------------------------------------------------------- liens --- */

/* cartes-autocollants : sur une ligne, alignées sur la largeur du planning */
.links { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; }

.link {
  --brand: var(--accent);
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .45rem;
  padding: 1.15rem .8rem 1rem;
  border-radius: var(--r-lg);
  border: 2px solid var(--line);
  background: var(--card);
  box-shadow: 0 5px 0 var(--shadow);
  text-align: center;
  transition: transform .18s cubic-bezier(.2,.8,.3,1), box-shadow .18s, border-color .2s;
}
.link:hover, .link:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 8px 0 var(--shadow);
  border-color: var(--brand);
}
.link:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--shadow); }

.link-icon {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 16px;
  background: color-mix(in srgb, var(--brand) 12%, #fff);
  color: var(--brand);
  transition: background .2s, color .2s, transform .25s cubic-bezier(.2,.8,.3,1);
}
.link-icon svg { width: 24px; height: 24px; }
.link:hover .link-icon { background: var(--brand); color: #fff; transform: rotate(-8deg) scale(1.06); }

.link-body { min-width: 0; display: flex; flex-direction: column; gap: 0; }
.link-label { font-family: var(--f-display); font-weight: 600; font-size: 1.02rem; line-height: 1.2; color: var(--ink); }
.link-sub {
  font-family: var(--f-mono);
  font-size: .68rem;
  line-height: 1.35;
  color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* la flèche n'a plus de sens dans une carte centrée */
.link-go { display: none; }

/* ------------------------------------------------------------ planning -- */

.planning { display: flex; flex-direction: column; gap: .85rem; scroll-margin-top: 1.5rem; }

.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.sec-head h2 { font-size: 1.5rem; font-weight: 600; }
.sec-meta { font-size: .78rem; font-weight: 700; color: var(--muted); white-space: nowrap; }

/* ---- barre de navigation entre les semaines ---- */
.week-bar {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
}
.week-btn {
  appearance: none; cursor: pointer;
  width: 40px; height: 40px; flex: none;   /* zone tactile confortable */
  display: grid; place-items: center;
  border-radius: 12px;
  border: 2px solid var(--line);
  background: var(--card);
  box-shadow: 0 3px 0 var(--shadow);
  color: var(--ink-2);
  font-size: 1.15rem; line-height: 1;
  font-family: var(--f-body);
  transition: transform .18s, box-shadow .18s, border-color .2s, color .2s;
}
.week-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); box-shadow: 0 5px 0 var(--shadow); }
.week-btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--shadow); }

.week-label {
  appearance: none; cursor: pointer;
  display: inline-flex; align-items: center;
  min-height: 40px;                         /* zone tactile confortable */
  padding: .35rem .9rem;
  border: 0; background: transparent;
  font-family: var(--f-display);
  font-size: .95rem; font-weight: 600;
  color: var(--ink);
  border-radius: 999px;
  transition: background .2s, color .2s;
}
.week-label.is-away { background: var(--accent-soft); color: #C0432F; }
.week-label.is-away::after { content: ' ↩'; font-size: .8em; }
.week-label:hover { background: var(--paper-2); }

/* ---- la grille : 7 jours ---- */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: .6rem; align-items: stretch; }

.day {
  position: relative;
  display: flex; flex-direction: column;
  min-height: 9rem;
  border-radius: var(--r-md);
  border: 2px solid var(--line-soft);
  background: var(--card);
  box-shadow: 0 4px 0 var(--shadow);
  overflow: hidden;
  transition: border-color .25s, box-shadow .25s, transform .25s cubic-bezier(.2,.8,.3,1),
              opacity .5s cubic-bezier(.2,.8,.3,1);
  opacity: 0;
  transform: translateY(14px);
}
.day.seen { opacity: 1; transform: none; }
.day.has-slot:hover { transform: translateY(-3px); box-shadow: 0 7px 0 var(--shadow); }

/* jours sans live : discrets, sans relief */
.day.is-rest {
  background: transparent;
  border-style: dashed;
  border-color: var(--line);
  box-shadow: none;
}
.day.is-past.seen { opacity: .5; }
.day.is-next { border-color: var(--accent); border-style: solid; }
.day.is-live { border-color: var(--live); border-style: solid; background: #FFF7F5; }
.day.is-today .day-head { background: var(--paper-2); }
.day.is-next .day-head { background: var(--accent-soft); }
.day.is-live .day-head { background: #FFE0DC; }

.day-head {
  display: flex; align-items: baseline; justify-content: center; gap: .4rem;
  padding: .45rem .3rem;
  background: var(--paper);
  border-bottom: 2px solid var(--line-soft);
}
.day.is-rest .day-head { border-bottom-style: dashed; border-bottom-color: var(--line); }
.day-dow { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.day-num { font-family: var(--f-display); font-size: 1.2rem; font-weight: 600; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.day.is-next .day-dow, .day.is-next .day-num { color: #C0432F; }
.day.is-live .day-dow, .day.is-live .day-num { color: var(--live); }
.day.is-today .day-num { position: relative; }
.day.is-today .day-num::after {
  content: ''; position: absolute; left: 50%; bottom: -4px; transform: translateX(-50%);
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
}

.day-body { flex: 1; display: flex; flex-direction: column; gap: .5rem; padding: .55rem .5rem .65rem; min-width: 0; }

.day-rest { flex: 1; display: grid; place-items: center; }
.day-rest span {
  font-size: .72rem; font-weight: 700; letter-spacing: .04em;
  color: var(--muted); opacity: .65;
}

/* lien en surimpression : rend toute la case cliquable vers Twitch,
   tout en laissant les pastilles d'invités cliquables par-dessus */
.day-link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.day-link:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.day.has-slot { cursor: pointer; }
.day.has-slot:hover { border-color: var(--accent); }
.day.is-live:hover { border-color: var(--live); }
.guests { position: relative; z-index: 2; }

.slot { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.slot.is-canceled .slot-title { text-decoration: line-through; text-decoration-color: var(--muted); }
.slot-time {
  font-family: var(--f-mono);
  font-size: .72rem; font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.day.is-live .slot-time { color: var(--live); }
.slot-title {
  font-family: var(--f-display);
  font-weight: 600; font-size: .92rem; line-height: 1.25;
  color: var(--ink);
  overflow-wrap: anywhere; text-wrap: pretty;
}
.slot-note { font-size: .74rem; line-height: 1.35; color: var(--muted); overflow-wrap: anywhere; }
.slot-chips { display: flex; flex-wrap: wrap; gap: .25rem; }

.chip {
  font-family: var(--f-body);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .2rem .5rem;
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--muted);
  white-space: nowrap;
}
.chip-next { background: var(--accent-soft); color: #C0432F; }
.chip-live { background: var(--live); color: #fff; }
.chip-off  { background: #FFE0DC; color: var(--live); }
.chip-tag  { background: var(--sage-soft); color: #3C7A63; }

.guests { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; margin-top: .1rem; }
.guests-label { font-size: .66rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.guest {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .2rem .55rem .2rem .2rem;
  border-radius: 999px;
  background: var(--paper-2);
  font-size: .78rem;
  font-weight: 700;
  color: var(--ink-2);
  transition: background .2s, color .2s, transform .2s;
}
a.guest:hover { background: var(--accent-soft); color: var(--ink); transform: translateY(-1px); }
.guest-av {
  width: 21px; height: 21px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--f-display);
  font-size: .68rem; font-weight: 600;
  color: #4B3226;
  flex: none;
}
/* version compacte dans les cases du planning */
.guest-sm { padding: .12rem .4rem .12rem .12rem; font-size: .7rem; gap: .28rem; max-width: 100%; }
.guest-sm > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guest-sm .guest-av { width: 17px; height: 17px; font-size: .6rem; }

.cues-empty {
  padding: 1.7rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: .92rem;
  border: 2px dashed var(--line);
  border-radius: var(--r-md);
}

/* ---------------------------------------------------------------- pied -- */

.foot {
  margin-top: .25rem;
  text-align: center;
  color: var(--muted);
  font-size: .82rem;
  display: flex; flex-direction: column; gap: .3rem;
}
.foot-sig { font-family: var(--f-mono); font-size: .7rem; opacity: .8; }

/* -------------------------------------------------------------- mobile -- */

/* la grille passe de 7 → 4 → 2 colonnes ; en dessous, les cases
   deviennent des lignes pour rester lisibles sur un téléphone */
@media (max-width: 1000px) {
  .week { grid-template-columns: repeat(4, 1fr); }
  .day { min-height: 8.5rem; }
}

@media (max-width: 720px) {
  .week { grid-template-columns: repeat(2, 1fr); gap: .5rem; }
  /* en dessous, 4 boutons sur une ligne deviennent illisibles */
  .links { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 430px) {
  .week { grid-template-columns: 1fr; gap: .45rem; }
  .day { min-height: 0; flex-direction: row; align-items: stretch; }
  .day-head {
    flex-direction: column; justify-content: center; gap: 0;
    width: 3.4rem; flex: none;
    border-bottom: 0;
    border-right: 2px solid var(--line-soft);
  }
  .day.is-rest .day-head { border-right-style: dashed; border-right-color: var(--line); border-bottom: 0; }
  .day-body { padding: .5rem .6rem; }
  .day-rest { justify-content: flex-start; place-items: center start; }
  .day.is-today .day-num::after { bottom: -3px; }

  /* jours de repos très compacts : ils ne doivent pas éloigner les réseaux */
  .day.is-rest { min-height: 2.9rem; }
  .day.is-rest .day-head { flex-direction: row; align-items: baseline; gap: .35rem; padding: .2rem .3rem; }
  .day.is-rest .day-num { font-size: .95rem; }
  .day.is-rest .day-dow { font-size: .6rem; }
  .day.is-rest .day-body { padding: .2rem .6rem; }
  .day.is-rest .day-rest span { font-size: .68rem; }
}

@media (max-width: 480px) {
  .deck { width: min(100% - 1.5rem, 68rem); padding-top: 2rem; gap: 1.8rem; }
  .avatar { width: 112px; height: 112px; }
  .avatar img { width: 98px; height: 98px; }
  .links { gap: .65rem; }
  .link { padding: 1rem .5rem .85rem; border-radius: 20px; }
  .link-icon { width: 42px; height: 42px; border-radius: 14px; }
  .link-icon svg { width: 21px; height: 21px; }
  .link-label { font-size: .94rem; }
  .sec-head h2 { font-size: 1.3rem; }
}

@media (hover: none) {
  .link:hover { transform: none; box-shadow: 0 5px 0 var(--shadow); }
  .day.has-slot:hover { transform: none; box-shadow: 0 4px 0 var(--shadow); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .rise, .day { opacity: 1; transform: none; }
}
