* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #ffffff;
    line-height: 1.6;
    min-height: 100vh;
}

.game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    padding-top: 80px; /* Add space for fixed header */
}

.bee-container {
    position: relative;
    min-height: 100vh;
    background-color: #ffffff;
    padding: 20px;
    margin-bottom: 20px;
}

.game-controls {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 25px;
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    z-index: 1000;
}

.input-group {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    padding: 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

input[type="number"] {
    border: none;
    border-radius: 20px 0 0 20px;
    width: 150px;
    height: 40px;
    padding: 0 15px;
    font-size: 16px;
    background: transparent;
}

input[type="number"]:focus {
    outline: none;
}

/* Common button styles */
button {
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 215, 0, 0.7);
    color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

button:hover {
    background: rgba(255, 215, 0, 0.9);
    transform: scale(1.05);
}

/* Submit button specific styles */
.submit-button {
    border-radius: 0 20px 20px 0;
    width: 45px;
    height: 40px;
    font-size: 20px;
    border-left: 1px solid rgba(0, 0, 0, 0.1);
}

.submit-button::after {
    content: "⏎";
    line-height: 1;
}

/* Reset button specific styles */
.reset-button {
    border-radius: 50%;
    width: 32px;
    height: 32px;
    background: rgba(255, 215, 0, 0.7);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: relative;
    padding: 0;
    cursor: pointer;
    border: none;
    transition: transform 0.2s;
}

.reset-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M48.5 224H40c-13.3 0-24-10.7-24-24V72c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2L98.6 96.6c87.6-86.5 228.7-86.2 315.8 1c87.5 87.5 87.5 229.3 0 316.8s-229.3 87.5-316.8 0c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0c62.5 62.5 163.8 62.5 226.3 0s62.5-163.8 0-226.3c-62.2-62.2-162.7-62.5-225.3-1L185 183c6.9 6.9 8.9 17.2 5.2 26.2s-12.5 14.8-22.2 14.8H48.5z"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
}

.reset-button:hover {
    transform: scale(1.1);
}

/* Remove hover background change */
.reset-button:hover::before {
    opacity: 0.7;
}

/* Hide button text */
button span {
    display: none;
}

.bee {
    position: absolute;
    font-size: 30px;
    user-select: none;
    transition: transform 0.3s;
}

/* Animation for new bees */
.bee-appear {
    animation: beeEntrance 0.5s ease-out;
    opacity: 0;
    animation-fill-mode: forwards;
}

@keyframes beeEntrance {
    0% {
        opacity: 0;
        transform: scale(0) rotate(0deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(360deg);
    }
}

.feedback {
    text-align: center;
    margin: 20px 0;
    padding: 15px;
    border-radius: 5px;
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    min-width: 300px;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.feedback.success {
    background-color: #a8e6cf;
    color: #1b4332;
    display: block;
}

.feedback.error {
    background-color: #ffb7b2;
    color: #7f1d1d;
    display: block;
}

@media (max-width: 600px) {
    .game-controls {
        flex-direction: row;
        width: auto;
    }
    
    .input-group {
        width: auto;
    }
    
    input[type="number"] {
        width: 120px;
    }
}

.score-container {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    color: #333;
}

#highScore {
    font-weight: bold;
    margin-left: 5px;
}

#visibleCounter {
    display: none;
}

header {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1200px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(3px);
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.help-button-container {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 4px;
}

.help-button, .leaderboard-button {
    border-radius: 50%;
    width: 32px;
    height: 32px;
    background: rgba(255, 215, 0, 0.7);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: relative;
    padding: 0;
    cursor: pointer;
    border: none;
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.help-button::before {
    content: "?";
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
}

.leaderboard-button::before {
    content: "🏆";
    font-size: 16px;
    line-height: 1;
}

.header-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

h1 {
    font-size: 1.2rem;
    margin: 0;
    margin-bottom: 5px;
}

.score-container {
    font-size: 0.8rem;
    color: #333;
}

#highScore {
    font-weight: bold;
    margin-left: 5px;
}

.header-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.share-button {
    border-radius: 50%;
    width: 32px;
    height: 32px;
    background: rgba(255, 215, 0, 0.7);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: relative;
    padding: 0;
    cursor: pointer;
    border: none;
    transition: transform 0.2s;
}

.share-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 18px;
    height: 18px;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M352 224c53 0 96-43 96-96s-43-96-96-96s-96 43-96 96c0 4 .2 8 .7 11.9l-94.1 47C145.4 170.2 121.9 160 96 160c-53 0-96 43-96 96s43 96 96 96c25.9 0 49.4-10.2 66.6-26.9l94.1 47c-.5 3.9-.7 7.8-.7 11.9c0 53 43 96 96 96s96-43 96-96s-43-96-96-96c-25.9 0-49.4 10.2-66.6 26.9l-94.1-47c.5-3.9 .7-7.8 .7-11.9s-.2-8-.7-11.9l94.1-47C302.6 213.8 326.1 224 352 224z"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
}

.share-button:hover {
    transform: scale(1.1);
    background: rgba(255, 215, 0, 0.8);
}

/* Help button styles */
.help-button {
    grid-column: 1;
    justify-self: start;
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    position: relative;
}

.help-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM169.8 165.3c7.9-22.3 29.1-37.3 52.8-37.3h58.3c34.9 0 63.1 28.3 63.1 63.1c0 22.6-12.1 43.5-31.7 54.8L280 264.4c-.2 13-10.9 23.6-24 23.6c-13.3 0-24-10.7-24-24V250.5c0-8.6 4.6-16.5 12.1-20.8l44.3-25.4c4.7-2.7 7.6-7.7 7.6-13.1c0-8.4-6.8-15.1-15.1-15.1H222.6c-3.4 0-6.4 2.1-7.5 5.3l-.4 1.2c-4.4 12.5-18.2 19-30.6 14.6s-19-18.2-14.6-30.6l.4-1.2zM288 352c0 17.7-14.3 32-32 32s-32-14.3-32-32s14.3-32 32-32s32 14.3 32 32z"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
}

.help-button:hover::before {
    opacity: 0.7;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    backdrop-filter: blur(3px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 25px;
    border-radius: 15px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.modal-content h2 {
    margin-bottom: 15px;
    font-size: 1.3rem;
    color: #333;
}

.modal-content ul {
    list-style-type: none;
    padding: 0;
    margin-bottom: 20px;
}

.modal-content li {
    padding: 8px 0;
    color: #555;
    position: relative;
    padding-left: 20px;
}

.modal-content li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #FDB813;
}

.close-button {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 8px;
    background: #FDB813;
    color: #333;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.close-button:hover {
    background: #ffca45;
}

/* Certificate Modal Styles */
.certificate-modal .modal-content {
    max-width: 500px;
}

.certificate-options {
    margin: 20px 0;
}

.certificate-options label {
    display: block;
    margin-bottom: 15px;
    color: #555;
}

.certificate-options input {
    display: block;
    width: 100%;
    padding: 8px 12px;
    margin-top: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.certificate-button {
    width: 100%;
    padding: 12px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: background 0.2s;
}

.certificate-button:hover {
    background: #45a049;
}

/* Certificate Template Styles */
.certificate-template {
    display: none;
}

/* Leaderboard Modal Styles */
.leaderboard-modal .modal-content {
    max-width: 600px;
}

.leaderboard-container {
    margin: 20px 0;
    max-height: 400px;
    overflow-y: auto;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.leaderboard-table th {
    background: #FFD700;
    color: #333;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9em;
}

.leaderboard-table tr:nth-child(even) {
    background: #f9f9f9;
}

.leaderboard-table tr:hover {
    background: #f5f5f5;
}

/* Add trophy icons for top 3 */
.leaderboard-table tr:nth-child(1) td:first-child::after {
    content: " 🥇";
}

.leaderboard-table tr:nth-child(2) td:first-child::after {
    content: " 🥈";
}

.leaderboard-table tr:nth-child(3) td:first-child::after {
    content: " 🥉";
}

/* Add leaderboard button */
.leaderboard-button {
    border-radius: 50%;
    width: 32px;
    height: 32px;
    background: rgba(255, 215, 0, 0.7);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: relative;
    padding: 0;
    cursor: pointer;
    border: none;
    transition: transform 0.2s;
}

.leaderboard-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 18px;
    height: 18px;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path d="M173.8 5.5c11-7.3 25.4-7.3 36.4 0L228 17.2c6 3.9 13 5.8 20.1 5.4l21.3-1.3c13.2-.8 25.6 6.4 31.5 18.2l9.6 19.1c3.2 6.4 8.4 11.5 14.7 14.7L344.5 83c11.8 5.9 19 18.3 18.2 31.5l-1.3 21.3c-.4 7.1 1.5 14.2 5.4 20.1l11.8 17.8c7.3 11 7.3 25.4 0 36.4L366.8 228c-3.9 6-5.8 13-5.4 20.1l1.3 21.3c.8 13.2-6.4 25.6-18.2 31.5l-19.1 9.6c-6.4 3.2-11.5 8.4-14.7 14.7L301 344.5c-5.9 11.8-18.3 19-31.5 18.2l-21.3-1.3c-7.1-.4-14.2 1.5-20.1 5.4l-17.8 11.8c-11 7.3-25.4 7.3-36.4 0L156 366.8c-6-3.9-13-5.8-20.1-5.4l-21.3 1.3c-13.2 .8-25.6-6.4-31.5-18.2l-9.6-19.1c-3.2-6.4-8.4-11.5-14.7-14.7L39.5 301c-11.8-5.9-19-18.3-18.2-31.5l1.3-21.3c.4-7.1-1.5-14.2-5.4-20.1L5.5 210.2c-7.3-11-7.3-25.4 0-36.4L17.2 156c3.9-6 5.8-13 5.4-20.1l-1.3-21.3c-.8-13.2 6.4-25.6 18.2-31.5l19.1-9.6C65 70.2 70.2 65 73.4 58.6L83 39.5c5.9-11.8 18.3-19 31.5-18.2l21.3 1.3c7.1 .4 14.2-1.5 20.1-5.4L173.8 5.5zM272 192a80 80 0 1 0 -160 0 80 80 0 1 0 160 0zM1.3 441.8L44.4 339.3c.2 .1 .3 .2 .4 .4l9.6 19.1c11.7 23.2 36 37.3 62 35.8l21.3-1.3c.2 0 .5 0 .7 .2l17.8 11.8c5.1 3.3 10.5 5.9 16.1 7.7l-37.6 89.3c-2.3 5.5-7.4 9.2-13.3 9.7s-11.6-2.2-14.8-7.2L74.4 455.5l-56.1 8.3c-5.7 .8-11.4-1.3-15-5.4s-4.3-9.7-2.1-14.5zm248 60.4L211.7 413c5.6-1.8 11-4.3 16.1-7.7l17.8-11.8c.2-.1 .4-.2 .7-.2l21.3 1.3c26 1.5 50.3-12.6 62-35.8l9.6-19.1c.1-.2 .2-.3 .4-.4l43.2 102.5c2.2 4.8 1.5 10.4-2.1 14.5s-9.3 6.2-15 5.4l-56.1-8.3-32.2 49.2c-3.2 5-8.9 7.7-14.8 7.2s-11-4.3-13.3-9.7z"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
}

.leaderboard-button:hover {
    transform: scale(1.1);
    background: rgba(255, 215, 0, 0.8);
}

/* Leaderboard styles */
.leaderboard-message {
    text-align: center;
    padding: 20px;
}

.leaderboard-message.loading {
    color: #666;
}

.leaderboard-message.success {
    color: #4CAF50;
}

.leaderboard-message.error {
    color: #f44336;
}

.leaderboard-message.info {
    color: #2196F3;
}

/* Top rank styles */
.top-1 td:first-child::after {
    content: " 🥇";
}

.top-2 td:first-child::after {
    content: " 🥈";
}

.top-3 td:first-child::after {
    content: " 🥉";
}

.top-1, .top-2, .top-3 {
    font-weight: bold;
}

.top-1 {
    background-color: rgba(255, 215, 0, 0.1);
}

.top-2 {
    background-color: rgba(192, 192, 192, 0.1);
}

.top-3 {
    background-color: rgba(205, 127, 50, 0.1);
}

/* Help Modal Improvements */
.help-sections {
    margin-bottom: 20px;
}

.help-section {
    margin-bottom: 15px;
}

.help-section h3 {
    color: #FDB813;
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.help-section ul {
    margin-bottom: 10px;
}

.help-section li {
    padding: 6px 0;
    color: #555;
    position: relative;
    padding-left: 25px;
    line-height: 1.4;
}

.help-section li::before {
    content: "🐝";
    position: absolute;
    left: 0;
    font-size: 14px;
}

/* Welcome Message Styles */
.welcome-message {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 25px;
    border-radius: 15px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 3000;
    text-align: center;
}

.welcome-content h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.welcome-content p {
    color: #666;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.welcome-tips {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    color: #555;
}

.welcome-tips span {
    background: rgba(255, 215, 0, 0.1);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.help-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: #FDB813;
    border-radius: 50%;
    color: white;
    font-style: normal;
    font-weight: bold;
    font-size: 12px;
    line-height: 16px;
    text-align: center;
}

.welcome-close {
    background: #FDB813;
    color: #333;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
    width: 100%;
}

.welcome-close:hover {
    background: #ffca45;
} 