:root {
  --ink: #1b1622;
  --cream: #fff6dc;
  --title: "Luckiest Guy", "Arial Black", Impact, sans-serif;
  --ui: "Lilita One", "Arial Black", sans-serif;
  --pc: #3b7bff;
  --pd: #1f4bb8;
  --pl: #d6e4ff;
  /* thick cartoon outline for text */
  --outline: 3px 0 0 var(--ink), -3px 0 0 var(--ink), 0 3px 0 var(--ink), 0 -3px 0 var(--ink),
    2px 2px 0 var(--ink), -2px 2px 0 var(--ink), 2px -2px 0 var(--ink), -2px -2px 0 var(--ink);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #1b1622;
  color: var(--ink);
  font-family: var(--ui);
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#game { position: fixed; inset: 0; width: 100%; height: 100%; display: none; }
#ui { position: fixed; inset: 0; pointer-events: none; }
#ui > * { pointer-events: auto; }

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #ffbe2e;
}
.screen > * { position: relative; z-index: 1; }

.sunburst {
  position: fixed !important;
  z-index: 0 !important;
  left: 50%; top: 50%;
  width: 260vmax; height: 260vmax;
  margin: -130vmax 0 0 -130vmax;
  background: repeating-conic-gradient(from 0deg, #ffd34a 0deg 9deg, #ffb52a 9deg 18deg);
  animation: spin 70s linear infinite;
}
.screen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0) 45%, rgba(120, 40, 0, 0.35) 100%);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- buttons */

.btn {
  font-family: var(--title);
  font-size: 26px;
  line-height: 1;
  color: #fff;
  padding: 14px 30px 10px;
  border: 4px solid var(--ink);
  border-radius: 18px;
  background: linear-gradient(#7fe05d, #2eaa2f);
  box-shadow: 0 6px 0 var(--ink), inset 0 -6px 0 rgba(0, 0, 0, 0.18);
  text-shadow: var(--outline), 0 4px 0 var(--ink);
  letter-spacing: 1px;
  position: relative;
  cursor: pointer;
  transition: transform 0.09s ease-out, box-shadow 0.09s;
  overflow: hidden;
}
.btn::before {
  content: "";
  position: absolute;
  left: 8px; right: 8px; top: 4px;
  height: 42%;
  border-radius: 12px 12px 40px 40px;
  background: linear-gradient(rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.1));
  pointer-events: none;
}
.btn:hover { transform: translateY(-2px) scale(1.05) rotate(-1deg); }
.btn:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--ink), inset 0 -3px 0 rgba(0, 0, 0, 0.18); }
.btn.orange { background: linear-gradient(#ffd75e, #ff8f1f); }
.btn.green { background: linear-gradient(#7fe05d, #2eaa2f); }
.btn.blue { background: linear-gradient(#6fb2ff, #2b62e8); }
.btn.red { background: linear-gradient(#ff7a85, #e2283b); }
.btn.grey { background: linear-gradient(#b9b6c6, #7a7590); }
.btn.small { font-size: 17px; padding: 10px 18px 7px; border-radius: 14px; box-shadow: 0 4px 0 var(--ink), inset 0 -4px 0 rgba(0, 0, 0, 0.18); }
.btn.big { font-size: 46px; padding: 18px 58px 12px; border-radius: 24px; animation: pulse 1.1s ease-in-out infinite; }
.btn.big:hover { animation-play-state: paused; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }

.row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.panel {
  background: var(--cream);
  border: 5px solid var(--ink);
  border-radius: 26px;
  box-shadow: 0 10px 0 var(--ink);
}

.sticker {
  position: absolute;
  font-family: var(--title);
  color: #fff;
  background: #e8323e;
  border: 4px solid var(--ink);
  border-radius: 12px;
  padding: 8px 12px 4px;
  box-shadow: 0 5px 0 var(--ink);
  text-shadow: 2px 2px 0 var(--ink);
  z-index: 3;
  white-space: nowrap;
}

/* ---------------------------------------------------------------- title */

/* The title screen is see-through: a live match plays on the canvas behind it. */
.screen.title { background: transparent; }
.screen.title::after {
  background:
    radial-gradient(ellipse 60% 55% at 50% 42%, rgba(27, 22, 34, 0.42) 0%, rgba(27, 22, 34, 0.18) 60%, rgba(27, 22, 34, 0) 100%),
    linear-gradient(rgba(27, 22, 34, 0.35), rgba(27, 22, 34, 0) 22%, rgba(27, 22, 34, 0) 70%, rgba(27, 22, 34, 0.55));
}
.debug-link { color: inherit; opacity: 0.85; }
.title .footer { color: #fff; text-shadow: 1px 1px 0 var(--ink), -1px 1px 0 var(--ink), 1px -1px 0 var(--ink), -1px -1px 0 var(--ink); }

/* Wide screens: menu in a left column, the live battle on the right. */
@media (min-width: 900px) {
  .screen.title { align-items: flex-start; }
  .title .title-wrap { align-items: flex-start; margin-left: max(24px, 4vw); gap: 14px; }
  .title .logo-box { text-align: left; }
  .title .s1 { right: -112px; top: 18px; }
  .title .logo { align-items: flex-start; }
  .title .logo-sub { font-size: clamp(24px, 2.9vw, 40px); margin-left: 10px; }
  .title .logo-big { font-size: clamp(70px, 9vw, 130px); }
  .title .row { justify-content: flex-start; }
  .title .btn.big { margin-left: 8px; }
  .title .footer { text-align: left; padding-left: max(24px, 4vw); }
  .screen.title::after {
    background:
      linear-gradient(90deg, rgba(27, 22, 34, 0.62) 0%, rgba(27, 22, 34, 0.38) 34%, rgba(27, 22, 34, 0) 58%),
      linear-gradient(rgba(27, 22, 34, 0.2), rgba(27, 22, 34, 0) 18%, rgba(27, 22, 34, 0) 78%, rgba(27, 22, 34, 0.45));
  }
}

.title-wrap { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 16px; }
.logo-box { position: relative; text-align: center; }
.logo {
  margin: 0;
  font-family: var(--title);
  font-weight: normal;
  line-height: 0.88;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.logo .l { display: inline-block; animation: bob 1.8s ease-in-out infinite; animation-delay: calc(var(--i) * -0.13s); }
.logo .sp { display: inline-block; width: 0.3em; }
.logo-sub {
  font-size: clamp(22px, 4.2vw, 46px);
  letter-spacing: 1px;
  margin-top: 6px;
  text-shadow: 3px 0 0 var(--ink), -3px 0 0 var(--ink), 0 3px 0 var(--ink), 0 -3px 0 var(--ink),
    2px 2px 0 var(--ink), -2px 2px 0 var(--ink), 2px -2px 0 var(--ink), -2px -2px 0 var(--ink), 0 6px 0 var(--ink);
  transform: rotate(-3deg);
}
.logo-big {
  font-size: clamp(64px, 15vw, 168px);
  letter-spacing: 2px;
  text-shadow: 6px 0 0 var(--ink), -6px 0 0 var(--ink), 0 6px 0 var(--ink), 0 -6px 0 var(--ink),
    4px 4px 0 var(--ink), -4px 4px 0 var(--ink), 4px -4px 0 var(--ink), -4px -4px 0 var(--ink),
    0 14px 0 var(--ink), 0 18px 0 rgba(0, 0, 0, 0.25);
  transform: rotate(-3deg);
}
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-7px) rotate(-2deg); } }
.s1 { right: -34px; top: -18px; transform: rotate(12deg); font-size: 18px; animation: wobble 2.4s ease-in-out infinite; }
@keyframes wobble { 0%, 100% { transform: rotate(12deg) scale(1); } 50% { transform: rotate(6deg) scale(1.08); } }

.ribbon {
  display: inline-block;
  margin-top: 14px;
  background: #fff;
  border: 4px solid var(--ink);
  border-radius: 10px;
  box-shadow: 0 5px 0 var(--ink);
  padding: 7px 18px 5px;
  font-size: clamp(14px, 2.2vw, 20px);
  transform: rotate(-2deg);
  position: relative;
}
.ribbon::before, .ribbon::after {
  content: "";
  position: absolute;
  top: 6px; bottom: 6px;
  width: 10px;
}
.ribbon::before { left: 6px; background: #2f5bd8; }
.ribbon::after { right: 6px; background: #e8323e; }
.ribbon span { padding: 0 10px; }

.mascots { display: block; cursor: pointer; }

.footer {
  position: absolute !important;
  bottom: 10px; left: 0; right: 0;
  text-align: center;
  font-size: 13px;
  color: #6b3a00;
  padding: 0 16px;
}

/* ---------------------------------------------------------------- select */

.select { justify-content: flex-start; padding: 14px 16px 18px; gap: 12px; overflow-x: hidden; overflow-y: auto; }
.screen::after { position: fixed; }
.sel-top { width: min(1120px, 100%); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sel-spacer { width: 118px; }
.heading {
  margin: 0;
  font-family: var(--title);
  font-weight: normal;
  font-size: clamp(30px, 5vw, 54px);
  color: #fff;
  text-shadow: var(--outline), 0 7px 0 var(--ink);
  transform: rotate(-2deg);
}
.heading .l { display: inline-block; animation: bob 2s ease-in-out infinite; animation-delay: calc(var(--i) * -0.1s); }
.heading .sp { display: inline-block; width: 0.3em; }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: -8px; z-index: 2; }
.tab {
  font-family: var(--title);
  font-size: 22px;
  color: #fff;
  background: var(--pc);
  border: 4px solid var(--ink);
  border-bottom: none;
  border-radius: 16px 16px 0 0;
  padding: 12px 22px 10px;
  text-shadow: var(--outline);
  cursor: pointer;
  transform: translateY(6px);
  transition: transform 0.1s;
  box-shadow: inset 0 -8px 0 rgba(0, 0, 0, 0.15);
}
.tab:hover { transform: translateY(2px); }
.tab.on { transform: translateY(0) scale(1.08); box-shadow: none; padding-bottom: 14px; }

.sel-panel {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 18px;
  padding: 18px;
  border-color: var(--ink);
  background: linear-gradient(var(--pl), var(--cream) 40%);
}

.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.card {
  font-family: var(--ui);
  background: #fff;
  border: 4px solid var(--ink);
  border-radius: 18px;
  box-shadow: 0 6px 0 var(--ink);
  padding: 8px 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transform: rotate(var(--r));
  transition: transform 0.12s;
  position: relative;
  color: var(--ink);
}
.card:hover { transform: rotate(0deg) translateY(-4px) scale(1.03); }
.card.on { background: var(--pc); transform: rotate(0deg) scale(1.05); }
.card.on::after {
  content: "TOI !";
  position: absolute;
  top: -12px; right: -10px;
  font-family: var(--title);
  font-size: 16px;
  color: var(--ink);
  background: #ffd23a;
  border: 3px solid var(--ink);
  border-radius: 10px;
  padding: 5px 8px 2px;
  transform: rotate(10deg);
  box-shadow: 0 3px 0 var(--ink);
}
.card canvas { display: block; }
.cname { font-family: var(--title); font-size: 19px; line-height: 1.05; margin-top: 2px; text-align: center; }
.ctag { font-size: 14px; line-height: 1.15; color: #6b5b4b; text-align: center; margin-top: 3px; }
.card.on .cname { color: #fff; text-shadow: var(--outline); }
.card.on .ctag { color: #fff; text-shadow: 1px 1px 0 var(--ink), -1px 1px 0 var(--ink), 1px -1px 0 var(--ink), -1px -1px 0 var(--ink); }

.weapons { display: flex; flex-direction: column; gap: 10px; }
.sub { font-family: var(--title); font-size: 26px; color: #fff; text-shadow: var(--outline), 0 4px 0 var(--ink); }
.weapon {
  font-family: var(--ui);
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: #fff;
  border: 4px solid var(--ink);
  border-radius: 16px;
  box-shadow: 0 5px 0 var(--ink);
  padding: 6px 10px;
  cursor: pointer;
  color: var(--ink);
  transition: transform 0.1s;
}
.weapon:hover { transform: translateX(4px); }
.weapon.on { background: #ffd23a; transform: translateX(8px) rotate(-1deg); }
.wicon { flex: none; background: #efe6cf; border: 3px solid var(--ink); border-radius: 10px; }
.winfo { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.winfo b { font-family: var(--title); font-weight: normal; font-size: 19px; line-height: 1; }
.winfo i { font-style: normal; font-size: 13px; color: #6b5b4b; }
.bars { display: grid; grid-template-columns: 1fr 1fr; gap: 1px 12px; margin-top: 3px; }
.bar { display: flex; align-items: center; gap: 5px; font-size: 11px; }
.bar em { font-style: normal; width: 62px; color: #6b5b4b; }
.pips { display: flex; gap: 2px; }
.pips s { width: 7px; height: 9px; border: 1.5px solid var(--ink); border-radius: 2px; background: #fff; text-decoration: none; }
.pips s.on { background: #ff8f1f; }

.streak-panel { width: min(1120px, 100%); padding: 14px 18px 16px; }
.streak-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.streak-count {
  font-family: var(--title); font-size: 18px; color: #fff; background: #8b7b6b;
  border: 3px solid var(--ink); border-radius: 10px; padding: 4px 9px 1px; box-shadow: 0 3px 0 var(--ink);
}
.streak-count.full { background: #2eaa2f; }
.streak-count.nope { animation: nope 0.4s; background: #e2283b; }
@keyframes nope { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-6px) rotate(-4deg); } 60% { transform: translateX(6px) rotate(4deg); } }
.streak-hint { font-size: 14px; color: #6b5b4b; }
.streaks { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; }
.streak {
  font-family: var(--ui); display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  background: #fff; color: var(--ink); border: 4px solid var(--ink); border-radius: 14px;
  box-shadow: 0 5px 0 var(--ink); padding: 7px 8px; cursor: pointer; position: relative; transition: transform 0.1s;
}
.streak:hover { transform: translateY(-3px); }
.streak.on { background: #ffd23a; transform: translateY(-2px) rotate(-1deg); }
.streak.on::after {
  content: "✓"; position: absolute; top: -11px; right: -9px; width: 26px; height: 26px; display: grid; place-items: center;
  font-family: var(--title); font-size: 15px; color: #fff; background: #2eaa2f; border: 3px solid var(--ink); border-radius: 50%;
}
.streak.locked { opacity: 0.55; cursor: not-allowed; }
.slock { position: absolute; inset: auto 6px 6px auto; font-family: var(--title); font-size: 11px; color: #e2283b; }
.sicon { flex: none; width: 48px; height: 48px; }
.sinfo { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.sinfo b { font-family: var(--title); font-weight: normal; font-size: 15px; line-height: 1.05; }
.sinfo em { font-style: normal; font-size: 12px; color: #e8862c; }
.sinfo i { font-style: normal; font-size: 12px; line-height: 1.15; color: #6b5b4b; margin-top: 2px; }

.sel-bottom { width: min(1120px, 100%); display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 6px; }
.vs {
  font-size: 18px;
  background: #fff;
  border: 4px solid var(--ink);
  border-radius: 14px;
  box-shadow: 0 5px 0 var(--ink);
  padding: 8px 14px 6px;
  transform: rotate(-1deg);
}
.sel-bottom .btn.big { font-size: 38px; padding: 16px 44px 10px; }

/* ---------------------------------------------------------------- end screen */

.end { background: rgba(27, 22, 34, 0.55); }
.end::after { display: none; }
.end-panel {
  padding: 22px 28px 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 94vw;
  animation: popin 0.35s cubic-bezier(0.2, 1.6, 0.4, 1);
}
@keyframes popin { from { transform: scale(0.5) rotate(-6deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }
.end-title {
  font-family: var(--title);
  font-size: clamp(48px, 9vw, 86px);
  line-height: 1;
  color: #ffd23a;
  text-shadow: 5px 0 0 var(--ink), -5px 0 0 var(--ink), 0 5px 0 var(--ink), 0 -5px 0 var(--ink),
    4px 4px 0 var(--ink), -4px 4px 0 var(--ink), 4px -4px 0 var(--ink), -4px -4px 0 var(--ink), 0 11px 0 var(--ink);
  transform: rotate(-3deg);
}
.lose .end-title { color: #ff5a5a; }
.tie .end-title { color: #fff; }
.end-score { font-family: var(--title); font-size: 26px; }
.end-score span { text-shadow: 2px 2px 0 var(--ink), -2px 2px 0 var(--ink), 2px -2px 0 var(--ink), -2px -2px 0 var(--ink); }
.board { border-collapse: collapse; font-size: 17px; min-width: min(420px, 80vw); }
.board th { font-size: 13px; color: #8b7b6b; text-align: left; padding: 2px 10px; }
.board td { padding: 3px 10px; border-top: 2px dashed rgba(27, 22, 34, 0.15); }
.board td + td, .board th + th { text-align: center; }
.board tr.me td { background: #ffd23a; }

/* ---------------------------------------------------------------- your own meme clips */

#ui > .meme-media {
  position: absolute;
  left: 16px;
  top: max(var(--meme-top, 118px), 27vh);
  width: 256px;
  padding: 10px 10px 8px;
  background: var(--cream);
  border: 4px solid var(--ink);
  border-radius: 18px;
  box-shadow: 0 6px 0 var(--ink);
  pointer-events: none;
  transform: rotate(-1.7deg);
  animation: mm-in 0.3s cubic-bezier(0.2, 1.5, 0.4, 1);
  z-index: 3;
}
#ui > .meme-media.out { animation: mm-out 0.3s forwards; }
@keyframes mm-in { from { transform: translateX(-300px) rotate(-1.7deg); } to { transform: translateX(0) rotate(-1.7deg); } }
@keyframes mm-out { to { transform: translateX(-300px) rotate(-1.7deg); } }
.mm-media {
  display: block; width: 100%; height: 150px; object-fit: contain;
  border: 3px solid var(--ink); border-radius: 12px; background: #111;
}
.mm-tag {
  position: absolute; top: -13px; left: 12px; transform: rotate(-4deg);
  font-family: var(--title); font-size: 13px; color: #fff; background: #e8323e;
  border: 3px solid var(--ink); border-radius: 8px; padding: 4px 8px 1px; box-shadow: 0 3px 0 var(--ink);
}
.mm-caption {
  font-family: var(--title); font-size: 21px; line-height: 1.05; text-align: center; color: #ffd23a;
  text-shadow: var(--outline), 0 3px 0 var(--ink); margin-top: 8px;
}
.end-meme {
  display: block; width: min(320px, 70vw); max-height: 190px; object-fit: cover;
  border: 4px solid var(--ink); border-radius: 14px; box-shadow: 0 5px 0 var(--ink); background: #111;
}

/* ---------------------------------------------------------------- splash (click to enter) */

.splash { cursor: pointer; background: #1b1622; }
.splash::after { background: radial-gradient(ellipse at center, rgba(255, 190, 46, 0.25) 0%, rgba(0, 0, 0, 0) 60%); }
.splash-box { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 16px; text-align: center; }
.splash-go {
  background: none; border: 0; cursor: pointer; padding: 6px 14px;
  font-family: var(--title); font-size: clamp(26px, 5vw, 44px); color: #fff;
  text-shadow: var(--outline), 0 5px 0 var(--ink);
  animation: pulse 1.1s ease-in-out infinite;
}
.splash-hint { color: #cfc6dc; font-size: 16px; }
.screen.title { animation: fadein 0.7s ease-out; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

/* ---------------------------------------------------------------- respawn card: your killer's meme */

#ui > .killcard {
  position: absolute;
  left: 50%; top: 50%;
  width: min(440px, calc(100vw - 32px));
  transform: translate(-50%, -42%) rotate(-1deg);
  background: var(--cream);
  border: 5px solid var(--ink);
  border-radius: 22px;
  box-shadow: 0 9px 0 var(--ink);
  padding: 12px 14px 14px;
  pointer-events: none;
  animation: kc-in 0.38s cubic-bezier(0.2, 1.5, 0.4, 1);
  z-index: 4;
}
#ui > .killcard.out { animation: kc-out 0.28s forwards; }
@keyframes kc-in { from { transform: translate(-50%, 30%) rotate(4deg) scale(0.6); opacity: 0; } }
@keyframes kc-out { to { transform: translate(-50%, -42%) scale(0.7); opacity: 0; } }
.kc-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.kc-face { width: 64px; height: 64px; flex: none; border: 4px solid var(--ink); border-radius: 50%; }
.kc-who { display: flex; flex-direction: column; min-width: 0; }
.kc-by { font-family: var(--title); font-size: 14px; color: #e8323e; }
.kc-who b { font-family: var(--title); font-weight: normal; font-size: 26px; line-height: 1.05; text-shadow: var(--outline); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kc-info { font-size: 14px; color: #6b5b4b; }
.kc-info em { font-style: normal; color: #e8323e; }
.kc-stage { position: relative; height: 200px; border: 4px solid var(--ink); border-radius: 14px; overflow: hidden; background: #111; }
.kc-canvas, .kc-media { display: block; width: 100%; height: 100%; object-fit: cover; }
.kc-media, .mvp-media { object-fit: contain; } /* show the whole clip, phone videos included */
.kc-caption {
  position: absolute; left: 0; right: 0; bottom: 8px; text-align: center;
  font-family: var(--title); font-size: 26px; color: #ffd23a; text-shadow: var(--outline), 0 3px 0 var(--ink);
}
.kc-foot { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.kc-timer { font-size: 17px; white-space: nowrap; }
.kc-bar { flex: 1; height: 12px; border: 3px solid var(--ink); border-radius: 8px; background: #fff; overflow: hidden; }
.kc-bar i { display: block; height: 100%; width: 0; background: #2eaa2f; }
@media (max-height: 560px) { .kc-stage { height: 130px; } }

/* ---------------------------------------------------------------- end screen: MVP */

.end-wrap { display: flex; gap: 22px; align-items: center; justify-content: center; flex-wrap: wrap; padding: 22px 16px 16px; max-height: 100%; overflow-y: auto; }
.end-wrap .end-panel { max-width: min(560px, 94vw); }
.end-panel .btn { font-size: 22px; padding: 12px 22px 8px; }
@media (max-height: 760px) {
  .end-title { font-size: clamp(40px, 7vw, 64px); }
  .end-panel { gap: 8px; padding: 16px 22px 20px; }
  .board td { padding: 2px 10px; }
  .mvp-stage { height: 150px; }
}
.mvp-panel {
  width: min(300px, 92vw); padding: 16px 16px 14px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  transform: rotate(-2deg); animation: popin 0.45s 0.15s cubic-bezier(0.2, 1.6, 0.4, 1) backwards; position: relative;
}
.mvp-tag {
  position: absolute; top: -18px; left: 50%; transform: translateX(-50%) rotate(-4deg);
  font-family: var(--title); font-size: 24px; color: #fff; background: #e8323e;
  border: 4px solid var(--ink); border-radius: 12px; padding: 6px 14px 2px; box-shadow: 0 4px 0 var(--ink);
}
.mvp-name { font-family: var(--title); font-size: 26px; text-shadow: var(--outline); margin-top: 12px; text-align: center; line-height: 1.05; }
.mvp-sub { font-size: 15px; color: #6b5b4b; }
.mvp-stage { width: 100%; height: 180px; margin-top: 6px; border: 4px solid var(--ink); border-radius: 14px; overflow: hidden; background: #111; }
.mvp-canvas, .mvp-media { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ---------------------------------------------------------------- select: kill meme picker */

.meme-panel { width: min(1120px, 100%); padding: 14px 18px 16px; }
.premium-pill {
  font: inherit; font-family: var(--title); font-size: 13px; cursor: pointer; color: #fff; background: linear-gradient(#ffd75e, #e8862c);
  border: 3px solid var(--ink); border-radius: 999px; padding: 5px 12px 2px; box-shadow: 0 3px 0 var(--ink); text-shadow: 1px 1px 0 var(--ink);
}
.premium-pill.off { background: linear-gradient(#b9b6c6, #7a7590); }
.memes.locked { opacity: 0.45; filter: grayscale(0.7); }
.kc-tag {
  position: absolute; top: 6px; left: 8px; font-family: var(--title); font-size: 11px; color: #fff; background: rgba(27,22,34,0.75);
  border-radius: 6px; padding: 3px 6px 1px;
}
.memes { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.meme-pick {
  font: inherit; color: inherit; cursor: pointer; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: #fff; border: 4px solid var(--ink); border-radius: 14px; box-shadow: 0 4px 0 var(--ink);
  padding: 6px 6px 8px; transition: transform 0.12s; position: relative;
}
.meme-pick:hover { transform: translateY(-3px); }
.meme-pick.on { background: #ffd23a; transform: translateY(-2px) rotate(-1deg); }
.meme-pick.on::after {
  content: "✔"; position: absolute; top: -10px; right: -8px; width: 26px; height: 26px; line-height: 22px;
  background: #2eaa2f; color: #fff; border: 3px solid var(--ink); border-radius: 50%; font-size: 14px;
}
.mp-stage { width: 150px; max-width: 100%; height: 84px; border: 3px solid var(--ink); border-radius: 10px; overflow: hidden; background: #2a2433; display: flex; align-items: center; justify-content: center; }
.mp-stage canvas { display: block; }
.mp-clip { font-family: var(--title); color: #ffd23a; font-size: 18px; text-shadow: var(--outline); }
.meme-pick b { font-family: var(--title); font-weight: normal; font-size: 15px; line-height: 1.05; }
.meme-pick i { font-style: normal; font-size: 12px; line-height: 1.15; color: #6b5b4b; }

/* ---------------------------------------------------------------- select: mode + map */

.arena-panel { width: min(1120px, 100%); padding: 14px 18px 16px; display: grid; grid-template-columns: 240px 1fr; gap: 18px; }
.arena-modes { display: flex; flex-direction: column; gap: 10px; }
.arena-maps { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.mode {
  font: inherit; color: inherit; cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 2px;
  background: #fff; border: 4px solid var(--ink); border-radius: 14px; box-shadow: 0 4px 0 var(--ink); padding: 8px 12px 7px;
  transition: transform 0.12s;
}
.mode:hover { transform: translateX(3px); }
.mode.on { background: #ffd23a; transform: translateX(6px) rotate(-1deg); }
.mode b { font-family: var(--title); font-weight: normal; font-size: 19px; line-height: 1; }
.mode i { font-style: normal; font-size: 13px; color: #6b5b4b; }
.maps { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.map-pick {
  font: inherit; color: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: #fff; border: 4px solid var(--ink); border-radius: 14px; box-shadow: 0 4px 0 var(--ink); padding: 6px 6px 7px;
  transition: transform 0.12s; position: relative;
}
.map-pick:hover { transform: translateY(-3px); }
.map-pick.on { background: #ffd23a; transform: translateY(-2px) rotate(-1deg); }
.map-pick.on::after {
  content: "✔"; position: absolute; top: -10px; right: -8px; width: 26px; height: 26px; line-height: 22px; text-align: center;
  background: #2eaa2f; color: #fff; border: 3px solid var(--ink); border-radius: 50%; font-size: 14px;
}
.map-pick canvas { display: block; border-radius: 8px; max-width: 100%; height: auto !important; }
.map-pick b { font-family: var(--title); font-weight: normal; font-size: 14px; line-height: 1.05; text-align: center; }
.map-rand {
  width: 132px; max-width: 100%; height: 88px; display: flex; align-items: center; justify-content: center; border-radius: 8px;
  border: 2px solid var(--ink); background: repeating-linear-gradient(45deg, #ffd34a 0 12px, #ffb52a 12px 24px);
  font-family: var(--title); font-size: 48px; color: #fff; text-shadow: var(--outline);
}
.map-desc { font-size: 14px; color: #6b5b4b; min-height: 1.2em; }
.board i.rank {
  font-style: normal; display: inline-block; width: 22px; height: 22px; line-height: 22px; text-align: center; margin-right: 6px;
  border-radius: 50%; background: var(--ink); color: #fff; font-size: 12px;
}
@media (max-width: 820px) { .arena-panel { grid-template-columns: 1fr; } .arena-modes { flex-direction: row; flex-wrap: wrap; align-items: center; } }

/* ---------------------------------------------------------------- controls screen */

.ctrl-panel { width: min(760px, 100%); padding: 16px 20px 18px; display: flex; flex-direction: column; gap: 12px; }
.ctrl-pad { font-size: 16px; background: #fff; border: 3px solid var(--ink); border-radius: 12px; padding: 8px 12px 6px; }
.ctrl-table { border-collapse: collapse; width: 100%; font-size: 16px; }
.ctrl-table th { font-size: 13px; color: #8b7b6b; text-align: left; padding: 2px 6px; }
.ctrl-table td { padding: 4px 6px; border-top: 2px dashed rgba(27, 22, 34, 0.12); }
.bind {
  font: inherit; font-family: var(--title); font-size: 15px; color: var(--ink); cursor: pointer; min-width: 120px;
  background: #fff; border: 3px solid var(--ink); border-radius: 10px; box-shadow: 0 3px 0 var(--ink); padding: 6px 10px 3px;
}
.bind:hover { background: #fff3c4; }
.bind.empty { color: #b3a898; }
.bind.listening { background: #ffd23a; animation: pulse 0.6s ease-in-out infinite; }
.fixed { font-family: var(--title); font-size: 13px; color: #8b7b6b; }
.ctrl-hint { font-size: 14px; color: #6b5b4b; }
@media (max-width: 560px) { .bind { min-width: 0; width: 100%; font-size: 13px; } .ctrl-table { font-size: 14px; } }

/* Gamepad focus in menus. */
.pad-focus { outline: 4px solid #fff !important; outline-offset: 3px; box-shadow: 0 0 0 9px rgba(27, 22, 34, 0.85), 0 6px 0 var(--ink) !important; z-index: 5; }

/* ---------------------------------------------------------------- clip section editor */

.mp-stage { position: relative; }
.memes-empty { grid-column: 1 / -1; font-size: 15px; color: #6b5b4b; background: #fff; border: 3px dashed #c9b993; border-radius: 12px; padding: 14px; }
.mp-poster { display: block; width: 100%; height: 100%; object-fit: cover; }
.mp-tag {
  position: absolute; left: 4px; bottom: 4px; font-family: var(--title); font-size: 11px; color: #fff;
  background: #e8323e; border: 2px solid var(--ink); border-radius: 6px; padding: 2px 5px 0;
}
.clip-editor { display: grid; grid-template-columns: minmax(0, 360px) 1fr; gap: 16px; margin-top: 14px; align-items: start; }
.clip-editor[hidden] { display: none; }
.ce-screen { position: relative; border: 4px solid var(--ink); border-radius: 14px; overflow: hidden; background: #111; aspect-ratio: 16 / 9; }
.ce-video { display: block; width: 100%; height: 100%; object-fit: contain; background: #111; }
.ce-missing[hidden] { display: none; }
.ce-missing { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-family: var(--title); }
.ce-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ce-title { font-family: var(--title); font-size: 22px; line-height: 1; }
.ce-help { font-size: 14px; color: #6b5b4b; }
.ce-timeline { position: relative; height: 34px; margin-top: 8px; border: 3px solid var(--ink); border-radius: 8px; background: #2a2433; cursor: ew-resize; touch-action: none; }
.ce-window { position: absolute; top: 0; bottom: 0; background: #ffd23a; border-left: 3px solid var(--ink); border-right: 3px solid var(--ink); }
.ce-head { position: absolute; top: -9px; bottom: -3px; width: 4px; margin-left: -2px; background: #e8323e; pointer-events: none; box-shadow: 0 0 0 1.5px var(--ink); }
.ce-head::before {
  content: ""; position: absolute; top: -4px; left: 50%; width: 16px; height: 16px; margin-left: -8px;
  border-radius: 50%; background: #e8323e; border: 3px solid var(--ink); box-sizing: border-box;
}
.ce-timeline:active .ce-head::before { transform: scale(1.25); }
.ce-times { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: #6b5b4b; }
.ce-now { color: #e8323e; font-family: var(--title); }
.ce-cutinfo { color: #b07a00; }
.ce-row { display: grid; grid-template-columns: 54px 1fr 52px; align-items: center; gap: 8px; font-size: 15px; }
.ce-row input { width: 100%; accent-color: #e8862c; }
.ce-row b { font-family: var(--title); font-weight: normal; text-align: right; }
.ce-buttons { justify-content: flex-start; }
@media (max-width: 700px) { .clip-editor { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- small screens */

@media (max-width: 820px) {
  .sel-panel { grid-template-columns: 1fr; }
  .sel-spacer { display: none; }
  .tab { font-size: 18px; padding: 10px 14px 8px; }
  .btn.big { font-size: 34px; padding: 14px 36px 10px; }
  .sel-bottom { justify-content: center; }
}
@media (max-width: 560px) {
  .s1 { right: -4px; top: -40px; font-size: 14px; }
  .sel-panel { padding: 10px; gap: 12px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card { min-width: 0; }
  .card canvas { width: 100% !important; height: auto !important; max-width: 160px; }
  .sel-top { flex-wrap: wrap; justify-content: center; }
  .heading { font-size: 28px; order: -1; width: 100%; text-align: center; }
  .weapon { gap: 8px; }
  .wicon { width: 72px !important; height: 33px !important; }
}
@media (max-width: 420px) {
  .cards { gap: 10px; }
  .cname { font-size: 16px; }
  .ctag { font-size: 12px; }
  .bars { grid-template-columns: 1fr; }
}
