/* =============================================================
   Relay Radio — Shoutbox emoji picker
   Loaded after css-main.css. Follows the existing dark card
   language: neon blue primary, orange accent, 12–18px radii.
   ============================================================= */

/* ---------- screen-reader-only ------------------------------
   Defined here rather than relying on Bootstrap: v4 ships
   .sr-only and v5 ships .visually-hidden, and this stylesheet
   has to work under either. */

.rr-sr-only{
  position:absolute !important;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

/* ---------- trigger button ---------------------------------- */

.rr-emoji-trigger{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:34px;
  height:34px;
  padding:0;
  flex:0 0 34px;
  border-radius:11px;
  border:1px solid rgba(0,183,255,.20);
  background:linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.02));
  color:rgba(255,255,255,.60);
  font-size:15px;
  line-height:1;
  cursor:pointer;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.05);
  transition:color .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}

.rr-emoji-trigger:hover:enabled,
.rr-emoji-trigger:focus-visible:enabled{
  color:#7dd3ff;
  border-color:rgba(0,183,255,.44);
  background:linear-gradient(180deg, rgba(0,183,255,.16), rgba(0,183,255,.06));
  box-shadow:0 0 0 .16rem rgba(0,183,255,.12), inset 0 1px 0 rgba(255,255,255,.07);
  transform:translateY(-1px);
  outline:none;
}

.rr-emoji-trigger:focus-visible{
  outline:2px solid rgba(0,183,255,.65);
  outline-offset:2px;
}

.rr-emoji-trigger.is-open{
  color:#ffb357;
  border-color:rgba(255,140,26,.48);
  background:linear-gradient(180deg, rgba(255,140,26,.18), rgba(255,140,26,.06));
  box-shadow:0 0 0 .16rem rgba(255,140,26,.12), inset 0 1px 0 rgba(255,255,255,.07);
}

.rr-emoji-trigger:disabled{
  opacity:.38;
  cursor:not-allowed;
}

/* Shouts page: the trigger is a direct child of the Bootstrap 5
   input-group so it stretches to the field height. Bootstrap squares
   the inner corners of every child and pulls them together with a
   -1px margin; here the three controls read better as separate
   pieces, so those rules are reversed for this group only. */
.input-group.rr-shout-group > .rr-emoji-trigger{
  height:auto;
  align-self:stretch;
  margin-left:6px !important;
  border-radius:11px !important;
}

.input-group.rr-shout-group > .form-control{
  border-radius:13px !important;
}

.input-group.rr-shout-group > .input-group-append{
  margin-left:6px !important;
  display:flex;
  align-items:stretch;
}

/* Home page message board: trigger floats inside the field.
   The width is forced rather than inherited — the field is styled
   differently across the two boards, and if it ever sizes to its
   intrinsic width the absolutely-positioned trigger would drift
   away from the field's right edge. */
.rr-emoji-field{
  position:relative;
  display:block;
  width:100%;
}

.rr-emoji-field > .form-control{
  width:100% !important;
  padding-right:42px !important;
}

.rr-emoji-field > .rr-emoji-trigger{
  position:absolute;
  top:50%;
  right:6px;
  transform:translateY(-50%);
  width:30px;
  height:30px;
  flex:0 0 30px;
  border-radius:9px;
  font-size:14px;
}

.rr-emoji-field > .rr-emoji-trigger:hover:enabled,
.rr-emoji-field > .rr-emoji-trigger:focus-visible:enabled{
  transform:translateY(-50%);
}

/* ---------- panel ------------------------------------------- */

.rr-emoji-panel{
  position:fixed;
  z-index:1080;
  width:340px;
  max-width:calc(100vw - 16px);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  padding:12px 12px 0;
  border-radius:18px;
  border:1px solid rgba(0,183,255,.24);
  background:
    radial-gradient(circle at 12% 0%, rgba(0,183,255,.13), transparent 38%),
    radial-gradient(circle at 92% 4%, rgba(255,140,26,.10), transparent 34%),
    linear-gradient(180deg, rgba(15,21,34,.97), rgba(5,9,18,.98));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.05),
    0 24px 62px rgba(0,0,0,.58);
  color:rgba(255,255,255,.88);
  font-family:Poppins, Arial, sans-serif;
  opacity:0;
  transform:translateY(6px) scale(.985);
  transform-origin:bottom right;
  transition:opacity .15s ease, transform .15s ease;
}

.rr-emoji-panel::before{
  content:"";
  position:absolute;
  inset:0 0 auto 0;
  height:2px;
  background:linear-gradient(90deg, rgba(0,183,255,.9), rgba(139,61,255,.72), rgba(255,140,26,.85));
  opacity:.8;
  pointer-events:none;
}

.rr-emoji-panel.is-open{
  opacity:1;
  transform:translateY(0) scale(1);
}

.rr-emoji-panel[hidden]{ display:none; }

@keyframes rrEmojiNudge{
  0%,100%{ transform:translateY(0) scale(1); }
  25%{ transform:translateY(0) scale(1) translateX(-4px); }
  75%{ transform:translateY(0) scale(1) translateX(4px); }
}

.rr-emoji-panel.is-full{
  border-color:rgba(255,140,26,.5);
  animation:rrEmojiNudge .32s ease;
}

/* ---------- search + skin tone ------------------------------ */

.rr-emoji-head{
  display:flex;
  align-items:center;
  gap:8px;
  margin-bottom:9px;
}

.rr-emoji-search{
  position:relative;
  flex:1 1 auto;
  min-width:0;
  display:flex;
  align-items:center;
}

.rr-emoji-search > i{
  position:absolute;
  left:11px;
  font-size:11px;
  color:rgba(255,255,255,.34);
  pointer-events:none;
}

.rr-emoji-search-input{
  width:100%;
  min-height:34px;
  padding:0 11px 0 30px;
  border-radius:11px;
  border:1px solid rgba(0,183,255,.17);
  background:rgba(4,8,15,.84);
  color:rgba(255,255,255,.92);
  font-size:12.5px;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.035);
  transition:border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.rr-emoji-search-input::placeholder{ color:rgba(255,255,255,.34); }

.rr-emoji-search-input:focus{
  outline:none;
  background:rgba(6,12,22,.94);
  border-color:rgba(0,183,255,.42);
  box-shadow:0 0 0 .16rem rgba(0,183,255,.12), inset 0 1px 0 rgba(255,255,255,.05);
}

.rr-emoji-tones{
  display:flex;
  align-items:center;
  gap:4px;
  padding:4px;
  flex:0 0 auto;
  border-radius:11px;
  border:1px solid rgba(255,255,255,.07);
  background:rgba(255,255,255,.03);
}

.rr-emoji-tone{
  width:15px;
  height:15px;
  padding:0;
  border-radius:50%;
  border:1px solid rgba(255,255,255,.16);
  cursor:pointer;
  transition:transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}

.rr-emoji-tone-0{ background:linear-gradient(135deg,#ffd166,#ffb357); }
.rr-emoji-tone-1{ background:#f7dece; }
.rr-emoji-tone-2{ background:#f3d2a2; }
.rr-emoji-tone-3{ background:#d5a375; }
.rr-emoji-tone-4{ background:#a3683f; }
.rr-emoji-tone-5{ background:#5c3a24; }

.rr-emoji-tone:hover{ transform:scale(1.16); }

.rr-emoji-tone.is-active{
  border-color:rgba(0,183,255,.85);
  box-shadow:0 0 0 2px rgba(0,183,255,.28);
}

.rr-emoji-tone:focus-visible{
  outline:2px solid rgba(0,183,255,.65);
  outline-offset:2px;
}

/* ---------- category tabs ----------------------------------- */

.rr-emoji-tabs{
  display:flex;
  align-items:center;
  gap:3px;
  padding-bottom:9px;
  margin-bottom:9px;
  overflow-x:auto;
  border-bottom:1px solid rgba(255,255,255,.07);
  scrollbar-width:none;
}

.rr-emoji-tabs::-webkit-scrollbar{ display:none; }

.rr-emoji-tab{
  flex:0 0 auto;
  width:30px;
  height:28px;
  padding:0;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid transparent;
  border-radius:9px;
  background:transparent;
  color:rgba(255,255,255,.42);
  font-size:12.5px;
  cursor:pointer;
  transition:color .14s ease, background .14s ease, border-color .14s ease;
}

.rr-emoji-tab:hover{
  color:rgba(255,255,255,.82);
  background:rgba(255,255,255,.05);
}

.rr-emoji-tab.is-active{
  color:#7dd3ff;
  border-color:rgba(0,183,255,.34);
  background:linear-gradient(180deg, rgba(0,183,255,.18), rgba(0,183,255,.05));
  box-shadow:0 0 14px rgba(0,183,255,.16);
}

.rr-emoji-tab:focus-visible{
  outline:2px solid rgba(0,183,255,.6);
  outline-offset:1px;
}

/* ---------- grid -------------------------------------------- */

.rr-emoji-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(38px, 1fr));
  align-content:start;
  gap:2px;
  /* height is the target; flex lets it shrink when the panel is
     clamped to a short gap above or below the trigger. */
  height:214px;
  flex:1 1 auto;
  min-height:96px;
  overflow-y:auto;
  overscroll-behavior:contain;
  padding-right:2px;
  scrollbar-width:thin;
  scrollbar-color:rgba(0,183,255,.48) rgba(0,0,0,.18);
}

.rr-emoji-grid::-webkit-scrollbar{ width:8px; }

.rr-emoji-grid::-webkit-scrollbar-track{
  background:rgba(0,0,0,.22);
  border-radius:999px;
}

.rr-emoji-grid::-webkit-scrollbar-thumb{
  background:linear-gradient(180deg, rgba(0,183,255,.65), rgba(139,61,255,.42), rgba(255,140,26,.55));
  border-radius:999px;
}

.rr-emoji-cell{
  width:100%;
  aspect-ratio:1 / 1;
  min-height:36px;
  padding:0;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px solid transparent;
  border-radius:10px;
  background:transparent;
  font-size:20px;
  line-height:1;
  cursor:pointer;
  font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji","Segoe UI Symbol",sans-serif;
  transition:background .12s ease, border-color .12s ease, transform .12s ease;
}

.rr-emoji-cell:hover,
.rr-emoji-cell:focus-visible{
  outline:none;
  transform:scale(1.14);
  border-color:rgba(0,183,255,.3);
  background:radial-gradient(circle at 50% 50%, rgba(0,183,255,.20), rgba(0,183,255,.05));
}

.rr-emoji-cell:active{ transform:scale(.96); }

.rr-emoji-empty{
  grid-column:1 / -1;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:8px;
  height:100%;
  padding:0 18px;
  text-align:center;
  color:rgba(255,255,255,.42);
  font-size:12px;
}

.rr-emoji-empty > i{
  font-size:22px;
  color:rgba(0,183,255,.4);
}

/* ---------- preview footer ---------------------------------- */

.rr-emoji-foot{
  display:flex;
  align-items:center;
  gap:9px;
  min-height:42px;
  margin:0 -12px;
  padding:0 14px;
  border-top:1px solid rgba(255,255,255,.07);
  background:rgba(0,0,0,.22);
}

.rr-emoji-preview-char{
  font-size:19px;
  line-height:1;
  font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji","Segoe UI Symbol",sans-serif;
}

.rr-emoji-preview-name{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:rgba(255,255,255,.52);
  font-size:11.5px;
  letter-spacing:.01em;
}

/* ---------- shouts render at readable size ------------------ */

.rv-shout-text{
  font-family:inherit;
}

/* ---------- mobile bottom sheet ----------------------------- */

@media (max-width:575.98px){
  .rr-emoji-panel.is-sheet{
    left:0 !important;
    right:0;
    top:auto !important;
    bottom:0;
    /* width:auto so left/right pin it to the viewport. A percentage
       width can overshoot when the page scrolls horizontally. */
    width:auto;
    max-width:none;
    /* Fully opaque: the sheet covers a large part of a phone screen,
       and at 97% the page text behind it stays legible and distracting. */
    background:
      radial-gradient(circle at 12% 0%, rgba(0,183,255,.13), transparent 38%),
      radial-gradient(circle at 92% 4%, rgba(255,140,26,.10), transparent 34%),
      linear-gradient(180deg, #0f1522, #050912);
    padding:14px 14px 0;
    border-radius:20px 20px 0 0;
    border-bottom:0;
    transform-origin:bottom center;
    transform:translateY(14px);
    box-shadow:0 -18px 50px rgba(0,0,0,.62);
  }

  .rr-emoji-panel.is-sheet.is-open{ transform:translateY(0); }

  .rr-emoji-panel.is-sheet .rr-emoji-grid{
    height:min(46vh, 250px);
    grid-template-columns:repeat(auto-fill, minmax(42px, 1fr));
  }

  .rr-emoji-panel.is-sheet .rr-emoji-cell{
    min-height:40px;
    font-size:22px;
  }

  .rr-emoji-panel.is-sheet .rr-emoji-foot{
    margin:0 -14px;
    padding-bottom:env(safe-area-inset-bottom, 0);
  }

  .rr-emoji-panel.is-sheet .rr-emoji-tab{
    width:34px;
    height:31px;
  }
}

/* ---------- motion preference ------------------------------- */

@media (prefers-reduced-motion:reduce){
  .rr-emoji-panel,
  .rr-emoji-cell,
  .rr-emoji-tab,
  .rr-emoji-tone,
  .rr-emoji-trigger{
    transition:none !important;
    animation:none !important;
  }
  .rr-emoji-cell:hover,
  .rr-emoji-cell:focus-visible,
  .rr-emoji-trigger:hover:enabled{ transform:none; }
  .rr-emoji-panel{ transform:none; }
}
