/* Carrot in a Box: two cardboard boxes on a table, the bracket, and the reveal. */
.title-carrot .carrot { width: 90px; height: 180px; animation: wobble 2s ease-in-out infinite; }
@keyframes wobble { 50% { transform: rotate(10deg) translateY(-6px); } }

/* ---------- The bracket ---------- */
.bracket { max-width: 1300px; margin: 0 auto; padding: 26px; display: flex; gap: 18px; overflow-x: auto; }
.bracket-round { flex: 1; min-width: 170px; display: flex; flex-direction: column; justify-content: space-around; gap: 14px; }
.bracket-round h3 { margin: 0 0 4px; text-align: center; font: 600 .82rem var(--label); letter-spacing: .26em; text-transform: uppercase; color: var(--gold-2); }
.slot { display: grid; gap: 4px; padding: 8px; border-radius: 16px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); }
.seat { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 10px; background: rgba(255, 255, 255, .06); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 4px solid var(--c, transparent); }
.seat .avatar { font-size: 1.15rem; }
.seat.won { background: linear-gradient(90deg, rgba(246, 195, 67, .3), rgba(255, 255, 255, .06)); }
.seat.won::after { content: "🥕"; margin-left: auto; }
.seat.lost { opacity: .4; text-decoration: line-through; }
.seat.bye, .seat.empty { justify-content: center; color: var(--dim); font-style: italic; font-weight: 500; border-left-color: transparent; }
.seat.champ { font-size: 1.6rem; font-style: normal; }

/* ---------- The match ---------- */
.carrot-match { max-width: 1200px; margin: 0 auto; display: grid; gap: min(18px, 2vh); }
.match-head { display: flex; align-items: center; gap: 16px; }
.round-tag { white-space: nowrap; padding: 6px 16px; border-radius: 999px; border: 1px solid var(--gold-line); background: rgba(246, 195, 67, .12); font: 600 1rem var(--label); letter-spacing: .12em; text-transform: uppercase; color: var(--gold-2); }
.matchscore { font: 700 1.6rem var(--label); letter-spacing: .1em; }
.match-status { margin: 0; font: italic 800 clamp(1.3rem, 2.4vw, 2rem) var(--display); }
.table { position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 20px; padding: 10px 20px 0; }
.table::before { content: ""; position: absolute; left: 4%; right: 4%; bottom: 96px; height: 34px; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 210, 130, .25), transparent 70%); }
.versus { align-self: center; font: italic 900 clamp(2rem, 4vw, 3.4rem) var(--display); background: var(--foil); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 3px 0 #6b440b); }
.side { display: grid; justify-items: center; gap: 12px; transition: opacity .5s, filter .5s; }
.side.loser { opacity: .45; filter: saturate(.4); }
.side.winner .plinth { box-shadow: 0 0 0 3px var(--gold), 0 0 40px rgba(246, 195, 67, .5); }
.box-spot { height: min(260px, 30vh); display: grid; align-items: end; perspective: 900px; }
.plinth { display: flex; align-items: center; gap: 10px; padding: 8px 18px 8px 8px; border-radius: 999px; background: var(--glass); border: 1px solid color-mix(in srgb, var(--c) 60%, transparent); }
.plinth .avatar { font-size: 1.8rem; }
.plinth span:last-child { display: grid; line-height: 1.1; }
.plinth b { font-size: 1.3rem; font-weight: 600; }
.plinth small { font: 600 .72rem var(--label); letter-spacing: .24em; text-transform: uppercase; color: var(--gold-2); }
.predictors { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; min-height: 32px; }
.fan { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #10173a; box-shadow: 0 0 0 2px var(--c); font-size: 1.05rem; animation: card-in .35s cubic-bezier(.3, 1.8, .5, 1); }

/* ---------- The boxes ---------- */
.box { position: relative; width: min(220px, 20vw); height: min(170px, 19vh); transform-style: preserve-3d; animation: box-in .6s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes box-in { from { transform: translateY(-60px) scale(.8); opacity: 0; } }
.box-body { position: absolute; inset: 0; border-radius: 8px; overflow: hidden;
  background: linear-gradient(90deg, transparent 44%, rgba(255, 255, 255, .28) 44% 56%, transparent 56%), linear-gradient(180deg, #d6a565, #b07b3f 70%, #9a6731);
  box-shadow: inset 0 -12px 20px rgba(60, 30, 5, .35), inset 0 2px 0 rgba(255, 240, 200, .5), 0 22px 40px rgba(0, 0, 0, .5); display: grid; place-items: center; }
.box-label { padding: 4px 14px; border-radius: 6px; background: rgba(255, 250, 235, .92); color: #3a2504; font: 700 clamp(1rem, 1.6vw, 1.4rem) "Fredoka", sans-serif; transform: rotate(-3deg); box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }
.box-lid { position: absolute; left: -8px; right: -8px; top: -20px; height: 26px; border-radius: 6px; transform-origin: 50% 0;
  background: linear-gradient(90deg, transparent 44%, rgba(255, 255, 255, .3) 44% 56%, transparent 56%), linear-gradient(180deg, #e2b373, #b9864a);
  box-shadow: 0 6px 12px rgba(40, 20, 0, .4); transition: transform .7s cubic-bezier(.3, 1.4, .5, 1); }
.box-inside { position: absolute; z-index: 2; left: 50%; bottom: 30%; width: 40%; transform: translateX(-50%) translateY(40%); opacity: 0; transition: transform .8s cubic-bezier(.2, 1.6, .4, 1) .25s, opacity .3s .25s; }
.box-inside .carrot { width: 100%; height: auto; display: block; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .4)); }
.box.peek .box-lid { transform: translateY(-6px) rotateX(55deg); }
.box.open .box-lid { transform: translate(-58%, 40px) rotate(-62deg); }
.box.open.has-carrot .box-inside { opacity: 1; transform: translateX(-50%) translateY(-75%) rotate(-8deg); }
.box.open:not(.has-carrot) .box-body::after { content: "Empty!"; position: absolute; top: 10px; font: 700 1rem var(--label); letter-spacing: .14em; color: rgba(60, 30, 5, .7); }
.box.swap { animation: swap-low 1.2s cubic-bezier(.5, 0, .3, 1) forwards; }
.box.swap.high { animation-name: swap-high; z-index: 3; }
@keyframes swap-high { 50% { transform: translateX(calc(var(--dx) / 2)) translateY(-90px) rotate(8deg); } 100% { transform: translateX(var(--dx)); } }
@keyframes swap-low { 50% { transform: translateX(calc(var(--dx) / 2)) translateY(30px) rotate(-6deg); } 100% { transform: translateX(var(--dx)); } }
