:root {
    --primary: #0056b3;
    --primary-dark: #004085;
    --secondary: #5a6268;
    --secondary-dark: #4e555b;
    --dark: #2c3e50;
    --danger: #c82333;
     --danger-dark: #a71d2a;
     --success: #1e7e34;
     --success-dark: #155724;
    --bg: #f4f7f9;
    --card-bg: white;
    --text: #333;
    --border: #dee2e6;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --hole-bg: #8c5a3b;
    --mole-color: #7f8c8d; /* A visible gray for light mode */
}

.dark-mode {
    --bg: #1a1a1a;
    --card-bg: #2d2d2d;
    --text: #e0e0e0;
    --border: #444;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    --hole-bg: #593a27;
    --mole-color: #95a5a6; /* A lighter gray for dark mode */
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    background-color: var(--bg);
    color: var(--text);
    transition: background-color 0.3s, color 0.3s;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; }

/* Header & Nav */
header {
     background: linear-gradient(135deg, var(--primary), var(--dark));
     color: white;
     padding: 1.5rem 0;
     box-shadow: 0 2px 10px rgba(0,0,0,0.1);
     position: relative;
     overflow: hidden;
     border-bottom: 4px solid var(--danger);
 }
 header::before {
     content: "";
     position: absolute;
     top: 0;
     left: 0;
     right: 0;
     height: 3px;
     background: linear-gradient(90deg, #ff6b6b, #4a6bff, #6bff6b, #ffff6b, #ff6b6b);
     background-size: 200% 100%;
     animation: rainbow 3s linear infinite;
 }
 @keyframes rainbow {
     0% { background-position: 0% 50%; }
     100% { background-position: 100% 50%; }
 }
.header-content { padding-top: 1rem; text-align: center; }
h1 { font-size: 2.2rem; font-weight: 700; margin-bottom: 0.5rem; }
.tagline { font-size: 1.1rem; color: rgba(255, 255, 255, 0.9); margin-bottom: 1rem; }
.main-nav { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0; }
.nav-brand .logo-link { display: flex; align-items: center; gap: 0.5rem; font-size: 1.2rem; font-weight: 600; color: white; text-decoration: none; }
.nav-brand .logo-link img { height: 30px; width: auto; }
.nav-links { display: flex; list-style: none; gap: 1.5rem; }
.nav-link { color: rgba(255, 255, 255, 0.9); text-decoration: none; font-weight: 500; display: flex; align-items: center; gap: 0.5rem; transition: color 0.3s ease; }
.nav-link:hover { color: white; }
.nav-actions { display: flex; align-items: center; gap: 1rem; }

/* Dark Mode Toggle */
.toggle-container { display: flex; align-items: center; gap: 0.75rem; color: white; }
.toggle-switch { position: relative; display: inline-block; width: 60px; height: 30px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--secondary); transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 22px; width: 22px; left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--primary); }
input:checked + .slider:before { transform: translateX(30px); }

/* Breadcrumb */
.breadcrumb { padding: 1rem 0; font-size: 0.9rem; color: var(--text-light); }
.breadcrumb a { color: var(--primary); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { margin: 0 5px; }

/* Main Content */
main { padding: 2rem 0; }
.game-wrapper {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    max-width: 600px;
    margin: auto;
    text-align: center;
}

.content-section {
     background: var(--card-bg);
     padding: 2rem;
     border-radius: 12px;
     margin: 2rem auto;
     box-shadow: var(--shadow);
     border: 1px solid var(--border);
     max-width: 800px;
 }
 .dark-mode .content-section {
     background: var(--dark-card);
     border-color: var(--dark-border);
 }
 .content-section h2 {
     margin-top: 0;
     color: var(--primary);
     margin-bottom: 1.5rem;
 }
 .content-section p, .content-section ul, .content-section ol {
     line-height: 1.7;
     margin-bottom: 1rem;
 }
 .content-section ul, .content-section ol {
     padding-left: 1.5rem;
 }
 .dark-mode .content-section a {
     color: var(--info);
     text-decoration: underline;
 }

.game-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
}
.game-stats h3 {
    color: var(--primary);
}

.message {
     margin-bottom: 1rem;
     font-size: 1.2rem;
     font-weight: 600;
     height: 1.5em; /* Prevent layout shift */
     transition: color 0.3s;
 }
 .message.success {
     color: var(--success);
 }
 .message.error {
     color: var(--danger);
 }

.game-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    background-image: url('https://www.transparenttextures.com/patterns/grass.png');
   background-color: #a8d589;
   padding: 1.5rem;
   border-radius: 10px;
   border: 5px solid #6b4a2b;
   cursor: none; /* Hide default cursor */
}

.content-section {
     background: var(--card-bg);
     padding: 2rem;
     border-radius: 12px;
     margin: 2rem auto;
     box-shadow: var(--shadow);
     border: 1px solid var(--border);
     max-width: 900px;
 }
 .dark-mode .content-section {
     background: var(--dark-card);
     border-color: var(--dark-border);
 }
 .content-section h2 {
     margin-top: 0;
     color: var(--primary);
     margin-bottom: 1.5rem;
 }
 .content-section p, .content-section ul, .content-section ol {
     line-height: 1.7;
     margin-bottom: 1rem;
 }
 .content-section ul, .content-section ol {
     padding-left: 1.5rem;
 }

.hole {
    aspect-ratio: 1;
    background: radial-gradient(circle, #5a3e29 60%, var(--hole-bg) 100%);
    border-radius: 50%;
    border: 5px solid #6b4a2b;
    position: relative;
    overflow: hidden;
}

.mole {
    width: 75%;
    height: 75%;
    background: var(--mole-color);
    border-radius: 50%;
    position: absolute;
    bottom: -100%;
    left: 12.5%;
    transition: bottom 0.2s ease-in-out;
    cursor: none; /* Hide default cursor */
    display: flex;
     justify-content: center;
     align-items: center;
     box-shadow: inset 0 -5px 10px rgba(0,0,0,0.2);
}
.mole i {
     font-size: 2.5rem;
     color: white;
     transition: transform 0.2s;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.4);
 }
.mole.up {
    bottom: 10%;
}
.mole:active {
     transform: scale(0.95);
 }
.game-controls {
    display: flex;
     flex-direction: column;
     align-items: center;
     gap: 1.5rem;
    margin-top: 2rem;
}

difficulty-controls {
     display: flex;
     gap: 1rem;
 }

 .btn.difficulty-btn {
     background-color: var(--secondary);
 }
 .btn.difficulty-btn.active {
     background-color: var(--success);
 }

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
.btn.primary { background-color: var(--primary); color: white; }
.btn.primary:hover:not(:disabled) { background-color: var(--primary-dark); }
.btn.danger { background-color: var(--danger); color: white; }
.btn.danger:hover:not(:disabled) { background-color: var(--danger-dark); }
.btn:disabled {
    background-color: var(--secondary) !important;
    cursor: not-allowed;
}

/* Hit/Miss Effects */
 .hole .hit-effect {
     position: absolute;
     top: 50%;
     left: 50%;
     transform: translate(-50%, -50%) scale(0);
     font-size: 2rem;
     color: var(--danger);
     opacity: 0;
     transition: all 0.3s ease-out;
     pointer-events: none;
 }

 .hole.hit .hit-effect {
     transform: translate(-50%, -50%) scale(1.5);
     opacity: 1;
 }

 .game-board.shake {
     animation: shake 0.3s ease-in-out;
 }

 @keyframes shake {
     0%, 100% { transform: translateX(0); }
     25% { transform: translateX(-5px); }
     75% { transform: translateX(5px); }
 }

 /* Custom Cursor */
 #cursor-container {
     position: fixed;
     pointer-events: none;
     z-index: 9999;
     font-size: 3.5rem;
     color: var(--danger);
     transform: rotate(-45deg) translate(-15px, 15px);
 }

.content-grid {
     display: grid;
     grid-template-columns: 1fr 1fr;
     gap: 2rem;
     align-items: center;
 }

 .image-content {
     text-align: center;
 }

 .content-image {
     width: 100%;
     max-width: 400px;
     border-radius: 8px;
     box-shadow: var(--shadow);
 }

/* Footer */
footer { background-color: var(--dark); color: white; padding: 1.5rem 0; text-align: center; font-size: 0.9rem; margin-top: 2rem; position: relative; }
 footer::before {
     content: "";
     position: absolute;
     top: 0;
     left: 0;
     right: 0;
     height: 3px;
     background: linear-gradient(90deg, #ff6b6b, #4a6bff, #6bff6b, #ffff6b, #ff6b6b);
     background-size: 200% 100%;
     animation: rainbow 3s linear infinite;
 }
 .footer-content { display: flex; flex-direction: column; align-items: center; }
 .footer-links { display: flex; gap: 1.5rem; margin-bottom: 1rem; flex-wrap: wrap; justify-content: center; }
 .footer-links a { color: white; text-decoration: none; transition: opacity 0.2s; }
 .footer-links a:hover { opacity: 0.8; }
 .copyright { opacity: 0.7; }

 .social-sharing { padding: 15px 0; text-align: center; }
 .social-sharing span { font-weight: 500; margin-right: 12px; color: white; font-size: 14px; }
 .social-sharing a { color: white; font-size: 18px; margin: 0 8px; transition: color 0.3s ease; }
 .social-sharing a:hover { color: var(--light); }

@media (max-width: 768px) {
    h1 { font-size: 1.8rem; }
    .main-nav { flex-direction: column; gap: 1rem; }
    .nav-links { flex-wrap: wrap; justify-content: center; }
    .content-grid { grid-template-columns: 1fr; }
    #cursor-container {
         display: none;
     }
     .game-board, .mole {
         cursor: pointer;
     }
}