/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #e0e0e0;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Ad Placeholders */
.ad-placeholder {
    background: rgba(30, 30, 50, 0.6);
    border: 2px dashed rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.ad-top {
    width: 100%;
    height: 100px;
    margin-bottom: 20px;
}

.ad-sidebar {
    width: 160px;
    min-height: 600px;
    display: none;
}

.ad-label {
    color: rgba(255, 255, 255, 0.3);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Container Layout */
.container {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    gap: 20px;
    min-height: calc(100vh - 120px);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 20px;
    min-height: calc(100vh - 140px);
}

/* Header */
header {
    position: relative;
    margin-bottom: 30px;
    width: 100%;
}

h1 {
    font-size: 3rem;
    font-weight: 700;
    text-shadow: 0 0 20px rgba(100, 150, 255, 0.5), 2px 2px 4px rgba(0, 0, 0, 0.8);
    margin-bottom: 10px;
    background: linear-gradient(135deg, #ffffff 0%, #a0c4ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.info-btn {
    position: absolute;
    top: -10px;
    right: 20px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

/* Counter Display */
.counter-display {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Stats Sections */
.stats-section {
    width: 100%;
    max-width: 800px;
    margin-bottom: 20px;
    padding: 18px 25px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-item, .personal-stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
}

.stat-value {
    color: #a0c4ff;
    font-weight: bold;
    font-size: 1.1rem;
}

.stat-divider {
    color: rgba(255, 255, 255, 0.2);
    margin: 0 10px;
}

/* Global Raw Counts */
.global-raw-counts {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.global-raw-counts .stat-item {
    flex: 0 0 auto;
}

/* Recent Results Bar */
.recent-results {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recent-results .stat-label {
    text-align: center;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.results-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    align-items: center;
    min-height: 40px;
}

.result-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
    animation: badgeFadeIn 0.3s ease;
}

@keyframes badgeFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.result-badge:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px currentColor;
}

.wind-badge {
    background: rgba(125, 211, 252, 0.2);
    color: #7dd3fc;
    border: 1px solid rgba(125, 211, 252, 0.4);
}

.not-wind-badge {
    background: rgba(252, 165, 165, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(252, 165, 165, 0.4);
}

.results-empty {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
    font-style: italic;
    padding: 10px;
}

/* Personal Stats */
.personal-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.personal-stat-item {
    justify-content: center;
    flex-wrap: wrap;
}

.personal-stats .wind-stat {
    color: #7dd3fc;
}

.personal-stats .not-wind-stat {
    color: #fca5a5;
}

.counter-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.counter-value {
    font-size: 2rem;
    font-weight: bold;
    color: #a0c4ff;
    text-shadow: 0 0 10px rgba(100, 150, 255, 0.5);
}

.counter-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.counter-divider {
    color: rgba(255, 255, 255, 0.3);
    font-size: 1.5rem;
}

/* Result Container */
.result-container {
    min-height: 300px;
    width: 100%;
    max-width: 600px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.result-content {
    text-align: center;
    padding: 30px;
    width: 100%;
    position: relative;
}

/* Result Placeholder */
.result-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    padding: 40px;
    background: rgba(255, 255, 255, 0.03);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.result-placeholder.hidden {
    display: none;
}

.placeholder-icon {
    font-size: 5rem;
    font-weight: bold;
    color: rgba(160, 196, 255, 0.4);
    margin-bottom: 20px;
    animation: pulse 2s ease-in-out infinite;
    text-shadow: 0 0 20px rgba(160, 196, 255, 0.3);
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.4;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.05);
    }
}

.placeholder-text {
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.2rem;
    font-style: italic;
}

.result-display {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.result-image {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
    animation: fadeInScale 0.6s ease-out;
    object-fit: cover;
    aspect-ratio: 4/3;
}

.result-text {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(100, 150, 255, 0.8);
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.result-text.wind {
    color: #7dd3fc;
}

.result-text.not-wind {
    color: #fca5a5;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Main Button */
.main-button {
    position: relative;
    padding: 25px 60px;
    font-size: 1.8rem;
    font-weight: bold;
    color: #ffffff;
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    border: none;
    border-radius: 15px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.4), 0 0 20px rgba(59, 130, 246, 0.2);
    z-index: 1;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    margin-bottom: 40px;
}

.main-button:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.main-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    z-index: -1;
}

.main-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(59, 130, 246, 0.6), 0 0 30px rgba(59, 130, 246, 0.4);
}

.main-button:active {
    transform: translateY(-1px) scale(0.98);
}

.main-button:active::before {
    width: 300px;
    height: 300px;
}

.main-button.clicking {
    animation: buttonPulse 0.4s ease;
}

@keyframes buttonPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.95);
    }
}

.button-text {
    position: relative;
    z-index: 1;
}

.button-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    opacity: 0;
    animation: rotateGlow 3s linear infinite;
    pointer-events: none;
}

@keyframes rotateGlow {
    0% {
        transform: rotate(0deg);
        opacity: 0;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        transform: rotate(360deg);
        opacity: 0;
    }
}

.main-button:hover .button-glow {
    opacity: 0.3;
}

/* Share Section */
.share-section {
    width: 100% !important;
    max-width: 600px;
    margin-bottom: 40px;
    margin-top: 0;
    text-align: center;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.share-heading {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 15px;
    font-weight: 500;
    display: block;
}

.share-buttons {
    display: flex !important;
    gap: 12px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    visibility: visible !important;
}

.share-button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3), 0 0 10px rgba(59, 130, 246, 0.2);
    z-index: 1;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.share-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
    z-index: -1;
}

.share-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5), 0 0 15px rgba(59, 130, 246, 0.3);
}

.share-button:active {
    transform: translateY(0) scale(0.98);
}

.share-button:active::before {
    width: 200px;
    height: 200px;
}

.share-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.share-label {
    position: relative;
    z-index: 1;
}

.share-button.copied {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3), 0 0 10px rgba(16, 185, 129, 0.2);
}

.share-button.copied:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5), 0 0 15px rgba(16, 185, 129, 0.3);
}

/* Footer */
footer {
    margin-top: 60px;
    padding: 20px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

footer a {
    color: #a0c4ff;
    text-decoration: none;
    transition: all 0.3s ease;
}

footer a:hover {
    color: #ffffff;
    text-shadow: 0 0 10px rgba(160, 196, 255, 0.5);
    text-decoration: underline;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.show {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 40px;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: #e0e0e0;
    font-size: 28px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #a0c4ff;
    font-size: 2rem;
}

.modal-content p {
    margin-bottom: 15px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
}

.modal-footer {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #a0c4ff;
    font-weight: bold;
}

/* Responsive Design */
@media (min-width: 768px) {
    .ad-sidebar {
        display: flex;
    }

    h1 {
        font-size: 4rem;
    }

    .main-button {
        padding: 30px 80px;
        font-size: 2.2rem;
    }
}

@media (max-width: 767px) {
    h1 {
        font-size: 2rem;
    }

    .counter-display {
        flex-direction: column;
        gap: 10px;
    }

    .counter-divider {
        display: none;
    }

    .result-text {
        font-size: 1.8rem;
    }

    .main-button {
        padding: 20px 40px;
        font-size: 1.5rem;
    }

    .share-section {
        margin-bottom: 30px;
    }

    .share-heading {
        font-size: 1rem;
        margin-bottom: 12px;
    }

    .share-buttons {
        gap: 10px;
    }

    .share-button {
        padding: 10px 18px;
        font-size: 0.9rem;
    }

    .share-icon {
        width: 18px;
        height: 18px;
    }

    .ad-top {
        height: 80px;
    }

    .info-btn {
        position: static;
        margin-left: 10px;
    }

    header {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .stats-section {
        padding: 15px 20px;
    }

    .global-raw-counts {
        flex-direction: column;
        gap: 8px;
    }

    .stat-divider {
        display: none;
    }

    .result-badge {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }

    .personal-stat-item {
        flex-direction: column;
        gap: 5px;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 20px 10px;
    }

    .modal-content {
        padding: 30px 20px;
    }
}
