/* Reset and normalize styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: #333;
    background: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-text-size-adjust: 100%;
}

/* Container styles with cross-browser fixes */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    gap: 20px;
    flex: 1;
    width: 100%;
    position: relative;
    background: #fff;
}

/* Main content area with cross-browser fixes */
.main-content {
    flex: 1;
    min-width: 0; /* Prevents flex item from overflowing */
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    -webkit-box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1;
}

/* Map container with cross-browser fixes */
#map-container {
    height: 500px;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    background: #f8f9fa;
    -webkit-border-radius: 8px;
    -moz-border-radius: 8px;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* Ad space with cross-browser fixes */
.ad-space {
    width: 300px;
    min-width: 300px;
    position: sticky;
    top: 20px;
    height: calc(100vh - 40px);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    -webkit-box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Ad container with cross-browser fixes */
.ad-container {
    width: 100%;
    min-height: 250px;
    background: #f8f9fa;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    -webkit-border-radius: 8px;
    -moz-border-radius: 8px;
}

/* Game controls with cross-browser fixes */
.game-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
    width: 100%;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Buttons with cross-browser fixes */
button {
    padding: 12px 24px;
    font-size: 16px;
    border: none;
    border-radius: 6px;
    background: #007bff;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-transition: all 0.3s ease;
    -moz-transition: all 0.3s ease;
    -webkit-border-radius: 6px;
    -moz-border-radius: 6px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

button:hover {
    background: #0056b3;
    transform: translateY(-1px);
    -webkit-transform: translateY(-1px);
    -moz-transform: translateY(-1px);
}

/* Score display with cross-browser fixes */
#score-display {
    font-size: 24px;
    font-weight: bold;
    margin: 20px 0;
    text-align: center;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Mobile styles with cross-browser fixes */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        padding: 10px;
        gap: 15px;
    }

    .main-content {
        padding: 15px;
        width: 100%;
        max-width: 100%;
    }

    .ad-space {
        width: 100%;
        min-width: 100%;
        position: relative;
        top: 0;
        height: auto;
        min-height: 250px;
    }

    #map-container {
        height: 400px;
    }

    button {
        width: 100%;
        padding: 15px;
    }
}

/* Landscape orientation with cross-browser fixes */
@media (max-height: 600px) and (orientation: landscape) {
    .container {
        flex-direction: row;
        padding: 10px;
    }

    .main-content {
        width: calc(100% - 320px);
        padding: 10px;
    }

    .ad-space {
        width: 300px;
        min-width: 300px;
        position: sticky;
        top: 10px;
        height: calc(100vh - 20px);
    }

    #map-container {
        height: 300px;
    }

    .game-controls {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
    }

    button {
        flex: 1;
        min-width: 120px;
        padding: 10px;
    }
}

/* Ensure consistent font rendering */
h1, h2, h3, h4, h5, h6, p, span, div {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Ensure consistent scrolling behavior */
html {
    scroll-behavior: smooth;
    -webkit-scroll-behavior: smooth;
    -ms-scroll-behavior: smooth;
    -moz-scroll-behavior: smooth;
}

/* Ensure consistent form elements */
input, select, textarea {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border-radius: 6px;
    -webkit-border-radius: 6px;
    -moz-border-radius: 6px;
    background-color: #fff;
    border: 1px solid #ddd;
    padding: 8px 12px;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
    width: 100%;
    max-width: 100%;
}

select {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    padding-right: 32px;
}

/* Ensure consistent transitions */
.transition {
    transition: all 0.3s ease;
    -webkit-transition: all 0.3s ease;
    -moz-transition: all 0.3s ease;
}

/* Ensure consistent transforms */
.transform {
    transform: translateY(-1px);
    -webkit-transform: translateY(-1px);
    -moz-transform: translateY(-1px);
}

/* Ensure consistent box shadows */
.shadow {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    -webkit-box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    -moz-box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Ensure consistent border radius */
.rounded {
    border-radius: 8px;
    -webkit-border-radius: 8px;
    -moz-border-radius: 8px;
}

/* Map Container */
.map-container {
    width: 100%;
    height: 500px;
    min-height: 500px;
    margin: 20px 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#map {
    width: 100%;
    height: 100%;
}

/* Controls Section */
.controls {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.controls h2 {
    margin-bottom: 15px;
    color: #333;
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.control-group label {
    font-weight: 500;
    color: #555;
}

.control-group select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: #f8f9fa;
}

/* Location Display */
.location-display {
    background: #fff;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.location-text {
    margin: 0;
    color: #333;
    font-size: 16px;
}

/* Info Sections */
.info-sections {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.about-section {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.about-section h2 {
    color: #333;
    margin-bottom: 15px;
}

.about-section p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.about-section p:last-child {
    margin-bottom: 0;
}

/* Footer Styles */
.site-footer {
    background: #f8f9fa;
    padding: 15px 0;
    border-top: 1px solid #e9ecef;
}

.footer-bottom {
    text-align: center;
    color: #6c757d;
    font-size: 14px;
}

/* Ad Container */
.ad-space {
    width: 300px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
    height: fit-content;
    margin: 0;
    padding: 0;
}

.ad-container {
    width: 100%;
    margin: 0;
    padding: 0;
}

.ad-container p {
    font-size: 12px;
    color: #666;
    margin: 5px 0;
}

/* Mobile Styles */
@media (max-width: 768px) {
    body {
        background: #fff;
    }
    
    .container {
        flex-direction: column;
        padding: 10px;
        gap: 20px;
        background: #fff;
    }

    .main-content {
        width: 100%;
        max-width: 100%;
    }

    .map-container {
        height: 400px;
        min-height: 400px;
        margin: 10px 0;
    }

    .ad-space {
        width: 100%;
        position: relative;
        top: 0;
    }

    .controls {
        position: relative;
        width: 100%;
        margin: 10px 0;
        padding: 15px;
        background: rgba(255, 255, 255, 0.95);
        border-radius: 10px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        z-index: 2;
    }

    .info-sections {
        padding: 15px;
        margin-top: 20px;
        background: #fff;
        border-radius: 10px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        z-index: 2;
    }

    .location-display {
        margin: 10px 0;
        padding: 10px;
        background: #fff;
        border-radius: 10px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        z-index: 2;
    }

    .site-footer {
        position: relative;
        width: 100%;
        padding: 10px 0;
        margin-top: 20px;
        background: #f8f9fa;
        border-top: 1px solid #e9ecef;
        height: 60px;
        z-index: 2;
    }
}

/* Desktop Styles */
@media (min-width: 769px) {
    .container {
        flex-direction: row;
        align-items: flex-start;
    }

    .main-content {
        width: calc(100% - 340px);
    }
}

/* Additional mobile optimizations */
@media (max-width: 480px) {
    .container {
        padding: 5px;
    }

    .map-container {
        height: 300px;
        min-height: 300px;
    }

    .controls {
        padding: 10px;
    }

    .info-sections {
        padding: 10px;
    }

    .site-footer {
        height: 50px;
    }

    .footer-bottom {
        font-size: 11px;
    }

    /* Additional text size adjustments for very small screens */
    .about-section h2 {
        font-size: 1.3rem;
    }

    .about-section p {
        font-size: 14px;
    }

    .location-text {
        font-size: 13px;
    }

    .ad-container {
        margin: 5px 0;
    }
}

/* Ad Placeholder Styles */
.ad-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border: 1px dashed #dee2e6;
    border-radius: 5px;
    padding: 20px;
    color: #6c757d;
    font-size: 14px;
    text-align: center;
}

/* Ad-specific styles */
.ad-header {
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.ad-body {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.ad-image {
    width: 80px;
    height: 80px;
    background-color: #e9ecef;
    border-radius: 8px;
    flex-shrink: 0;
}

.ad-text {
    flex: 1;
}

.ad-title {
    font-size: 16px;
    font-weight: 600;
    color: #212529;
    margin: 0 0 8px 0;
}

.ad-description {
    font-size: 14px;
    color: #6c757d;
    margin: 0;
    line-height: 1.4;
}

.ad-footer {
    text-align: right;
}

.ad-cta {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.ad-cta:hover {
    background-color: #0056b3;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .ad-space {
        width: 250px;
        min-width: 250px;
        padding: 15px;
    }
    
    .ad-image {
        width: 60px;
        height: 60px;
    }
    
    .ad-title {
        font-size: 14px;
    }
    
    .ad-description {
        font-size: 12px;
    }
}

/* Header Styles */
.site-header {
    text-align: center;
    padding: 20px 0;
    margin-bottom: 20px;
}

.site-header h1 {
    color: #2196F3;
    font-size: 2.5em;
    margin: 0;
    font-weight: bold;
}

.tagline {
    color: #666;
    font-size: 1.2em;
    margin: 10px 0 0;
}

/* Guide Section Styles */
.guide-section {
    margin-top: 30px;
    border-top: 1px solid #e0e0e0;
    padding-top: 20px;
}

.guide-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.guide-step {
    background-color: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.guide-step h4 {
    color: #2196F3;
    margin: 0 0 10px 0;
    font-size: 1.1em;
}

.guide-step p {
    color: #666;
    margin: 0;
    font-size: 0.95em;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .guide-content {
        grid-template-columns: 1fr;
    }
    
    .guide-step {
        margin-bottom: 15px;
    }
}

/* Landscape mode specific styles */
@media (orientation: landscape) and (max-width: 768px) {
    body {
        background: #fff;
    }
    
    .container {
        background: #fff;
    }
    
    .map-container {
        height: 60vh;
        min-height: 300px;
    }
}

/* Dart element with cross-browser animation support */
#dart {
    position: absolute;
    width: 30px;
    height: 30px;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%23ff0000" d="M12 2L2 12l10 10 10-10L12 2z"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 1000;
    will-change: transform, left, top;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d;
    -webkit-perspective: 1000;
    perspective: 1000;
}

.dart-flying {
    animation: dart-fly 0.5s infinite;
    -webkit-animation: dart-fly 0.5s infinite;
    -moz-animation: dart-fly 0.5s infinite;
    -ms-animation: dart-fly 0.5s infinite;
}

@keyframes dart-fly {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    50% { transform: translate(-50%, -50%) rotate(5deg); }
    100% { transform: translate(-50%, -50%) rotate(0deg); }
}

@-webkit-keyframes dart-fly {
    0% { -webkit-transform: translate(-50%, -50%) rotate(0deg); }
    50% { -webkit-transform: translate(-50%, -50%) rotate(5deg); }
    100% { -webkit-transform: translate(-50%, -50%) rotate(0deg); }
}

@-moz-keyframes dart-fly {
    0% { -moz-transform: translate(-50%, -50%) rotate(0deg); }
    50% { -moz-transform: translate(-50%, -50%) rotate(5deg); }
    100% { -moz-transform: translate(-50%, -50%) rotate(0deg); }
}

@-ms-keyframes dart-fly {
    0% { -ms-transform: translate(-50%, -50%) rotate(0deg); }
    50% { -ms-transform: translate(-50%, -50%) rotate(5deg); }
    100% { -ms-transform: translate(-50%, -50%) rotate(0deg); }
} 