/* Launch intro: shown once per session on first load, then removed. */
#tt-splash{
  position:fixed;inset:0;z-index:99999;
  display:flex;align-items:center;justify-content:center;
  padding:env(safe-area-inset-top) 24px env(safe-area-inset-bottom);
  background:radial-gradient(ellipse at 50% 42%,#0b3d91 0%,#062a6b 72%);
  color:#fff;
  font-family:-apple-system,"PingFang TC","Noto Sans TC","Noto Sans CJK TC","Microsoft JhengHei",system-ui,sans-serif;
  -webkit-font-smoothing:antialiased;
  pointer-events:auto;
}
html.splash-done #tt-splash{display:none!important}
html.splash-out #tt-splash{
  opacity:0;pointer-events:none;
  transition:opacity .32s ease;
}
.tt-splash-inner{
  display:flex;flex-direction:column;align-items:center;gap:clamp(22px,5vh,40px);
  width:min(100%,420px);
  transform:translateY(-4%);
}

.tt-splash-logo{
  width:min(58vw,200px);
  height:auto;
  display:block;
  filter:drop-shadow(0 12px 24px rgba(0,0,0,.28));
  opacity:0;transform:translateY(12px) scale(.96);
  animation:tt-title .55s ease .08s both;
}
.tt-splash-tag{
  text-align:center;
}

.tt-splash-scene{
  position:relative;
  width:min(86vw,360px);
  height:clamp(150px,32vh,230px);
  filter:drop-shadow(0 18px 28px rgba(0,0,0,.28));
}
.tt-splash-table{
  position:absolute;left:0;right:0;bottom:8px;
  height:58%;
  background:
    linear-gradient(180deg,#1fb072 0%,#128056 42%,#0c5a3a 100%);
  clip-path:polygon(14% 0,86% 0,100% 100%,0 100%);
  box-shadow:0 8px 18px rgba(0,0,0,.25);
}
.tt-splash-table::before{
  content:"";position:absolute;left:14%;right:14%;top:0;height:7px;background:#f4f7fb;
}
.tt-splash-table::after{
  content:"";position:absolute;left:50%;top:7px;bottom:0;width:4px;margin-left:-2px;background:#f4f7fb;
}
.tt-splash-net{
  position:absolute;left:16%;right:16%;bottom:42%;
  height:26%;
  background:
    linear-gradient(#f4f7fb 0 22%,transparent 22%),
    repeating-linear-gradient(-45deg,rgba(230,238,246,.55) 0 1px,transparent 1px 6px),
    repeating-linear-gradient(45deg,rgba(230,238,246,.45) 0 1px,transparent 1px 6px),
    linear-gradient(180deg,#1a3048,#0b1c2c);
  border-radius:1px;
  z-index:2;
}
.tt-splash-net::before,.tt-splash-net::after{
  content:"";position:absolute;top:-18%;width:6px;height:128%;
  background:#1a2838;border-radius:2px;
}
.tt-splash-net::before{left:-5px}
.tt-splash-net::after{right:-5px}
.tt-splash-paddle{
  position:absolute;left:10%;bottom:30%;
  width:72px;height:72px;
  background:radial-gradient(circle at 32% 28%,#ffc07a,#ff8a3d 36%,#ff6a13 58%,#d44500);
  border:6px solid #5a2e10;
  border-radius:50%;
  z-index:4;
  transform-origin:70% 120%;
  animation:tt-paddle 1.05s cubic-bezier(.2,.7,.25,1) both;
}
.tt-splash-paddle::after{
  content:"";position:absolute;left:50%;top:86%;
  width:15px;height:42px;margin-left:-7.5px;
  background:linear-gradient(90deg,#8a5420 0%,#f0d0a8 45%,#b07838 100%);
  border-radius:3px 3px 5px 5px;
}
.tt-splash-ball{
  position:absolute;left:50%;top:50%;
  width:26px;height:26px;margin:-13px 0 0 -13px;
  border-radius:50%;
  background:radial-gradient(circle at 32% 30%,#fff 0 42%,#e7eef6 68%,#b7c4d4 100%);
  box-shadow:2px 3px 0 -1px rgba(140,160,180,.28),0 6px 10px rgba(0,0,0,.25);
  z-index:5;
  animation:tt-ball 1.05s cubic-bezier(.25,.7,.25,1) both;
}
.tt-splash-shadow{
  position:absolute;left:50%;bottom:14%;
  width:28px;height:10px;margin-left:-14px;
  background:rgba(0,0,0,.35);
  border-radius:50%;
  filter:blur(2px);
  z-index:3;
  animation:tt-shadow 1.05s cubic-bezier(.25,.7,.25,1) both;
}
.tt-splash-brand{text-align:center}
.tt-splash-name{
  font-size:clamp(28px,7.4vw,40px);
  font-weight:900;letter-spacing:.12em;line-height:1.2;
  text-indent:.12em;
  opacity:0;transform:translateY(10px);
  animation:tt-title .5s ease .38s both;
}
.tt-splash-name::after{
  content:"";display:block;width:42px;height:3px;margin:10px auto 0;
  border-radius:2px;background:#ff6a13;
  transform:scaleX(.2);transform-origin:center;
  animation:tt-rule .4s ease .62s both;
}
.tt-splash-tag{
  margin-top:8px;
  font-size:clamp(13px,3.4vw,16px);
  font-weight:700;letter-spacing:.18em;text-indent:.18em;
  color:#c5d3ee;
  opacity:0;transform:translateY(8px);
  animation:tt-title .45s ease .58s both;
}

@keyframes tt-paddle{
  0%{transform:rotate(-48deg) translate(-8px,6px)}
  16%{transform:rotate(-18deg) translate(2px,-2px)}
  100%{transform:rotate(-26deg) translate(0,0)}
}
@keyframes tt-ball{
  0%{transform:translate(-118px,28px) scale(1)}
  18%{transform:translate(-86px,10px) scale(1.02)}
  48%{transform:translate(0,-62px) scale(1.06)}
  78%{transform:translate(112px,26px) scale(1)}
  88%{transform:translate(104px,8px) scale(1)}
  100%{transform:translate(96px,22px) scale(1)}
}
@keyframes tt-shadow{
  0%{transform:translate(-118px,0) scale(1,.45);opacity:.4}
  18%{transform:translate(-86px,0) scale(.8,.4);opacity:.28}
  48%{transform:translate(0,0) scale(.45,.28);opacity:.14}
  78%{transform:translate(112px,0) scale(1,.45);opacity:.4}
  88%{transform:translate(104px,0) scale(.75,.35);opacity:.28}
  100%{transform:translate(96px,0) scale(1,.45);opacity:.38}
}
@keyframes tt-title{
  from{opacity:0;transform:translateY(10px)}
  to{opacity:1;transform:translateY(0)}
}
@keyframes tt-rule{
  from{transform:scaleX(.2);opacity:0}
  to{transform:scaleX(1);opacity:1}
}

/* Frozen frames for previews (?splash_frame=) */
#tt-splash.tt-frame-start .tt-splash-paddle{animation:none;transform:rotate(-48deg) translate(-8px,6px)}
#tt-splash.tt-frame-start .tt-splash-ball{animation:none;transform:translate(-118px,28px)}
#tt-splash.tt-frame-start .tt-splash-shadow{animation:none;transform:translate(-118px,0) scale(1,.45);opacity:.4}
#tt-splash.tt-frame-start .tt-splash-name,
#tt-splash.tt-frame-start .tt-splash-tag,
#tt-splash.tt-frame-start .tt-splash-name::after{animation:none;opacity:0;transform:translateY(10px)}

#tt-splash.tt-frame-arc .tt-splash-paddle{animation:none;transform:rotate(-18deg) translate(2px,-2px)}
#tt-splash.tt-frame-arc .tt-splash-ball{animation:none;transform:translate(0,-62px) scale(1.06)}
#tt-splash.tt-frame-arc .tt-splash-shadow{animation:none;transform:translate(0,0) scale(.45,.28);opacity:.14}
#tt-splash.tt-frame-arc .tt-splash-name{animation:none;opacity:1;transform:none}
#tt-splash.tt-frame-arc .tt-splash-name::after{animation:none;transform:scaleX(.8);opacity:1}
#tt-splash.tt-frame-arc .tt-splash-tag{animation:none;opacity:.35;transform:translateY(6px)}

#tt-splash.tt-frame-land .tt-splash-paddle{animation:none;transform:rotate(-26deg)}
#tt-splash.tt-frame-land .tt-splash-ball{animation:none;transform:translate(96px,22px)}
#tt-splash.tt-frame-land .tt-splash-shadow{animation:none;transform:translate(96px,0) scale(1,.45);opacity:.38}
#tt-splash.tt-frame-land .tt-splash-name,
#tt-splash.tt-frame-land .tt-splash-tag{animation:none;opacity:1;transform:none}
#tt-splash.tt-frame-land .tt-splash-name::after{animation:none;transform:scaleX(1);opacity:1}

@media (min-width:700px){
  .tt-splash-inner{width:min(100%,520px);gap:48px}
  .tt-splash-scene{width:min(70vw,460px);height:270px}
  .tt-splash-paddle{width:88px;height:88px;border-width:7px}
  .tt-splash-ball{width:32px;height:32px;margin:-16px 0 0 -16px}
  .tt-splash-name{letter-spacing:.14em}
}

@media (prefers-reduced-motion:reduce){
  #tt-splash .tt-splash-paddle,
  #tt-splash .tt-splash-ball,
  #tt-splash .tt-splash-shadow,
  #tt-splash .tt-splash-name,
  #tt-splash .tt-splash-tag,
  #tt-splash .tt-splash-name::after{
    animation:none!important;
  }
  #tt-splash .tt-splash-paddle{transform:rotate(-26deg)}
  #tt-splash .tt-splash-ball{transform:translate(40px,-30px)}
  #tt-splash .tt-splash-shadow{transform:translate(40px,0) scale(.6,.35);opacity:.2}
  #tt-splash .tt-splash-name,
  #tt-splash .tt-splash-tag{opacity:1;transform:none}
  #tt-splash .tt-splash-name::after{transform:scaleX(1)}
  html.splash-out #tt-splash{transition:opacity .18s ease}
}
