* {
    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, #0a0a0a 0%, #1a1a2a 100%);
    color: #ffffff;
    height: 100vh;
    overflow: hidden;
}

#game-container {
    width: 100%;
    height: 100vh;
    position: relative;
}

.screen {
    position: absolute;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.screen.active {
    display: flex;
}

/* Menu Screen */
#menu-screen h1 {
    font-size: 5rem;
    margin-bottom: 15px;
    background: linear-gradient(45deg, #00ff88, #00aaff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
}

.tagline {
    font-size: 1.2rem;
    color: #888;
    margin-bottom: 40px;
}

/* Sound Preview Screen */
#sound-preview {
    background: linear-gradient(135deg, #1a1a3a 0%, #2a1a4a 100%);
}

#sound-preview h2 {
    font-size: 3rem;
    margin-bottom: 30px;
    background: linear-gradient(45deg, #ff6b6b, #ffd93d);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.preview-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.preview-instruction {
    font-size: 1.3rem;
    margin-bottom: 30px;
    color: #ffffff;
}

.preview-controls {
    margin: 30px 0;
}

#preview-info {
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#preview-info p {
    margin: 10px 0;
    color: #cccccc;
    font-size: 1.1rem;
}

#preview-sound-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.menu-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 40px;
}

.menu-btn {
    padding: 18px 50px;
    font-size: 1.2rem;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 250px;
}

.menu-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #00ff88;
    transform: translateY(-2px);
}

.instructions {
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
}

.instructions p {
    margin: 5px 0;
}

/* Game Screen */
#game-screen {
    padding: 0;
}

#game-hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
    z-index: 20;
}

.hud-left, .hud-center, .hud-right {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.hud-center {
    justify-content: center;
}

.hud-right {
    justify-content: flex-end;
}

.hud-center {
    align-items: center;
}

#stroke-count {
    font-size: 1.5rem;
    font-weight: bold;
}

#distance-indicator {
    font-size: 0.9rem;
    color: #00ff88;
}

/* Visualization Canvas */
#visualization {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#visualization.visible {
    opacity: 1;
}

/* Game Controls */
#game-controls {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 18;
}

#movement-indicator {
    background: rgba(0, 0, 0, 0.6);
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 0.9rem;
    color: #888;
}

#swing-btn {
    padding: 15px 40px;
    font-size: 1.2rem;
    font-weight: bold;
    background: linear-gradient(135deg, #00ff88, #00aaff);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#swing-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(0, 255, 136, 0.4);
}

#swing-btn:active {
    transform: scale(0.95);
}

.small-btn {
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.small-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Overlays */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.overlay.hidden {
    display: none;
}

.overlay h2 {
    font-size: 3rem;
    margin-bottom: 30px;
    background: linear-gradient(45deg, #00ff88, #00aaff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hole-stats, .final-stats {
    font-size: 1.2rem;
    line-height: 2;
    margin-bottom: 30px;
    text-align: center;
}

#scorecard {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 10px;
    margin: 20px 0;
    max-width: 600px;
}

.scorecard-hole {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 5px;
    text-align: center;
}

/* Loading */
.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #00ff88;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Course Select */
#course-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
    max-width: 800px;
    width: 100%;
}

.course-card {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.course-card:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #00ff88;
    transform: translateY(-5px);
}

.course-name {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.course-info {
    font-size: 0.9rem;
    color: #888;
}

.back-btn {
    padding: 10px 30px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 20px;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* HUD System Styling */
.hud-mode-selector {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 6px 12px;
    z-index: 15;
    display: flex;
    flex-direction: row;
    gap: 12px;
    align-items: center;
}

.mode-btn {
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
    text-align: center;
    white-space: nowrap;
}

.mode-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #00ff88;
}

.mode-btn.active {
    background: linear-gradient(135deg, #00ff88, #00aaff);
    border-color: #00ff88;
    font-weight: bold;
}

.leaderboard-status {
    margin-top: 3px;
    padding: 2px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 2px;
    font-size: 0.5rem;
    text-align: center;
    color: #888;
}

/* HUD Elements */
.hud-element {
    position: fixed;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 12px;
    z-index: 12;
    font-size: 0.9rem;
}

.hud-element.compass {
    top: 120px;
    right: 20px;
    width: 100px;
    height: 100px;
}

.hud-element.distance-meter {
    top: 240px;
    right: 20px;
    width: 130px;
}

.compass-ring {
    width: 60px;
    height: 60px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    position: relative;
    margin: 0 auto 6px;
}

.compass-needle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 30px;
    background: #00ff88;
    transform-origin: bottom center;
    transform: translate(-50%, -100%);
}

.compass-directions {
    position: absolute;
    width: 100%;
    height: 100%;
}

.compass-directions span {
    position: absolute;
    font-size: 0.8rem;
    font-weight: bold;
    color: #ccc;
}

.north { top: -5px; left: 50%; transform: translateX(-50%); }
.east { right: -5px; top: 50%; transform: translateY(-50%); }
.south { bottom: -5px; left: 50%; transform: translateX(-50%); }
.west { left: -5px; top: 50%; transform: translateY(-50%); }

.sound-direction-indicator {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #ff4444;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.compass-angle {
    text-align: center;
    color: #00ff88;
    font-weight: bold;
}

.distance-bar {
    width: 100%;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
}

.distance-fill {
    height: 100%;
    background: linear-gradient(to right, #ff4444, #ffff44, #44ff44);
    width: 0%;
    transition: width 0.3s ease;
}

.distance-text {
    text-align: center;
    font-weight: bold;
    color: white;
    margin-bottom: 5px;
}

.distance-hints span {
    display: block;
    text-align: center;
    font-size: 0.8rem;
    font-weight: bold;
    padding: 2px;
}

.distance-hints .hot { color: #ff4444; }
.distance-hints .warm { color: #ffaa44; }
.distance-hints .cold { color: #4444ff; }
.distance-hints .hidden { display: none; }

/* Timer positioning - hidden by default, only shown in time trial mode */
.hud-element.timer {
    display: none;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 160px;
    padding: 15px 20px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: #00ff88;
}

/* Show timer only in time trial mode */
.time-trial-mode .hud-element.timer {
    display: block;
}

/* Gear button removed completely */
#hud-toggle-btn {
    display: none;
}

/* Settings Panel */
#settings-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: 30px;
    z-index: 1000;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
}

#settings-panel h2 {
    margin-bottom: 20px;
    background: linear-gradient(45deg, #00ff88, #00aaff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
}

.settings-section {
    margin-bottom: 25px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-section h3 {
    margin-bottom: 15px;
    color: #00ff88;
    font-size: 1.1rem;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 8px 0;
}

.setting-item label {
    color: #ccc;
    font-size: 0.95rem;
}

.setting-item input, .setting-item select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    min-width: 100px;
}

.setting-item input[type="checkbox"] {
    min-width: auto;
    width: 18px;
    height: 18px;
}

.setting-item input[type="range"] {
    min-width: 120px;
}

.settings-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
}

.settings-buttons button {
    padding: 10px 25px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.settings-buttons button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #00ff88;
}

#close-settings {
    background: linear-gradient(135deg, #00ff88, #00aaff) !important;
    border: none !important;
}

/* Action Buttons Enhancement */
.action-btn {
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: bold;
    background: linear-gradient(135deg, #00ff88, #00aaff);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 100;
    position: relative;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 136, 0.4);
}

.action-btn:active {
    transform: translateY(0);
}

/* Ensure buttons are clickable */
button, .menu-btn, .action-btn, .mode-btn {
    position: relative;
    z-index: inherit;
}

/* Mobile Warning Screen */
#mobile-warning {
    background: linear-gradient(135deg, #1a1a3a 0%, #3a1a1a 100%);
}

#mobile-warning h1 {
    font-size: 3rem;
    margin-bottom: 30px;
    background: linear-gradient(45deg, #ff6b6b, #ffd93d);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.warning-content {
    max-width: 600px;
    text-align: left;
    background: rgba(255, 255, 255, 0.05);
    padding: 30px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.warning-content p {
    margin: 15px 0;
    font-size: 1.1rem;
    line-height: 1.6;
}

.warning-content ul {
    margin: 20px 0;
    padding-left: 0;
    list-style: none;
}

.warning-content li {
    margin: 10px 0;
    font-size: 1rem;
    padding: 8px 0;
}

#continue-anyway {
    margin-top: 25px;
    background: rgba(255, 100, 100, 0.2) !important;
    border-color: #ff6b6b !important;
}

#continue-anyway:hover {
    background: rgba(255, 100, 100, 0.3) !important;
}