/* Core UI: framed avatars, home best cards, and service-banner carousel */

/* Shared framed avatar rendering */
.avatar.avatar-frame-image{position:relative;overflow:visible!important;isolation:isolate;border-color:transparent!important;box-shadow:none!important;background:transparent!important}
.avatar.avatar-frame-image>.avatar-photo{position:absolute;inset:7%;z-index:1;display:grid;place-items:center;overflow:hidden;border-radius:inherit;background:#dfe7ff;color:#2949bc}
.avatar.avatar-frame-image>.avatar-photo>img{display:block;width:100%;height:100%;object-fit:cover}
.avatar.avatar-frame-image>.avatar-frame-layer{position:absolute!important;z-index:3;inset:-9%!important;width:118%!important;height:118%!important;max-width:none!important;max-height:none!important;object-fit:contain!important;pointer-events:none;border:0!important;border-radius:0!important;background:transparent!important}
.avatar.avatar-frame-image>img:not(.avatar-frame-layer){position:absolute;inset:7%;z-index:1;width:86%;height:86%;border-radius:inherit;object-fit:cover}
.avatar.avatar-frame-image>b{position:relative;z-index:2}
.avatar.avatar-frame-image .avatar-photo>b{display:grid;place-items:center;width:100%;height:100%;line-height:1}

/* Profile nickname */
.profile-nickname-card{padding:20px;border:1px solid #e3e9f7;border-radius:20px;background:linear-gradient(135deg,#f8faff,#eef2ff);margin-bottom:14px}
.profile-nickname-card h2{margin:5px 0 4px;font-size:20px}
.profile-nickname-card p{margin:0 0 13px;color:#69738e;font-size:13px}
.profile-nickname-form{display:flex;gap:8px}
.profile-nickname-form input{flex:1;min-width:0;border:1px solid #cdd8f1;border-radius:12px;background:#fff;padding:11px 12px;font:inherit}

/* Home BEST */
.home-best-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}
.home-best-card{min-width:0;border:1px solid #e5eaf5;border-radius:20px;background:#fff;overflow:hidden;box-shadow:0 10px 30px rgba(29,46,105,.06)}
.home-best-card>header{display:flex;align-items:center;gap:9px;padding:15px;border-bottom:1px solid #eef1f7}
.home-best-card>header>span{display:grid;place-items:center;width:32px;height:32px;border-radius:11px;background:#edf2ff;font-size:17px}
.home-best-card>header>div{min-width:0;flex:1}
.home-best-card header small{display:block;color:#5470cf;font-size:10px;font-weight:900;letter-spacing:.06em}
.home-best-card header h3{margin:2px 0 0;font-size:15px}
.home-best-card header a{font-size:11px;font-weight:800;color:#375be0;white-space:nowrap}
.home-best-media-list,.home-best-room-list{display:grid;gap:1px;padding:7px}
.home-best-media-list>a,.home-best-room-list>a{display:grid;grid-template-columns:48px minmax(0,1fr);column-gap:9px;align-items:center;min-height:53px;padding:5px;border-radius:12px}
.home-best-media-list>a:hover,.home-best-room-list>a:hover{background:#f6f8ff}
.home-best-media-list>a>span,.home-best-room-list>a>span{grid-row:1/3;width:48px;height:42px;border-radius:9px;background:#eef2ff center/cover no-repeat;display:grid;place-items:center;overflow:hidden;font-size:19px}
.home-best-room-list img{width:100%;height:100%;object-fit:cover}
.home-best-media-list b,.home-best-room-list b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}
.home-best-media-list small,.home-best-room-list small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#8490aa;font-size:10px}
.home-best-media-list p,.home-best-room-list p{padding:18px 8px;margin:0;color:#8790a9;font-size:12px}

/* Service banners. No color filter, no decorative rings, no side arrows. */
.service-managed-banner{position:relative;margin:0 0 28px;border-radius:28px;overflow:hidden;background:#101733;isolation:isolate}
.service-banner-viewport{position:relative;overflow:hidden;border-radius:inherit;background:#101733}
.service-banner-track{display:flex;width:100%;will-change:transform;transition:transform .56s cubic-bezier(.2,.75,.2,1)}
.service-banner-slide{position:relative;display:block;flex:0 0 100%;width:100%;height:400px;min-height:400px;overflow:hidden;background:#101733}
.service-banner-media{position:absolute;inset:0;z-index:0;display:block;width:100%;height:100%;margin:0;padding:0}
.service-banner-media img{display:block;width:100%;height:100%;max-width:none;object-fit:cover;object-position:center}
.service-banner-cover-link{position:absolute;z-index:2;inset:0;display:block}
.service-managed-banner-copy{position:absolute;z-index:3;left:clamp(24px,5vw,72px);top:50%;display:flex;flex-direction:column;align-items:flex-start;max-width:min(560px,calc(100% - 48px));transform:translateY(-50%);color:#fff;text-shadow:0 2px 13px rgba(0,0,0,.62);pointer-events:none}
.service-managed-banner-copy h1{margin:0 0 14px;color:#fff;font-size:clamp(30px,3.8vw,54px);line-height:1.08;letter-spacing:-.062em;text-wrap:balance}
.service-managed-banner-copy p{margin:0 0 20px;color:#fff;font-size:16px;line-height:1.58;text-wrap:balance}
.service-managed-banner-copy .soft-button{position:relative;z-index:4;background:#fff;color:#1f3eaa;text-shadow:none;box-shadow:0 8px 22px rgba(0,0,0,.18);pointer-events:auto}
.service-banner-controls{position:absolute;z-index:8;inset:auto 0 16px;display:flex;align-items:center;justify-content:center;pointer-events:none}
.service-banner-dots{display:flex;align-items:center;justify-content:center;gap:7px;pointer-events:auto}
.service-banner-dots button{width:24px;height:4px;margin:0;padding:0;border:0;border-radius:999px;background:rgba(255,255,255,.5);box-shadow:0 1px 4px rgba(0,0,0,.2);transition:width .22s ease,background .22s ease}
.service-banner-dots button.is-active{width:42px;background:#fff}

/* When the managed banner is on, hide the legacy hero right after it. */
body.page-tinsinger .service-managed-banner + .tinsinger-stage-hero,
body.page-tindancing .service-managed-banner + .tindancing-stage-hero,
body.page-more .service-managed-banner + .service-hero,
body.page-community .service-managed-banner + .community-shell .community-hero,
body.page-shopping .service-managed-banner + .tintok-shopping-page .tinshopping-head{display:none}
body.page-contest .service-managed-banner + .tournament-page .tournament-hero{display:none}
.tintok-shell .service-managed-banner + .tintok-hero{display:none}
.service-managed-banner + [data-tingame-hub] .tingame-hero{display:none}

/* Service-banner admin */
.service-banner-admin-panel>header{align-items:flex-start}
.service-banner-admin-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
.service-banner-admin-card{border:1px solid #e3e8f3;border-radius:18px;padding:18px;background:#fbfcff}
.service-banner-admin-card h3{margin:3px 0 0;font-size:20px}
.service-banner-admin-card-head{display:flex;align-items:center;justify-content:space-between;gap:14px}
.service-banner-service-toggle{display:flex;align-items:center;justify-content:flex-end;gap:7px;flex-wrap:wrap}
.service-banner-service-toggle .check-row{margin:0;font-size:12px}
.service-banner-service-toggle .text-button{padding:8px 10px}
.service-banner-admin-card .form-help{margin:10px 0 14px;color:#75819b;font-size:12px;line-height:1.55}
.service-banner-slide-admin-list{display:grid;gap:12px}
.service-banner-slide-admin{border:1px solid #e3e9f5;border-radius:14px;padding:13px;background:#fff}
.service-banner-slide-admin-top{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
.service-banner-slide-admin-top>b{font-size:14px}
.service-banner-slide-admin-top .check-row{margin:0;font-size:12px}
.service-banner-admin-device-previews{display:grid;grid-template-columns:1fr 100px;gap:8px;margin-bottom:10px}
.service-banner-admin-device-previews figure{margin:0;min-width:0}
.service-banner-admin-device-previews figcaption{margin-top:4px;color:#77829a;font-size:10px;font-weight:800}
.service-banner-admin-preview{height:94px;border-radius:11px;background:#eaf0ff center/cover no-repeat;display:flex;align-items:flex-end;padding:8px;overflow:hidden}
.service-banner-admin-preview:not(.has-image){background:linear-gradient(120deg,#263b86,#4f66f0)}
.service-banner-admin-preview-mobile{width:58px;justify-self:center}
.service-banner-admin-preview span{font-size:10px;font-weight:900;color:#fff;letter-spacing:.05em;text-shadow:0 1px 3px rgba(0,0,0,.58)}
.service-banner-admin-file-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:10px 0}
.service-banner-admin-file-grid label,.service-banner-admin-fields label{display:grid;gap:5px;margin:0;color:#55627d;font-size:11px;font-weight:800}
.service-banner-admin-file-grid input[type=file],.service-banner-admin-fields input,.service-banner-admin-fields textarea{width:100%;margin:0;padding:8px 9px;border:1px solid #dce3f1;border-radius:9px;background:#fff;color:#25304e;font:inherit;font-size:12px}
.service-banner-admin-file-grid .check-row{display:flex;align-items:center;gap:6px;font-size:11px}
.service-banner-admin-fields{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.service-banner-admin-fields label:nth-child(2){grid-column:1/-1}
.service-banner-slide-admin .primary-button{margin-top:11px;padding:9px 12px;font-size:12px}

@media(max-width:920px){
  .home-best-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .service-banner-slide{height:300px;min-height:300px}
  .service-banner-admin-grid{grid-template-columns:1fr}
}
@media(max-width:680px){
  .topbar{position:relative}.topbar .brand{margin-right:auto}.topbar-actions{margin-left:auto;gap:6px}.topbar-actions .hello{display:none}.topbar-actions .profile-top-link{order:2;padding:0}.topbar-actions .bell-link{order:1}.topbar-actions .admin-link{display:none}.topbar-actions .inline-form{display:none}.topbar-actions .avatar-tiny{width:38px;height:38px;border-radius:13px}.topbar-actions .avatar-tiny.avatar-frame-image>.avatar-photo{inset:7%}
  .home-best-grid{grid-template-columns:1fr}
  .profile-nickname-form{display:grid;grid-template-columns:1fr}.profile-nickname-form .soft-button{width:100%}
  .service-managed-banner{margin-left:-8px;margin-right:-8px;border-radius:22px}
  .service-banner-slide{height:236px;min-height:236px}
  .service-managed-banner-copy{left:22px;max-width:calc(100% - 44px)}
  .service-managed-banner-copy h1{font-size:32px;margin-bottom:10px}
  .service-managed-banner-copy p{font-size:13px;margin-bottom:15px}
  .service-banner-controls{bottom:11px}
  .service-banner-dots button{width:18px;height:3px}
  .service-banner-dots button.is-active{width:32px}
  .service-banner-admin-card-head{align-items:flex-start;display:grid}
  .service-banner-service-toggle{justify-content:flex-start}
  .service-banner-admin-device-previews{grid-template-columns:1fr 82px}
  .service-banner-admin-preview{height:84px}
  .service-banner-admin-preview-mobile{width:50px}
  .service-banner-admin-file-grid,.service-banner-admin-fields{grid-template-columns:1fr}
  .service-banner-admin-fields label:nth-child(2){grid-column:auto}
  .service-banner-slide-admin-top{align-items:flex-start;display:grid}
  .service-banner-slide-admin-top .check-row{justify-self:start}
}
