/* GrowtopiaTools V97: unified usability and visual polish. */
@keyframes v97-gentle-float {0%,100%{transform:translateY(0)}50%{transform:translateY(-2px)}}

/* Sidebar: community shortcut belongs under branding, OUTSIDE the scrolling menu. */
body[data-theme="glass"] #sidebar.side.sidebar > .v78-discord-card{
  flex:0 0 auto;width:calc(100% - 12px);margin:6px 6px 13px;min-height:70px;
  position:relative;z-index:4;
}
body[data-theme="glass"] #sidebar.side.sidebar .v44-nav-stack{flex:1 1 auto;min-height:0;overflow-y:auto!important}
body[data-theme="glass"] #sidebar.side.sidebar .nav-item{gap:12px;min-height:55px}
body[data-theme="glass"] #sidebar.side.sidebar .nav-item .nav-img,
body[data-theme="glass"] #sidebar.side.sidebar .nav-item .nav-icon{width:39px!important;min-width:39px!important;height:39px!important;display:grid;place-items:center}
body[data-theme="glass"] #sidebar.side.sidebar .nav-item .nav-img img,
body[data-theme="glass"] #sidebar.side.sidebar .nav-item .nav-icon img,
body[data-theme="glass"] #sidebar.side.sidebar .nav-item .gt-private-symbol img{width:38px!important;height:38px!important;object-fit:contain;image-rendering:pixelated;max-width:none;max-height:none}
body[data-theme="glass"] #sidebar.side.sidebar .v78-discord-emblem{
  animation:v97-gentle-float 6s ease-in-out infinite;
  border-color:rgba(213,232,255,.48);border-radius:14px;
  background:radial-gradient(circle at 22% 4%,rgba(255,255,255,.34),transparent 55%),linear-gradient(143deg,rgba(140,199,255,.37),rgba(56,106,188,.26));
  box-shadow:inset 0 2px rgba(255,255,255,.27),0 7px 16px rgba(5,22,55,.27);
  transition:transform .25s ease,background .25s ease,box-shadow .25s ease;
}
body[data-theme="glass"] #sidebar.side.sidebar .v78-discord-svg{transition:transform .25s ease;}
body[data-theme="glass"] #sidebar.side.sidebar .v78-discord-card:hover .v78-discord-emblem{transform:translateY(-3px) scale(1.06);border-color:rgba(239,246,255,.85);box-shadow:0 11px 23px rgba(4,20,54,.38),inset 0 1px rgba(255,255,255,.4);animation-play-state:paused}
body[data-theme="glass"] #sidebar.side.sidebar .v78-discord-card:hover .v78-discord-svg{transform:scale(1.10)}

/* Top search: balanced in the actual center, with room to type before opening. */
body[data-theme="glass"] .top.topbar{position:relative}
body[data-theme="glass"] .top.topbar #search-trigger.v62-search-main{
  position:absolute;left:50%;transform:translateX(-50%);
  width:clamp(290px,31vw,450px);max-width:450px;min-width:290px;z-index:4;
  padding:9px 15px;border-radius:14px;
}
body[data-theme="glass"] .top.topbar #search-trigger.v62-search-main:hover,
body[data-theme="glass"] .top.topbar #search-trigger.v62-search-main:focus-visible{transform:translate(-50%,-2px)}
@media(max-width:1600px){
  body[data-theme="glass"] .top.topbar #search-trigger.v62-search-main{width:clamp(220px,23vw,355px);min-width:220px}
}
@media(max-width:1250px){
  body[data-theme="glass"] .top.topbar #search-trigger.v62-search-main{position:static;transform:none;width:220px;min-width:0;margin-left:auto}
  body[data-theme="glass"] .top.topbar #search-trigger.v62-search-main:hover,
  body[data-theme="glass"] .top.topbar #search-trigger.v62-search-main:focus-visible{transform:translateY(-2px)}
}
@media(max-width:1150px){body[data-theme="glass"] .top.topbar #search-trigger.v62-search-main{width:54px;flex:0 0 54px;min-width:54px;justify-content:center}body[data-theme="glass"] .top.topbar #search-trigger.v62-search-main span{display:none}}
@media(max-width:600px){body[data-theme="glass"] .top.topbar #search-trigger.v62-search-main{width:42px;min-width:42px;flex:0 0 42px}}

/* Calendar: no dotted, dashed or cycle outlines. Stronger explanation of rotation. */
body[data-theme="glass"] #content .calendar-panel .calendar-week .day-cell,
body[data-theme="glass"] #content .calendar-panel .calendar-week .day-cell.unknown,
body[data-theme="glass"] #content .calendar-panel .calendar-week .day-cell.v5-cycle-start,
body[data-theme="glass"] #content .calendar-panel .calendar-week .day-cell.v5-cycle-end,
body[data-theme="glass"] #content .calendar-panel .calendar-week .day-cell.selected,
body[data-theme="glass"] #content .calendar-panel .calendar-week .day-cell.today{
  border:0!important;outline:none!important;outline-offset:0!important;
  box-shadow:inset 0 1px rgba(242,250,255,.08),0 3px 12px rgba(2,13,33,.09)!important;
}
body[data-theme="glass"] #content .calendar-panel .calendar-week .day-cell:focus-visible{outline:2px solid rgba(171,218,255,.78)!important;outline-offset:1px!important}
body[data-theme="glass"] #content .calendar-panel .calendar-week .day-cell.unknown .day-title{font-size:clamp(10px,.95vw,12px)!important;line-height:1.2!important}
body[data-theme="glass"] #content .calendar-panel .calendar-week .v86-random-subtitle{
 font-size:clamp(8px,.68vw,10px)!important;letter-spacing:.2px!important;
 font-weight:800!important;color:#afcff7!important;line-height:1.35!important;
 text-align:center;white-space:normal!important;max-width:100%;
}
body[data-theme="glass"] #content .calendar-panel .calendar-week .day-cell.v5-cycle-start .v5-cycle-label,
body[data-theme="glass"] #content .calendar-panel .calendar-week .day-cell.v5-cycle-end .v5-cycle-label{
 display:inline-flex!important;visibility:visible!important;opacity:1!important;
}

/* Leaderboard column labels directly above the corresponding values. */
body[data-theme="glass"] #content .v84-rank-panel .v5-ranking-head span{text-align:center!important;justify-self:center!important;white-space:nowrap}
body[data-theme="glass"] #content .v84-rank-panel .v5-ranking-row>strong{text-align:center!important;justify-self:center!important}
body[data-theme="glass"] #content .v5-record-table .v5-record-columns span:first-child,
body[data-theme="glass"] #content .v5-record-table .v5-record-columns span:last-child{text-align:center!important;justify-self:center!important}
body[data-theme="glass"] #content .v5-record-table .v5-record-row>.v47-record-date{text-align:center!important;justify-self:center!important}

/* Smaller movement for record bubbles. Leave other page animations untouched. */
body[data-theme="glass"] #content .v5-metric-card .v48-metric-dcs button,
body[data-theme="glass"] #content .records-metric-symbol{
  animation:v97-gentle-float 8.6s ease-in-out infinite!important;
}
body[data-theme="glass"] #content .v5-metric-card .v48-metric-dcs button:nth-child(2n){animation-delay:-3.1s!important;animation-duration:9.2s!important}

/* Search modal: recent entries exactly like search results, consistent flag and stat panel. */
body[data-theme="glass"] #modal-root .v97-recent-person.v66-recent-row{
  display:flex!important;align-items:center;gap:10px;min-height:66px;
  margin:6px 0;padding:10px 13px;flex-wrap:nowrap;
}
body[data-theme="glass"] #modal-root .v97-recent-person.v66-recent-row>.v73-search-name{flex:1;min-width:0}
body[data-theme="glass"] #modal-root .v97-recent-person.v66-recent-row>img{width:36px;height:36px;flex:0 0 36px;object-fit:contain;image-rendering:pixelated}
body[data-theme="glass"] #modal-root .v97-recent-person.v66-recent-row .v84-search-stats{display:flex;align-items:center;gap:5px;flex:0 0 auto;justify-content:flex-end}
body[data-theme="glass"] #modal-root .v84-search-stats>span{
  min-width:46px!important;padding:4px 6px!important;gap:3px!important;
  border-radius:9px!important;display:inline-flex;align-items:center;justify-content:center;
}
body[data-theme="glass"] #modal-root .v84-search-stats img{width:29px!important;height:29px!important;max-width:none!important;max-height:none!important;object-fit:contain;image-rendering:pixelated}
body[data-theme="glass"] #modal-root .v84-search-stats b{font-size:12px;font-weight:800}
body[data-theme="glass"] #modal-root .v66-recent-row.v97-recent-challenge{grid-template-columns:34px minmax(0,1fr) auto;}
@media(max-width:640px){
  body[data-theme="glass"] #modal-root .v84-search-stats>span{min-width:33px!important;padding:3px!important;gap:1px!important}
  body[data-theme="glass"] #modal-root .v84-search-stats img{width:23px!important;height:23px!important}
  body[data-theme="glass"] #modal-root .v97-recent-person.v66-recent-row{gap:5px;padding:8px 6px}
  body[data-theme="glass"] #modal-root .v97-recent-person.v66-recent-row>img{width:30px;height:30px;flex-basis:30px}
}

/* Discord invite: full glass, including the previously charcoal-black header. */
body[data-theme="glass"] #modal-root .modal.v97-discord-modal{
 width:min(720px,calc(100vw - 24px));border-radius:24px;overflow:auto;
 border:1px solid rgba(178,219,255,.42)!important;
 background:radial-gradient(circle at 80% -15%,rgba(116,176,255,.17),transparent 53%),linear-gradient(145deg,rgba(35,74,127,.98),rgba(17,38,77,.98))!important;
 box-shadow:inset 0 2px rgba(255,255,255,.18),0 28px 85px rgba(2,11,31,.55)!important;
}
body[data-theme="glass"] #modal-root .modal.v97-discord-modal .v90-community-modal-head{
 background:linear-gradient(130deg,rgba(119,184,254,.16),rgba(28,71,135,.12))!important;
 border-bottom:1px solid rgba(180,219,255,.27)!important;border-radius:24px 24px 0 0;
}
body[data-theme="glass"] #modal-root .modal.v97-discord-modal .v90-community-modal-head h3{color:#f4faff!important;text-shadow:none!important;font-size:21px}
body[data-theme="glass"] #modal-root .v97-discord-modal .v90-community-modal{background:transparent!important;color:#cde0f8}
body[data-theme="glass"] #modal-root .v97-discord-modal .v90-community-join{
  width:auto;flex:1;min-width:210px;min-height:52px;padding:12px 23px;
  border:1px solid rgba(230,240,255,.61)!important;border-radius:15px;
  color:white!important;font-size:15px;font-weight:850;text-align:center;text-decoration:none!important;
  background:linear-gradient(135deg,#697df2,#537ce0 54%,#2d94e6)!important;
  box-shadow:inset 0 1px rgba(255,255,255,.40),0 12px 27px rgba(45,70,172,.39);
  display:inline-flex;align-items:center;gap:10px;justify-content:center;
  transition:transform .22s ease,box-shadow .22s ease,filter .22s ease;
}
body[data-theme="glass"] #modal-root .v97-discord-modal .v90-community-join:hover{
  transform:translateY(-3px);filter:brightness(1.11);
  box-shadow:inset 0 1px rgba(255,255,255,.55),0 17px 34px rgba(47,92,198,.5);
}
body[data-theme="glass"] #modal-root .v97-discord-modal .v90-community-cta-row{display:flex;gap:10px;align-items:center}
body[data-theme="glass"] #modal-root .v97-discord-modal .v90-community-cta-row .close-modal-alt{min-height:46px;color:#d4e8ff}
body[data-theme="glass"] #modal-root .v97-discord-modal .v90-community-perk{
  background:radial-gradient(circle at 22% 3%,rgba(231,248,255,.18),transparent 50%),linear-gradient(130deg,rgba(94,152,227,.22),rgba(22,48,89,.38))!important;
}
body[data-theme="glass"] #modal-root .v97-discord-modal .v97-discord-icon-link{
  text-decoration:none;color:#f3f8ff;cursor:pointer;
  animation:v97-gentle-float 6.5s ease-in-out infinite;
  transition:transform .23s ease,box-shadow .23s ease;
}
body[data-theme="glass"] #modal-root .v97-discord-modal .v97-discord-icon-link:hover{
  transform:translateY(-5px) scale(1.06);animation-play-state:paused;
  box-shadow:inset 0 1px rgba(255,255,255,.45),0 15px 28px rgba(5,25,67,.35)!important;
}
body[data-theme="glass"] #modal-root .v97-discord-modal .v97-discord-icon-link svg{transition:transform .23s ease}
body[data-theme="glass"] #modal-root .v97-discord-modal .v97-discord-icon-link:hover svg{transform:scale(1.12)}
body[data-theme="glass"] #modal-root .v97-discord-modal .v97-discord-icon-link:focus-visible{outline:2px solid #d3eaff;outline-offset:4px}
@media(max-width:650px){body[data-theme="glass"] #modal-root .v97-discord-modal .v90-community-cta-row{flex-direction:column;align-items:stretch}body[data-theme="glass"] #modal-root .v97-discord-modal .v90-community-join{width:100%}}
@media(prefers-reduced-motion:reduce){body[data-theme="glass"] :is(.v78-discord-emblem,.v97-discord-icon-link,.v5-metric-card .v48-metric-dcs button){animation:none!important}}
