:root {
  --ink: #14110f;
  --line: #14110f;
  --paper: #ffffff;
  --muted: #a49c94;
  --hair: #ece8e3;
  --frame: #e2ddd6;
  --round: 'Comic Neue', 'Comic Sans MS', 'Baloo 2', 'Segoe UI', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--round);
  font-size: 16px;
  overflow: hidden;                 /* pas de scroll : le cadre s'adapte */
  -webkit-font-smoothing: antialiased;
}
.wrap { height: 100%; }

/* --------------------------------------------------------- grand cadre */
.stage {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stars {
  position: fixed;            /* les étoiles vagabondent sur toute la page */
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* -------------------------------------------------------- zone de saisie */
.composer { position: relative; z-index: 1; width: min(640px, 84%); }
.row { display: flex; align-items: center; gap: 18px; }

.inputwrap {
  position: relative;
  flex: 1;
  border: 1px solid var(--frame);   /* bordure très fine, visible */
  border-radius: 16px;
  background: rgba(255, 255, 255, .72);
  backdrop-filter: blur(1px);
  padding: 16px 16px 26px;
}
#body {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-family: var(--round);
  font-size: 16px;
  line-height: 1.5;
  text-align: center;
  resize: none;
}
#body.shake { animation: shake .35s; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-5px)} 75%{transform:translateX(5px)} }

.counter {
  position: absolute;
  right: 14px; bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.counter.over { color: #d4463b; }

/* bouton de post : plus gros, à droite */
.drop {
  flex: 0 0 auto;
  width: 60px; height: 60px;
  padding: 0;
  border: 1.6px solid var(--frame);
  border-radius: 50%;
  background: rgba(255, 255, 255, .72);
  cursor: pointer;
  transition: background .16s, border-color .16s, transform .08s;
}
.drop:hover { background: var(--hair); border-color: var(--muted); }
.drop:active { transform: translateY(1px) scale(.95); }
.drop:disabled { opacity: .35; cursor: default; }

/* ------------------------------------------------------- cog + panneau */
.cog {
  position: fixed;
  right: 16px; bottom: 14px;
  width: 32px; height: 32px;
  border: none; background: transparent;
  color: var(--muted); font-size: 22px; line-height: 1;
  cursor: pointer; z-index: 5;
}
.cog:hover { color: var(--ink); }

.scrim {
  position: fixed; inset: 0;
  background: rgba(20,17,15,.12);
  opacity: 0; pointer-events: none;
  transition: opacity .2s; z-index: 6;
}
.scrim.open { opacity: 1; pointer-events: auto; }

.panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(360px, 88vw);
  background: var(--paper);
  border-left: 1px solid var(--hair);
  box-shadow: -14px 0 40px rgba(20,17,15,.06);
  transform: translateX(100%);
  transition: transform .24s ease;
  overflow-y: auto;
  padding: 18px 18px 40px;
  z-index: 7;
  font-family: var(--round);
}
.panel.open { transform: translateX(0); }
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  color: var(--muted); font-size: 13px; margin-bottom: 14px;
}
.panel-close { border: none; background: none; color: var(--muted); font-size: 16px; cursor: pointer; }
.panel-close:hover { color: var(--ink); }

.pnote { font-size: 14px; color: var(--muted); margin: 6px 0; }
.pnote b { color: var(--ink); }
.pnote.perr { color: #d4463b; }

.panel h3 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); margin: 22px 0 8px; font-weight: 700;
}
.pform { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.panel label { color: var(--muted); font-size: 14px; }
.panel .chk { display: inline-flex; align-items: center; gap: 6px; }
.panel input[type=number] {
  width: 60px; padding: 6px 8px; font: inherit;
  border: 1px solid var(--hair); border-radius: 8px; background: var(--paper); color: var(--ink);
}
.panel input[type=number]:focus { outline: none; border-color: var(--line); }
.panel button {
  font-family: var(--round); font-size: 14px; cursor: pointer; color: var(--ink);
  border: 1px solid var(--line); background: var(--paper);
  border-radius: 10px; padding: 7px 14px;
}
.panel button:hover { background: var(--ink); color: var(--paper); }
.pwide { width: 100%; }
.plight { border-color: var(--hair); color: var(--muted); }

.plist { list-style: none; margin: 0; padding: 0; }
.plist li {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
  padding: 8px 0; border-top: 1px solid var(--hair); font-size: 14px;
}
.plist li:first-child { border-top: none; }
.plist span { white-space: pre-wrap; word-break: break-word; }
.plist.muted span { color: var(--muted); }
.px { border: none; background: none; color: var(--muted); cursor: pointer; padding: 0 4px; font-size: 14px; }
.px:hover { color: var(--ink); }

/* ---------------------------------------------------------------- flashes */
.flashes { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 20; width: min(340px, 90vw); }
.flash { padding: 9px 14px; border-radius: 12px; margin-bottom: 8px; font-size: 14px; text-align: center; background: var(--paper); border: 1px solid var(--hair); }
.flash--error { border-color: #f0c9c5; color: #c23b30; }

/* ------------------------------------------------------------------ login */
.card--login { max-width: 300px; margin: 26vh auto 0; text-align: center; }
.well-emoji { font-size: 26px; margin: 0; letter-spacing: 6px; color: var(--muted); }
.login-form { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.login-form input {
  padding: 12px; font-family: var(--round); font-size: 16px; text-align: center;
  border: 1px solid var(--frame); border-radius: 12px; background: var(--paper); color: var(--ink);
}
.login-form input:focus { outline: none; border-color: var(--line); }
.login-form button {
  padding: 11px; font-family: var(--round); font-size: 16px; cursor: pointer;
  border: 1.6px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 12px;
}
.login-form button:hover { background: var(--ink); color: var(--paper); }
.muted { color: var(--muted); }
