/* activity/styles/tombsnake.css */
/* TombSnake — slither.io-style arena overlay styles */


/* ── Overlay ── */
.ts-overlay {
  position: fixed;
  top: calc(var(--sait, 0px) + 48px);
  left: 0;
  right: 0;
  bottom: calc(50px + var(--saib, 0px));
  background: rgba(14,5,24,.96);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 11000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.ts-overlay.ts-overlay-visible {
  opacity: 1;
  pointer-events: auto;
}

/* ── Entry card ── */
.ts-card {
  background: rgba(14,5,24,.92);
  border: 1px solid rgba(180,79,255,.25);
  border-radius: 20px;
  padding: 28px 24px 18px;
  max-width: 660px;
  width: 95vw;
  max-height: 92vh;
  text-align: center;
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 60px rgba(0,0,0,.6), 0 0 60px rgba(180,79,255,.15);
  animation: ts-pop-in .3s cubic-bezier(.34,1.56,.64,1);
  display: flex;
  flex-direction: column;
  align-items: center;
}
@keyframes ts-pop-in {
  from { transform: scale(.88); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
.ts-emoji {
  font-size: clamp(1.8rem,4vw,2.6rem);
  margin-bottom: .1em;
}
.ts-title {
  font-family: 'Baloo 2', cursive;
  font-size: clamp(2.4rem,6vw,4rem);
  font-weight: 800;
  background: linear-gradient(135deg, #d066ff, #7ee8fa, #ffd166);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 32px rgba(180,79,255,.6));
  line-height: 1;
  margin-bottom: .08em;
}
.ts-subtitle {
  font-size: .82rem;
  color: rgba(255,255,255,.4);
  letter-spacing: .22em;
  text-transform: uppercase;
  margin-bottom: .8rem;
}
.ts-scroll {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-height: 60vh;
  overflow-y: auto;
  padding: .2rem .6rem 1rem;
  scrollbar-width: thin;
  scrollbar-color: #b44fff transparent;
}

/* ── Sections ── */
.ts-section {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 16px;
  padding: .75rem .9rem;
  margin-bottom: .75rem;
  width: 100%;
}
.ts-section h3 {
  font-family: 'Baloo 2', cursive;
  font-size: .95rem;
  color: #7ee8fa;
  margin-bottom: .55rem;
  letter-spacing: .07em;
  text-align: center;
}

/* ── Skin grid ── */
.ts-skin-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: .45rem;
  max-height: 190px;
  overflow-y: auto;
  padding: .1rem;
  scrollbar-width: thin;
  scrollbar-color: #b44fff transparent;
}
.ts-skin-card {
  background: rgba(255,255,255,.07);
  border: 2px solid rgba(255,255,255,.13);
  border-radius: 10px;
  padding: .4rem .2rem;
  cursor: pointer;
  transition: all .18s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .2rem;
  position: relative;
  overflow: hidden;
}
.ts-skin-card:hover { border-color: #7ee8fa; transform: scale(1.05); }
.ts-skin-card.ts-skin-selected {
  border-color: #b44fff;
  background: rgba(180,79,255,.18);
}
.ts-skin-card.ts-skin-selected::after {
  content: '✓';
  position: absolute;
  top: 2px; right: 4px;
  color: #b44fff;
  font-size: .65rem;
  font-weight: 800;
}
.ts-skin-preview {
  width: 42px; height: 22px;
  border-radius: 11px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ts-skin-name {
  font-size: .55rem;
  font-weight: 700;
  text-align: center;
  color: rgba(255,255,255,.78);
  line-height: 1.2;
}

/* ── Options ── */
.ts-options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.ts-opt-card {
  background: rgba(255,255,255,.07);
  border: 2px solid rgba(255,255,255,.13);
  border-radius: 12px;
  padding: .7rem .45rem;
  cursor: pointer;
  transition: all .18s;
  text-align: center;
}
.ts-opt-card:hover { border-color: #7ee8fa; transform: translateY(-2px); }
.ts-opt-card.ts-opt-selected { border-color: #b44fff; background: rgba(180,79,255,.18); }
.ts-opt-icon { font-size: 1.5rem; line-height: 1; margin-bottom: .18rem; }
.ts-opt-label { font-family: 'Baloo 2', cursive; font-size: .82rem; font-weight: 700; }
.ts-opt-desc { font-size: .6rem; color: rgba(255,255,255,.48); margin-top: .15rem; line-height: 1.3; }

/* ── Slider ── */
.ts-slider-row { display: flex; align-items: center; gap: .6rem; margin-top: .5rem; }
.ts-slider-row label { font-size: .72rem; color: rgba(255,255,255,.58); white-space: nowrap; min-width: 100px; }
.ts-slider-row input[type=range] { flex: 1; accent-color: #b44fff; }
.ts-slider-val { font-size: .72rem; color: #7ee8fa; min-width: 24px; text-align: right; }

/* ── Rules ── */
.ts-rules-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.ts-rule-item { display: flex; align-items: flex-start; gap: .4rem; font-size: .68rem; color: rgba(255,255,255,.68); line-height: 1.4; }
.ts-rule-icon { font-size: .95rem; flex-shrink: 0; margin-top: .03em; }

/* ── Buttons ── */
.ts-btn-play {
  background: linear-gradient(135deg, #b44fff, #6b00cc);
  border: none;
  border-radius: 50px;
  padding: .72rem 2.2rem;
  font-family: 'Baloo 2', cursive;
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 0 30px rgba(180,79,255,.45), 0 4px 14px rgba(0,0,0,.35);
  transition: all .2s;
  letter-spacing: .05em;
  margin-top: .6rem;
  margin-bottom: .4rem;
}
.ts-btn-play:hover { transform: scale(1.05) translateY(-2px); box-shadow: 0 0 50px rgba(180,79,255,.65); }
.ts-btn-ghost {
  background: transparent;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 50px;
  padding: .5rem 1.4rem;
  font-family: 'Nunito', sans-serif;
  font-size: .85rem;
  color: rgba(255,255,255,.4);
  cursor: pointer;
  transition: all .15s;
}
.ts-btn-ghost:hover { border-color: rgba(255,255,255,.3); color: rgba(255,255,255,.6); }
.ts-btn-again {
  background: linear-gradient(135deg, #7ee8fa, #5bb8d4);
  border: none;
  border-radius: 50px;
  padding: .6rem 1.7rem;
  font-family: 'Baloo 2', cursive;
  font-size: 1.1rem;
  font-weight: 800;
  color: #0e0518;
  cursor: pointer;
  margin: .3rem;
  transition: all .2s;
}
.ts-btn-again:hover { transform: scale(1.05); }
.ts-btn-menu {
  background: rgba(255,255,255,.07);
  border: 2px solid rgba(255,255,255,.13);
  border-radius: 50px;
  padding: .6rem 1.7rem;
  font-family: 'Baloo 2', cursive;
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  margin: .3rem;
  transition: all .2s;
}
.ts-btn-menu:hover { border-color: #b44fff; }

/* ── Game wrapper ── */
.ts-game-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #0e0518;
}
#ts-canvas {
  display: block;
  cursor: none;
  position: absolute;
  inset: 0;
}

/* ── Close button ── */
.ts-close-btn {
  position: absolute;
  top: 14px; right: 14px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,.5);
  border: 1px solid rgba(255,255,255,.15);
  color: rgba(255,255,255,.6);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 25;
  backdrop-filter: blur(10px);
  transition: all .15s;
}
.ts-close-btn:hover {
  background: rgba(180,79,255,.3);
  border-color: #b44fff;
  color: #fff;
}

/* ── HUD ── */
.ts-hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  padding: .7rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  z-index: 10;
}
.ts-hud-box {
  background: rgba(14,5,24,.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 12px;
  padding: .38rem .85rem;
  font-family: 'Baloo 2', cursive;
  font-size: .88rem;
}
.ts-hud-score { color: #ffd166; }
.ts-hud-length { color: #7ee8fa; }
.ts-hud-best { color: #ffd166; }
.ts-hud-poison {
  color: #39ff14;
  font-size: .72rem;
  margin-top: .18rem;
  display: none;
  animation: ts-poisonFlash .4s infinite;
}
@keyframes ts-poisonFlash { 0%,100%{opacity:1} 50%{opacity:.28} }

/* ── Border warning ── */
.ts-border-warn {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 9;
  border: 0px solid rgba(255,50,50,0);
  transition: border-width .07s, border-color .07s, box-shadow .07s;
}
.ts-border-warn.ts-danger {
  border-width: 14px;
  border-color: rgba(255,60,60,.68);
  box-shadow: inset 0 0 55px rgba(255,0,0,.42);
}

/* ── Minimap ── */
.ts-minimap {
  position: absolute;
  bottom: 1rem; right: 1rem;
  width: 120px; height: 120px;
  background: rgba(0,0,0,.45);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 11px;
  overflow: hidden;
  z-index: 10;
}
.ts-minimap canvas { width: 100%; height: 100%; }

/* ── Leaderboard ── */
.ts-leaderboard {
  position: absolute;
  top: 4.5rem; right: 1rem;
  background: rgba(14,5,24,.8);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 12px;
  padding: .55rem .75rem;
  z-index: 10;
  min-width: 148px;
}
.ts-leaderboard h4 {
  font-family: 'Baloo 2', cursive;
  color: #ffd166;
  font-size: .76rem;
  margin-bottom: .32rem;
  text-align: center;
  letter-spacing: .1em;
}
.ts-lb-entry {
  display: flex;
  justify-content: space-between;
  font-size: .68rem;
  padding: .08rem 0;
  color: rgba(255,255,255,.68);
  gap: .35rem;
}
.ts-lb-entry.ts-me { color: #b44fff; font-weight: 700; }
.ts-lb-num { color: rgba(255,255,255,.35); }

/* ── WASD HUD ── */
.ts-wasd-hud {
  position: absolute;
  bottom: 3rem; left: 50%;
  transform: translateX(-50%);
  display: none;
  gap: .2rem;
  flex-direction: column;
  align-items: center;
  z-index: 10;
  pointer-events: none;
}
.ts-kbd-row { display: flex; gap: .2rem; }
.ts-kbd {
  width: 29px; height: 29px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Baloo 2', cursive;
  font-size: .65rem;
  color: #fff;
  transition: all .1s;
}
.ts-kbd.ts-active {
  background: rgba(180,79,255,.38);
  border-color: #b44fff;
  color: #b44fff;
}

/* ── Boost bar ── */
.ts-boost-bar {
  position: absolute;
  bottom: 2rem; left: 50%;
  transform: translateX(-50%);
  width: 160px; height: 6px;
  background: rgba(255,255,255,.12);
  border-radius: 99px;
  z-index: 10;
  overflow: hidden;
}
.ts-boost-fill {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, #b44fff, #7ee8fa);
  border-radius: 99px;
  transition: width .08s;
}
.ts-boost-tip {
  position: absolute;
  bottom: .8rem; left: 50%;
  transform: translateX(-50%);
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 50px;
  padding: .25rem .85rem;
  font-size: .65rem;
  color: rgba(255,255,255,.42);
  z-index: 10;
  pointer-events: none;
  white-space: nowrap;
}

/* ── Dead screen ── */
.ts-dead-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.ts-dead-title {
  font-family: 'Baloo 2', cursive;
  font-size: 3.2rem;
  font-weight: 800;
  color: #b44fff;
  filter: drop-shadow(0 0 22px #b44fff);
  animation: ts-deadShake .5s;
}
@keyframes ts-deadShake {
  0%,100%{transform:translateX(0)} 20%{transform:translateX(-10px)} 40%{transform:translateX(10px)}
  60%{transform:translateX(-8px)} 80%{transform:translateX(8px)}
}
.ts-dead-stats {
  margin: 1rem 0;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 16px;
  padding: 1rem 1.8rem;
}
.ts-dead-stats p {
  font-size: .92rem;
  color: rgba(255,255,255,.68);
  margin: .2rem 0;
}
.ts-dead-stats span {
  color: #7ee8fa;
  font-weight: 700;
}
.ts-dead-btns {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .3rem;
}
