@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;700&display=swap');

/*
  This font file contains only country flag emojis.
  The 'unicode-range' tells the browser to only download this font
  if it encounters a character in that specific unicode block
  (which corresponds to the regional indicator symbols used for flags).
  This is what "on the fly" means - it won't be downloaded unless needed.
*/
@font-face {
  font-family: 'Twemoji Country Flags';
  src: url('https://unpkg.com/country-flag-emoji-polyfill@0.1.8/dist/TwemojiCountryFlags.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  unicode-range: U+1F1E6-1F1FF;
}

body {
    /*
      We add 'Twemoji Country Flags' to the font stack. When the browser
      sees a flag emoji, 'Poppins' won't have a character for it, so it will
      fall back to our Twemoji font, which does.
    */
    font-family: 'Poppins', 'Twemoji Country Flags', sans-serif;
    text-align: center;
    background-color: #1a1a1a;
    color: #fff;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.container {
    margin-bottom: 40px;
}

#button-wrapper {
    position: relative;
    width: 250px;
    height: 250px;
    margin: 0 auto;
}

#flame-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.flame-particle {
    position: absolute;
    transform-origin: bottom;
    width: 0;
    height: 0;
    border: 0 solid transparent;
}

#bigRedButton {
    background: linear-gradient(145deg, #ff2d2d, #d92626);
    color: white;
    border: none;
    border-radius: 50%;
    width: 100%;
    height: 100%;
    font-size: 48px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    text-transform: uppercase;
    position: relative;
    z-index: 1;
}

#bigRedButton:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.3);
}

#bigRedButton:active {
    transform: scale(0.98) translateY(0);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
    animation: press-shake 0.1s linear;
}

@keyframes press-shake {
    0%, 100% { transform: scale(0.98) translateX(0); }
    25% { transform: scale(0.98) translateX(-3px); }
    75% { transform: scale(0.98) translateX(3px); }
}

#clickCount {
    font-weight: bold;
    font-size: 24px;
    margin-top: 20px;
    display: block;
}

.leaderboard-container {
    margin-top: 20px;
    width: 100%;
    max-width: 400px;
}

#leaderboardToggle {
    background-color: #333;
    color: #fff;
    border: 1px solid #555;
    padding: 12px 25px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s;
    width: 100%;
}

#leaderboardToggle:hover {
    background-color: #444;
}

#leaderboard {
    margin-top: 10px;
    border: 1px solid #333;
    padding: 20px;
    background-color: #222;
    border-radius: 5px;
}

#leaderboard.hidden {
    display: none;
}

#leaderboard h2 {
    margin-top: 0;
}

#leaderboardList {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

#leaderboardList li {
    padding: 8px 0;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
}

#leaderboardList li:last-child {
    border-bottom: none;
}

.refetch-container {
    position: relative;
    width: -moz-fit-content;
    width: fit-content;
    margin: 0 auto 15px;
}

#refetchButton {
    background-color: #333;
    color: #fff;
    border: 1px solid #555;
    padding: 8px 15px;
    font-size: 14px;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s;
}

#refetchCountdown {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 10px;
    font-size: 14px;
    color: #999;
    min-width: 40px; /* Prevent layout shift */
}

#refetchButton:hover {
    background-color: #444;
}

#refetchButton:disabled {
    background-color: #222;
    color: #666;
    cursor: not-allowed;
}

/* Replaced .emoji (from twemoji.js) with .flag and using font-size */
#leaderboardList .flag {
    /* This makes the flag emoji slightly larger than the text */
    font-size: 1.5em;
    margin-right: 8px;
    vertical-align: middle;
}

.top-right-nav {
    position: absolute;
    top: 10px;
    right: 10px;
}

.nav-button {
    background-color: #333;
    color: #fff;
    border: 1px solid #555;
    padding: 10px 15px;
    font-size: 14px;
    cursor: pointer;
    border-radius: 5px;
    text-decoration: none;
    transition: background-color 0.3s;
}

.nav-button:hover {
    background-color: #444;
}

.changelog {
    margin-bottom: 20px;
    border-bottom: 1px solid #333;
    padding-bottom: 20px;
}

.changelog:last-child {
    border-bottom: none;
}

.date {
    font-size: 0.9em;
    color: #999;
}

.back-button {
    display: inline-block;
    margin-top: 20px;
    background-color: #333;
    color: #fff;
    border: 1px solid #555;
    padding: 12px 25px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 5px;
    text-decoration: none;
    transition: background-color 0.3s;
}

.back-button:hover {
    background-color: #444;
}


