#nextTeam {
    background-color: #4CAF50;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Fredoka', sans-serif;
    font-size: 24px;
    font-weight: 700;
    transition: background-color 0.3s;
    position: relative;
    z-index: 20;
}

#pauseTimer {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 20;
    width: 56px;
    height: 56px;
    padding: 0;
    background-color: rgba(255,255,255,0.3);
    color: white;
    border: 2px solid rgba(255,255,255,0.6);
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    text-shadow: none;
    transition: background-color 0.3s;
}
#pauseTimer:hover {
    background-color: rgba(255,255,255,0.5);
}
#nextTeam:hover {
    background-color: #45a049; /* Darker green background on hover */
}

.timer {
    /* width: 300px; */
    /* height: 200px; */
    /* border-radius: 100px; */
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 300px;
    /* border: 2px solid black; */
    /* margin: 20px; */
    color: white;
    /* background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent black background */
}

#teamName{
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 100px;
    line-height: 1;
    color: white;
}

#weeklyPrompt{
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 40px;
    /* margin: 20px; */
    color: white;
}

body, html {
    height: 100%;
    margin: 0;
    display: flex;
    justify-content: center;
    justify-content: safe center; /* if a slide is still too tall, keep its top reachable */
    align-items: center;
    flex-direction: column; /* Stack vertically */
    font-family: "Fredoka", sans-serif;
    font-weight: 700;
    text-shadow: 2px 2px 4px #5c5c5c; /* Optional: Adds a shadow for better readability */
}

.container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column; /* Stack timer and team name vertically */
    text-align: center;
}

#timer, #teamName {
    /* margin: 10px 0; /* Add some space between timer and team name */
}

.start {
    background: linear-gradient(135deg, rgb(72, 149, 236), rgb(120, 85, 210));
}

.green {
    background-color: rgb(35, 215, 104);
}

.yellow {
    /* background-color: yellow; */ 
    background-color: rgb(255, 214, 88);
}

.red {
    /* background-color: red; */
    background-color: rgb(243, 78, 89);
}

.animal {
    background-color: rgb(200, 160, 220);
}

/* <uniquifier>: Use a uniquifier for the class name */
/* <weight>: Use a value from 300 to 700 */
/* <width>: Use a value from 75 to 125 */

.fredoka-bold {
  font-family: "Fredoka", sans-serif;
  font-optical-sizing: auto;
  font-weight: 700;
  font-style: normal;
  font-variation-settings:
    "wdth" 100;
}

/* Start screen */
#startScreen {
    text-align: center;
}
#startTitle {
    font-size: 120px;
    line-height: 1;
    color: white;
}
#startIcons {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 24px;
}
#startIcons picture {
    animation: icon-bounce 2s ease-in-out infinite;
}
#startIcons picture:nth-child(1) { animation-delay: 0s; }
#startIcons picture:nth-child(2) { animation-delay: 0.2s; }
#startIcons picture:nth-child(3) { animation-delay: 0.4s; }
#startIcons picture:nth-child(4) { animation-delay: 0.6s; }
#startIcons picture:nth-child(5) { animation-delay: 0.8s; }
#startIcons picture:nth-child(6) { animation-delay: 1.0s; }
#startIcons img {
    width: 80px;
    height: 80px;
}
@keyframes icon-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

/* Timer pulse animations (replaces emoji state indicators) */
.green .timer {
    animation: pulse-green 3s ease-in-out infinite;
}
.yellow .timer {
    animation: pulse-yellow 1.5s ease-in-out infinite;
}
.red .timer {
    animation: pulse-red 0.5s ease-in-out infinite;
}

@keyframes pulse-green {
    0%, 100% { text-shadow: 2px 2px 4px #5c5c5c, 0 0 40px rgba(255,255,255,0.15); }
    50%      { text-shadow: 2px 2px 4px #5c5c5c, 0 0 80px rgba(255,255,255,0.35); }
}
@keyframes pulse-yellow {
    0%, 100% { text-shadow: 2px 2px 4px #5c5c5c, 0 0 30px rgba(0,0,0,0.1); }
    50%      { text-shadow: 2px 2px 4px #5c5c5c, 0 0 60px rgba(0,0,0,0.25); }
}
@keyframes pulse-red {
    0%, 100% { text-shadow: 2px 2px 4px #5c5c5c, 0 0 20px rgba(255,255,255,0.3); transform: scale(1); }
    50%      { text-shadow: 2px 2px 4px #5c5c5c, 0 0 50px rgba(255,255,255,0.6); transform: scale(1.03); }
}

/* Team icons */
#teamIcon {
    width: 200px;
    height: 200px;
    margin: 10px auto;
}
#teamIcon:not(:has(.team-icon.active)) {
    display: none; /* no empty slot while the wheel is up */
}
.team-icon {
    display: none;
}
.team-icon.active {
    display: block;
}
.team-icon img {
    width: 200px;
    height: 200px;
}

/* Animal break: spin the wheel, then gifs of whatever it lands on */
#wheelBox {
    margin: 10px auto 0;
    text-align: center;
}
.wheel-wrap {
    position: relative;
    width: 320px;
    height: 320px;
    margin: 0 auto;
}
.wheel-rotor {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    transform: rotate(0deg);
    transition: transform 4.2s cubic-bezier(0.12, 0.65, 0.1, 1);
    will-change: transform;
    filter: drop-shadow(0 6px 16px rgba(0,0,0,0.25));
}
.wheel-rotor svg {
    display: block;
    width: 100%;
    height: 100%;
}
.wheel-rotor text {
    font-size: 34px;
    text-shadow: none;
}
.wheel-pointer {
    position: absolute;
    z-index: 2;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 16px solid transparent;
    border-right: 16px solid transparent;
    border-top: 32px solid white;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.35));
}
#icon-winner span {
    display: block;
    font-size: 150px;
    line-height: 200px;
    text-shadow: none;
}
#animalGif {
    margin: 12px auto 0;
    text-align: center;
}
#animalGif img {
    max-width: min(640px, 80vw);
    max-height: min(400px, 45vh);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.break-btn {
    margin-top: 16px;
    background-color: rgba(255,255,255,0.3);
    color: white;
    padding: 8px 20px;
    border: 2px solid rgba(255,255,255,0.6);
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Fredoka', sans-serif;
    font-size: 18px;
    font-weight: 700;
    transition: background-color 0.3s;
}
.break-btn:hover {
    background-color: rgba(255,255,255,0.5);
}
#spinWheel {
    font-size: 26px;
    padding: 10px 32px;
    margin-top: 20px;
}
#spinWheel:disabled {
    opacity: 0.5;
    cursor: default;
}
#animalGif .giphy-credit {
    margin-top: 6px;
    font-size: 13px;
    color: rgba(255,255,255,0.7);
}

/* bottom row: the break's buttons next to Next Team / Back to Work */
#bottomBar {
    position: relative;
    z-index: 20;
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 14px;
}
#bottomBar .break-btn {
    margin-top: 0;
    padding: 12px 20px;
    font-size: 20px;
}

/* compact layout on the animal break so title, icon, gif and buttons share one screen */
body.break #teamName {
    font-size: 64px;
}
body.break #teamName.long {
    font-size: 48px;
}
body.break #teamIcon {
    width: 120px;
    height: 120px;
    margin: 6px auto;
}
body.break .team-icon img {
    width: 120px;
    height: 120px;
}
body.break #icon-winner span {
    font-size: 92px;
    line-height: 120px;
}

/* #adventure mode: a full-screen night village and Main Stage, after Twizl */
#teamName.long {
    font-size: 48px;
    max-width: 1100px;
    text-align: center;
}
#adventureScreen {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: none;
    background: #07091a;
    color: #ece6da;
    font-family: "Spectral", Georgia, serif;
    font-weight: 400;
    text-shadow: none;
    line-height: 1.5;
}
#adventureScreen.on {
    display: block;
}
#adventureScreen button {
    font: inherit;
    color: inherit;
    cursor: pointer;
}
.adv-screen {
    position: absolute;
    inset: 0;
    display: none;
}
.adv-screen.on {
    display: block;
}
#advMap {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}
.adv-hud {
    position: absolute;
    top: 12px;
    left: 16px;
    right: 64px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    pointer-events: none;
}
.adv-town {
    font-family: "Fraunces", Georgia, serif;
    font-style: italic;
    color: #f3e9c6;
    font-size: 1.05rem;
    text-shadow: 0 2px 8px #000;
}
.adv-hint {
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: 0.72rem;
    color: #a9a397;
    letter-spacing: 0.06em;
    text-align: right;
    text-shadow: 0 1px 4px #000;
}
#advBubble {
    position: absolute;
    background: #f1e7cf;
    color: #1a1a1a;
    padding: 7px 11px;
    border-radius: 12px;
    font-size: 0.95rem;
    max-width: 30ch;
    opacity: 0;
    transition: opacity 0.25s;
    pointer-events: none;
    font-style: italic;
    transform: translate(-20%, -100%);
}
#advBubble b {
    display: block;
    font-style: normal;
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #6b5d3c;
    margin-bottom: 2px;
}
#advBubble.show {
    opacity: 1;
}
#advBubble::after {
    content: "";
    position: absolute;
    left: 18px;
    bottom: -8px;
    border: 8px solid transparent;
    border-top-color: #f1e7cf;
    border-bottom: 0;
}
#advClose {
    position: absolute;
    top: 10px;
    right: 12px;
    z-index: 5;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.35);
    background: rgba(0,0,0,0.45);
    color: #f3e9c6;
    font-size: 18px;
    line-height: 1;
}
#advClose:hover {
    background: #f3e9c6;
    color: #07091a;
}
.adv-wing {
    position: absolute;
    inset: 0;
    display: none;
    overflow: auto;
    background: radial-gradient(ellipse at 50% 100%, #2a0a3a, #05020a 70%);
    padding: 16px 16px 48px;
    box-sizing: border-box;
}
.adv-wing.on {
    display: block;
}
.adv-inner {
    max-width: 980px;
    margin: 0 auto;
}
.adv-back {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 999px;
    padding: 8px 16px;
    font-family: "Fraunces", Georgia, serif;
    font-style: italic;
    font-size: 0.95rem;
    margin-bottom: 22px;
}
.adv-back:hover {
    border-color: #f3e9c6;
}
.adv-eyebrow {
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: 0.74rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #a9a397;
    margin: 0;
}
.adv-wing h2 {
    font-family: "Fraunces", Georgia, serif;
    font-size: clamp(1.9rem, 4.5vw, 3.2rem);
    font-weight: 500;
    margin: 6px 0 10px;
    color: #ece6da;
}
#adventureScreen .stage-wrap {
    position: relative;
    margin: 18px 0;
}
#djStage {
    width: 100%;
    height: min(60vh, 520px);
    min-height: 300px;
    display: block;
    border-radius: 14px;
    background: #000;
    border: 1px solid rgba(255,255,255,0.07);
}
/* the animal's gif, over the stage once the set drops */
#djGif {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(78%, 680px);
    display: none;
    text-align: center;
}
#djGif.on {
    display: block;
    animation: dj-gif-in 0.5s cubic-bezier(0.2, 1.4, 0.4, 1);
}
@keyframes dj-gif-in {
    from { transform: translate(-50%, -50%) scale(0.3); opacity: 0; }
}
#djGif img {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    max-height: 340px;
    min-height: 120px;
    border-radius: 12px;
    border: 2px solid #ff2fa0;
    background: #000;
    color: #ece6da;
    box-shadow: 0 0 30px rgba(255,47,160,0.55), 0 20px 50px rgba(0,0,0,0.8);
}
.dj-gif-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    margin-top: 10px;
}
.dj-gif-credit {
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #a9a397;
}
#adventureScreen .deck {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px 22px;
    align-items: end;
    margin-top: 18px;
}
#adventureScreen .knob label {
    display: block;
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #a9a397;
    margin-bottom: 6px;
}
#adventureScreen .knob input[type=range] {
    width: 100%;
    accent-color: #ff2fa0;
}
#adventureScreen .tbtn {
    border: 1px solid #ff2fa0;
    background: transparent;
    border-radius: 10px;
    padding: 12px 14px;
    font-family: "Fraunces", Georgia, serif;
    font-size: 1rem;
    color: #ff2fa0;
    transition: 0.15s;
}
#adventureScreen .tbtn:hover {
    background: #ff2fa0;
    color: #fff;
}
#adventureScreen .tbtn.cyan {
    border-color: #35f0ff;
    color: #35f0ff;
}
#adventureScreen .tbtn.cyan:hover {
    background: #35f0ff;
    color: #000;
}
#adventureScreen .tbtn.on {
    background: #ff2fa0;
    color: #fff;
}
#adventureScreen .tracks {
    grid-column: 1 / -1;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
#adventureScreen .tracks .tlbl {
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    color: #a9a397;
    margin-right: 4px;
}
#adventureScreen .tracks button {
    border: 1px solid #ff2fa0;
    background: transparent;
    color: #ff2fa0;
    border-radius: 999px;
    padding: 8px 14px;
    font-family: "Fraunces", Georgia, serif;
    font-size: 0.95rem;
    transition: 0.15s;
}
#adventureScreen .tracks button:hover {
    background: rgba(255,47,160,0.2);
}
#adventureScreen .tracks button.on {
    background: #ff2fa0;
    color: #fff;
    box-shadow: 0 0 14px rgba(255,47,160,0.53);
}
#djPhase {
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: 0.8rem;
    color: #35f0ff;
    letter-spacing: 0.1em;
    margin: 14px 0 0;
    min-height: 1.4em;
}
#djShout {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-family: "Fraunces", Georgia, serif;
    font-size: clamp(2rem, 9vw, 6rem);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: #fff;
    opacity: 0;
    pointer-events: none;
    mix-blend-mode: difference;
    transition: opacity 0.1s;
}
#djShout.on {
    opacity: 1;
}

/* Farm animals - peeking from edges */
.farm-animal {
    position: fixed;
    z-index: 10;
    pointer-events: none;
    opacity: 0;
}
.farm-animal img {
    width: 100px;
    height: 100px;
}

/* Pig peeks from bottom-left */
.peek-left {
    bottom: -10px;
    left: 30px;
    animation: peek-up 20s ease-in-out infinite 5s;
}

/* Chicken peeks from bottom-right */
.peek-right {
    bottom: -10px;
    right: 30px;
    left: auto;
    animation: peek-up 18s ease-in-out infinite 12s;
}

/* Cow peeks from top, upside down */
.peek-top {
    top: -80px;
    right: 40px;
    left: auto;
    animation: peek-down 25s ease-in-out infinite 0s;
}
.peek-top img {
    transform: rotate(180deg);
}

@keyframes peek-up {
    0%, 10% { opacity: 0; transform: translateY(80px); }
    15%, 30% { opacity: 1; transform: translateY(0); }
    35%, 100% { opacity: 0; transform: translateY(80px); }
}
@keyframes peek-down {
    0%, 10% { opacity: 0; transform: translateY(0); }
    15%, 30% { opacity: 1; transform: translateY(70px); }
    35%, 100% { opacity: 0; transform: translateY(0); }
}

/* Floating hearts */
.heart {
    position: absolute;
    color: #e74c6f;
    font-size: 18px;
    opacity: 0;
    pointer-events: none;
    text-shadow: none;
}
.peek-left .heart, .peek-right .heart {
    animation: heart-float-up 2s ease-out infinite;
}
.peek-top .heart {
    animation: heart-float-down 2s ease-out infinite;
}
.heart.h1 { right: -10px; top: 10px; animation-delay: 0s; }
.heart.h2 { right: -20px; top: 30px; animation-delay: 0.6s; }
.heart.h3 { right: 5px; top: -5px; animation-delay: 1.2s; }
.peek-top .heart.h1 { right: -10px; top: auto; bottom: 10px; }
.peek-top .heart.h2 { right: -20px; top: auto; bottom: 30px; }
.peek-top .heart.h3 { right: 5px; top: auto; bottom: -5px; }

@keyframes heart-float-up {
    0% { opacity: 0.9; transform: translateY(0) scale(0.8); }
    100% { opacity: 0; transform: translateY(-35px) scale(1.1); }
}
@keyframes heart-float-down {
    0% { opacity: 0.9; transform: translateY(0) scale(0.8); }
    100% { opacity: 0; transform: translateY(35px) scale(1.1); }
}

/* Paused timer blinks (after the pulse rules so it wins) */
.paused .timer {
    animation: paused-blink 1.2s step-end infinite;
}
@keyframes paused-blink {
    50% { opacity: 0.3; }
}
