/*
Tuin Face Pong
File: css/03-welcome-sidekick.css

Welcome screen, loadout chips, daily gift menu button, and sidekick helper.
Keep this file focused: Market layout belongs in css/04-market-shop.css, mobile shell fixes in css/06-mobile.css.
*/

/* -----------------------------
   Sidekick helper
----------------------------- */

#sidekickTipBox {
  position: fixed;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 18;
  width: 250px;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  pointer-events: none;
}

#sidekickTipBox.active {
  display: flex;
  animation: sidekickPop 0.22s ease-out both;
}

#sidekickTipBox.sleeping {
  opacity: 0.66;
  filter: grayscale(0.25) brightness(0.86);
}

#sidekickPortraitFrame {
  flex: 0 0 auto;
  width: 104px;
  height: 104px;
  margin: 0 auto -13px;
  position: relative;
  z-index: 2;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, rgba(255,204,0,0.22), rgba(0,217,255,0.10) 48%, rgba(0,0,0,0.76) 100%);
  border: 3px solid rgba(255,204,0,0.78);
  box-shadow:
    0 0 22px rgba(255,204,0,0.46),
    0 0 16px rgba(0,217,255,0.24),
    inset 0 0 18px rgba(255,255,255,0.07);
  overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

#sidekickPortraitFrame::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 16px;
  border: 1px solid rgba(0,217,255,0.42);
  box-shadow: inset 0 0 14px rgba(0,217,255,0.18);
  pointer-events: none;
  z-index: 3;
}

#sidekickPortraitFrame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255,255,255,0.10), transparent 38%, rgba(0,217,255,0.08));
  opacity: 0.36;
  pointer-events: none;
  z-index: 4;
}

#sidekickTipBox.talking #sidekickPortraitFrame {
  border-color: rgba(255,204,0,0.96);
  box-shadow:
    0 0 32px rgba(255,204,0,0.66),
    0 0 24px rgba(0,217,255,0.40),
    inset 0 0 24px rgba(255,255,255,0.10);
  filter: brightness(1.18);
}

#sidekickTipBox.talking #sidekickPortraitFrame::after {
  opacity: 0.56;
}

#sidekickPortrait {
  position: relative;
  z-index: 2;
  width: 86px;
  height: 86px;
  margin: auto;
  object-fit: contain;
  object-position: center center;
  display: block;
  transform: none;
  filter:
    drop-shadow(0 0 14px rgba(255,204,0,0.38))
    drop-shadow(0 0 9px rgba(0,217,255,0.30));
}

#sidekickTipBox.talking #sidekickPortrait {
  animation: sidekickTalkBounce 0.22s steps(2) infinite;
}

#sidekickSpeechBox {
  flex: 0 0 auto;
  position: relative;
  width: 245px;
  max-width: 245px;
  min-height: 112px;
  margin: 0 auto;
  padding: 31px 16px 16px;
  border-radius: 20px;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(0,217,255,0.08), rgba(255,204,0,0.04)),
    rgba(0,0,0,0.58);
  border: 2px solid rgba(0,217,255,0.24);
  box-shadow:
    0 0 14px rgba(0,217,255,0.10),
    inset 0 0 18px rgba(255,255,255,0.035);
  opacity: 0.70;
  backdrop-filter: blur(3px);
  transition: opacity 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

#sidekickSpeechBox::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  width: 34px;
  height: 12px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,217,255,0.22), rgba(255,204,0,0.10), transparent 72%);
  filter: blur(2px);
  opacity: 0.75;
  pointer-events: none;
}

#sidekickTipBox.talking #sidekickSpeechBox {
  opacity: 1;
  background:
    linear-gradient(135deg, rgba(0,217,255,0.16), rgba(255,204,0,0.10)),
    rgba(0,0,0,0.82);
  border-color: rgba(0,217,255,0.66);
  box-shadow:
    0 0 30px rgba(0,217,255,0.30),
    0 0 20px rgba(255,204,0,0.18),
    inset 0 0 20px rgba(255,255,255,0.07);
}

#sidekickSpeechName {
  color: #ffcc00;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 8px;
  text-shadow: 0 0 10px rgba(255,204,0,0.62);
}

#sidekickSpeechText {
  min-height: 54px;
  color: #eaffff;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
  text-shadow: 0 0 8px rgba(0,217,255,0.26);
}

#sidekickSpeechText:empty::before {
  content: "Watching the run...";
  color: rgba(234,255,255,0.34);
  font-style: italic;
}

#sidekickSpeechText::after {
  content: "_";
  color: #00d9ff;
  animation: sidekickCursor 0.7s steps(2) infinite;
}

#sidekickTipBox:not(.talking) #sidekickSpeechText::after {
  display: none;
}

#sidekickTipBox.talking #sidekickSpeechText::after {
  display: inline;
}

@keyframes sidekickPop {
  from { opacity: 0; transform: translateY(-46%) scale(0.92); }
  to { opacity: 1; transform: translateY(-50%) scale(1); }
}

@keyframes sidekickTalkBounce {
  from { transform: translateY(0) scale(1); }
  to { transform: translateY(-2px) scale(1.025); }
}

@keyframes sidekickCursor {
  0%, 45% { opacity: 1; }
  46%, 100% { opacity: 0; }
}

/* -----------------------------
   Welcome screen
----------------------------- */

#startSplashOverlay {
  z-index: 260;
  background-color: #020408;
  background:
    radial-gradient(circle at 50% 42%, rgba(255,204,0,0.22), rgba(0,217,255,0.10) 32%, rgba(0,0,0,0.72) 62%, rgba(0,0,0,0.96) 100%),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.035) 0 1px, transparent 1px 5px),
    #020408;
  padding: 0;
}

body:has(#startSplashOverlay[style*="display: block"]) #gameWrap,
body:has(#startSplashOverlay[style*="display: flex"]) #gameWrap,
body:has(#startSplashOverlay[style*="display: block"]) #hud,
body:has(#startSplashOverlay[style*="display: flex"]) #hud,
body:has(#startSplashOverlay[style*="display: block"]) #topbar,
body:has(#startSplashOverlay[style*="display: flex"]) #topbar,
body:has(#startSplashOverlay[style*="display: block"]) #help,
body:has(#startSplashOverlay[style*="display: flex"]) #help {
  visibility: hidden;
}

#startSplashPanel {
  position: relative;
  width: 100vw;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 28px;
  text-align: center;
  overflow: hidden;
}

#startSplashPanel::before,
#startSplashPanel::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

#startSplashPanel::before {
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0,217,255,0.13), transparent 18%, transparent 82%, rgba(255,204,0,0.12)),
    radial-gradient(circle at 50% 50%, transparent 0 46%, rgba(0,0,0,0.40) 76%);
  opacity: 0.92;
}

#startSplashPanel::after {
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(141,242,255,0.38), transparent);
  box-shadow:
    0 -120px 0 rgba(255,255,255,0.035),
    0 120px 0 rgba(255,255,255,0.035);
}

#startSplashImage {
  position: relative;
  z-index: 1;
  width: min(980px, 82vw);
  max-height: min(620px, 70vh);
  object-fit: contain;
  display: block;
  margin-top: -10px;
  filter:
    drop-shadow(0 0 16px rgba(255,204,0,0.72))
    drop-shadow(0 0 40px rgba(0,217,255,0.28))
    drop-shadow(0 18px 32px rgba(0,0,0,0.58));
  clip-path: inset(0 6.5% 0 6.5%);
  animation: startSplashFloat 2.8s ease-in-out infinite alternate;
}

#startSplashTitle {
  margin: 0;
  color: #ffcc00;
  font-size: 58px;
  text-shadow:
    0 0 16px rgba(255,204,0,0.9),
    0 0 34px rgba(0,217,255,0.46);
}

#startSplashBtn {
  position: relative;
  z-index: 2;
  min-width: 260px;
  padding: 16px 32px;
  border-color: rgba(255,255,255,0.72);
  background:
    linear-gradient(180deg, #fff7a8, #ffcc00 48%, #ff8c00);
  color: #211000;
  font-size: 26px;
  box-shadow:
    0 0 22px rgba(255,204,0,0.74),
    0 0 42px rgba(0,217,255,0.25),
    inset 0 0 18px rgba(255,255,255,0.28);
  animation: startSplashPulse 0.9s ease-in-out infinite alternate;
}

#startSplashHint {
  position: relative;
  z-index: 2;
  margin: 0;
  color: #8df2ff;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(0,217,255,0.82);
}

@keyframes startSplashFloat {
  from { transform: translateY(-6px) scale(0.99); }
  to { transform: translateY(5px) scale(1.01); }
}

@keyframes startSplashPulse {
  from { transform: scale(1); filter: saturate(0.95); }
  to { transform: scale(1.045); filter: saturate(1.18); }
}

#welcomePanel {
  min-height: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#welcomeImage {
  max-width: min(620px, 88vw);
  max-height: 310px;
  object-fit: contain;
  display: block;
  margin: 0 auto 22px;
  filter: drop-shadow(0 0 20px rgba(255,204,0,0.38));
}

#welcomeTitle {
  margin: 0 0 8px;
  color: #ffcc00;
  font-size: 42px;
  text-shadow: 0 0 14px rgba(255,204,0,0.75);
}

#welcomeText {
  margin: 0 0 16px;
  color: #ddd;
  font-size: 16px;
}

#welcomeLoadout {
  position: relative;
  width: min(520px, 90vw);
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 13px;
  align-items: start;
  margin: 0 auto 14px;
  padding: 12px 14px;
  background:
    linear-gradient(135deg, rgba(255,204,0,0.12), rgba(0,217,255,0.07)),
    rgba(0,0,0,0.42);
  border: 2px solid rgba(255,204,0,0.35);
  border-radius: 18px;
  box-shadow:
    0 0 20px rgba(255,204,0,0.20),
    inset 0 0 16px rgba(255,255,255,0.04);
  text-align: left;
  overflow: visible;
}

#welcomeLoadout::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 18px;
  pointer-events: none;
  background:
    linear-gradient(120deg, transparent 0%, rgba(255,255,255,0.06) 45%, transparent 65%),
    radial-gradient(circle at 22% 8%, rgba(255,204,0,0.12), transparent 32%);
  mix-blend-mode: screen;
  opacity: 0.65;
}

#welcomeHeadPreviewWrap,
#welcomeLoadoutText {
  position: relative;
  z-index: 1;
}

#welcomeHeadPreviewWrap {
  width: 72px;
  height: 72px;
  border-radius: 15px;
  align-self: start;
  background: radial-gradient(circle at center, rgba(255,204,0,0.18), rgba(0,0,0,0.55));
  border: 1px solid rgba(255,255,255,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 18px rgba(255,204,0,0.22);
  overflow: hidden;
}

#welcomeHeadPreview {
  width: 66px;
  height: 66px;
  object-fit: contain;
  display: block;
}

#welcomeLoadoutText {
  width: 100%;
  min-width: 0;
  display: block;
}

#welcomeLoadoutText .loadoutTitleGlow,
#welcomeLoadoutText strong.loadoutTitleGlow {
  display: block;
  margin: 0 0 7px;
  color: #ffcc00;
  font-size: 15px;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow:
    0 0 10px rgba(255,204,0,0.75),
    0 0 18px rgba(255,204,0,0.32);
}

.oldLoadoutLineHidden {
  display: none !important;
}

.loadoutChipGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  width: 100%;
  margin: 6px 0 0;
}

.loadoutChip {
  --chip-color: #00d9ff;
  position: relative;
  min-width: 0;
  min-height: 38px;
  padding: 6px 9px;
  border-radius: 11px;
  border: 1px solid color-mix(in srgb, var(--chip-color) 68%, transparent);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--chip-color) 18%, transparent), rgba(0,0,0,0.46)),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.035) 0 1px, transparent 1px 7px);
  box-shadow:
    0 0 12px color-mix(in srgb, var(--chip-color) 28%, transparent),
    inset 0 0 12px rgba(255,255,255,0.035);
  overflow: hidden;
}

.loadoutChip::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
  transform: translateX(-130%);
  animation: loadoutChipShine 4.8s ease-in-out infinite;
  pointer-events: none;
}

.loadoutChip b {
  display: block;
  margin-bottom: 3px;
  color: var(--chip-color);
  font-size: 9px;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 0 8px color-mix(in srgb, var(--chip-color) 70%, transparent);
  opacity: 0.95;
}

.loadoutChip span {
  display: block;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 0 9px rgba(255,255,255,0.22);
}

.loadoutChip_player {
  --chip-color: #00d9ff;
  grid-column: 1 / -1;
  min-height: 40px;
}

.loadoutChip_head { --chip-color: #ffcc00; }
.loadoutChip_prestige { --chip-color: #b800ff; }
.loadoutChip_background { --chip-color: #35a7ff; }
.loadoutChip_relic { --chip-color: #40ff91; }
.loadoutChip_challenge { --chip-color: #ff304d; }
.loadoutChip_paddle { --chip-color: #ff7bff; }

@keyframes loadoutChipShine {
  0%, 78% { transform: translateX(-130%); opacity: 0; }
  82% { opacity: 1; }
  100% { transform: translateX(130%); opacity: 0; }
}

#welcomePrestigeName {
  color: #00d9ff;
}

#welcomeButtons {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 12px;
  width: min(430px, 90vw);
  margin-top: 8px;
}

#welcomeButtons button {
  font-size: 16px;
  padding: 13px 16px;
}

#welcomeButtons button:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  justify-self: center;
  width: min(210px, 100%);
}

#welcomePlayBtn {
  grid-column: 1 / -1;
  font-size: 22px;
  padding: 15px 22px;
  background: #00d9ff;
  color: #001015;
  box-shadow: 0 0 20px rgba(0,217,255,0.55);
}

/* -----------------------------
   Daily Gift menu button
----------------------------- */

#welcomeDailyGiftBtn.dailyGiftReady {
  position: relative;
  padding-right: 56px;
  background: linear-gradient(135deg, #b800ff, #ffcc00 58%, #fff2a8);
  color: #120015;
  overflow: hidden;
  box-shadow:
    0 0 22px rgba(255,204,0,0.72),
    0 0 18px rgba(184,0,255,0.48);
  animation: dailyGiftMenuPulse 1.15s ease-in-out infinite alternate;
}

#welcomeDailyGiftBtn.dailyGiftReady::before {
  content: "READY";
  position: absolute;
  top: 5px;
  right: 8px;
  max-width: 42px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #00d9ff;
  color: #001015;
  font-size: 8px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.06em;
  box-shadow: 0 0 12px rgba(0,217,255,0.72);
  overflow: hidden;
  z-index: 3;
}

#welcomeDailyGiftBtn.dailyGiftReady::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.40), transparent);
  transform: translateX(-130%);
  animation: dailyGiftMenuShine 1.9s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

#welcomeDailyGiftBtn.dailyGiftClaimed {
  background: #555;
  color: #ddd;
  opacity: 0.78;
  box-shadow: 0 0 10px rgba(0,0,0,0.45);
}

@keyframes dailyGiftMenuPulse {
  from { transform: translateY(0); filter: brightness(1); }
  to { transform: translateY(-2px); filter: brightness(1.18); }
}

@keyframes dailyGiftMenuShine {
  0%, 55% { transform: translateX(-130%); opacity: 0; }
  68% { opacity: 1; }
  100% { transform: translateX(130%); opacity: 0; }
}

/* -----------------------------
   Small screens
----------------------------- */

@media (max-width: 700px) {
  #startSplashPanel {
    min-height: 100dvh;
    padding: 18px;
    gap: 14px;
  }

  #startSplashImage {
    width: 94vw;
    max-height: 54vh;
    margin-top: 0;
    clip-path: inset(0 3% 0 3%);
  }

  #startSplashBtn {
    min-width: 220px;
    font-size: 22px;
  }

  #welcomePanel {
    min-height: 420px;
    max-width: 100%;
    overflow-x: hidden;
  }

  #welcomeOverlay,
  #welcomePanel {
    overscroll-behavior-x: none;
  }
  #welcomeTitle { font-size: 30px; }
  #welcomeImage { max-width: 92vw; max-height: 210px; }

  #welcomeLoadout {
    width: min(300px, 78vw);
    max-width: min(300px, 78vw);
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 6px;
    padding: 8px 8px;
    margin-bottom: 12px;
    overflow: hidden;
    box-sizing: border-box;
  }

  #welcomeLoadoutText {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }

  #welcomeHeadPreviewWrap {
    width: 34px;
    height: 34px;
    border-radius: 9px;
  }

  #welcomeHeadPreview {
    width: 31px;
    height: 31px;
  }

  .loadoutChipGrid {
    grid-template-columns: 1fr;
    gap: 3px;
    max-width: 100%;
    overflow: hidden;
  }

  .loadoutChip_player,
  .loadoutChip_paddle,
  .loadoutChip_head,
  .loadoutChip_prestige,
  .loadoutChip_background,
  .loadoutChip_relic,
  .loadoutChip_challenge {
    grid-column: 1 / -1;
    display: block !important;
    width: 100%;
    max-width: 100%;
  }

  /* Mobile fallback chips: show raw loadout lines if the JS chip converter misses them. */
  #welcomeBackgroundName.oldLoadoutLineHidden,
  #welcomeBackgroundName,
  #welcomeRelicName.oldLoadoutLineHidden,
  #welcomeRelicName,
  #welcomeChallengeName.oldLoadoutLineHidden,
  #welcomeChallengeName {
    display: block !important;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-top: 3px;
    padding: 2px 6px;
    border-radius: 7px;
    border: 1px solid rgba(255,48,77,0.68);
    background:
      linear-gradient(135deg, rgba(255,48,77,0.18), rgba(0,0,0,0.46)),
      repeating-linear-gradient(90deg, rgba(255,255,255,0.035) 0 1px, transparent 1px 7px);
    color: #fff;
    font-size: 8.8px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow:
      0 0 10px rgba(255,48,77,0.24),
      inset 0 0 10px rgba(255,255,255,0.03);
  }

  #welcomeBackgroundName.oldLoadoutLineHidden,
  #welcomeBackgroundName,
  #welcomeRelicName.oldLoadoutLineHidden,
  #welcomeRelicName,
  #welcomeChallengeName.oldLoadoutLineHidden,
  #welcomeChallengeName {
    border-color: rgba(255,48,77,0.68);
    background:
      linear-gradient(135deg, rgba(255,48,77,0.18), rgba(0,0,0,0.46)),
      repeating-linear-gradient(90deg, rgba(255,255,255,0.035) 0 1px, transparent 1px 7px);
  }

  #welcomeBackgroundName.oldLoadoutLineHidden,
  #welcomeBackgroundName {
    margin-right: 0;
    border-color: rgba(53,167,255,0.68);
    background:
      linear-gradient(135deg, rgba(53,167,255,0.18), rgba(0,0,0,0.46)),
      repeating-linear-gradient(90deg, rgba(255,255,255,0.035) 0 1px, transparent 1px 7px);
  }

  #welcomeRelicName.oldLoadoutLineHidden,
  #welcomeRelicName {
    border-color: rgba(64,255,145,0.68);
    background:
      linear-gradient(135deg, rgba(64,255,145,0.15), rgba(0,0,0,0.46)),
      repeating-linear-gradient(90deg, rgba(255,255,255,0.035) 0 1px, transparent 1px 7px);
  }

  #welcomeChallengeName.oldLoadoutLineHidden,
  #welcomeChallengeName {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    clear: both;
  }

  .loadoutChip {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    min-height: 19px;
    padding: 2px 6px;
    border-radius: 7px;
    box-sizing: border-box;
  }

  .loadoutChip_player {
    min-height: 20px;
  }

  .loadoutChip b {
    font-size: 6.8px;
    margin-bottom: 0;
  }

  .loadoutChip span {
    font-size: 8.8px;
    line-height: 1;
  }

  #welcomeButtons {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: min(300px, 78vw) !important;
    max-width: min(300px, 78vw) !important;
    gap: 5px !important;
    margin-top: 6px !important;
    overflow: hidden !important;
  }

  #welcomeButtons button,
  #welcomeButtons button:last-child:nth-child(odd) {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    font-size: 10px !important;
    padding: 6px 7px !important;
    min-height: 28px !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
  }

  #welcomePlayBtn {
    grid-column: 1 / -1 !important;
    font-size: 13px !important;
    padding: 8px 12px !important;
    min-height: 32px !important;
    border-radius: 9px !important;
  }

  /* Mobile sidekick layout lock.
     Compact and centered so it stays above the playfield on more phones. */
  #sidekickTipBox {
    left: 50% !important;
    right: auto !important;
    top: clamp(62px, 9dvh, 82px) !important;
    width: min(82vw, 224px) !important;
    max-width: min(82vw, 224px) !important;
    transform: translateX(-50%) !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 0 !important;
  }

  #sidekickTipBox.active {
    transform: translateX(-50%) !important;
  }

  #sidekickPortraitFrame {
    width: 88px !important;
    height: 88px !important;
    margin: 0 auto -11px auto !important;
    border-radius: 18px !important;
    transform: none !important;
  }

  #sidekickPortraitFrame::before {
    inset: 5px !important;
    border-radius: 14px !important;
  }

  #sidekickPortraitFrame::after {
    border-radius: 18px !important;
  }

  #sidekickPortrait {
    width: 74px !important;
    height: 74px !important;
    margin: auto !important;
    transform: none !important;
  }

  #sidekickSpeechBox {
    width: min(82vw, 224px) !important;
    max-width: min(82vw, 224px) !important;
    min-height: 86px !important;
    margin: 0 auto !important;
    padding: 26px 13px 12px !important;
    border-radius: 18px !important;
  }

  #sidekickSpeechName {
    font-size: 11px !important;
    margin-bottom: 6px !important;
  }

  #sidekickSpeechText {
    min-height: 42px !important;
    font-size: 13px !important;
    line-height: 1.25 !important;
  }
}

@media (max-width: 380px), (max-height: 760px) {
  #sidekickTipBox {
    top: clamp(56px, 8dvh, 72px) !important;
    width: min(78vw, 208px) !important;
    max-width: min(78vw, 208px) !important;
  }

  #sidekickPortraitFrame {
    width: 78px !important;
    height: 78px !important;
    margin-bottom: -9px !important;
    border-radius: 16px !important;
  }

  #sidekickPortrait {
    width: 66px !important;
    height: 66px !important;
  }

  #sidekickSpeechBox {
    width: min(78vw, 208px) !important;
    max-width: min(78vw, 208px) !important;
    min-height: 78px !important;
    padding: 23px 11px 10px !important;
    border-radius: 16px !important;
  }

  #sidekickSpeechName {
    font-size: 10px !important;
    margin-bottom: 5px !important;
  }

  #sidekickSpeechText {
    min-height: 36px !important;
    font-size: 12px !important;
    line-height: 1.22 !important;
  }
}
