/* Basic Reset & Body Styling */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    /* Very dark, desaturated teal/blue-grey */
    background-color: #0f1a1d;
    color: #e0e0e0;
    touch-action: none; /* Prevent default touch actions like scrolling */
    overflow: hidden; /* Prevent scrolling on mobile */
    position: relative; /* For potential pseudo-elements */
}

/* --- Keyframes for Effects --- */
@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-3px, 0, 0); }
  40%, 60% { transform: translate3d(3px, 0, 0); }
}

@keyframes flash {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.02); filter: brightness(1.5); } /* Bright flash */
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); } /* Scale up */
  100% { transform: scale(1); }
}

/* --- Game Container - Minimalist & Dark --- */
.game-container {
    background-color: rgba(15, 26, 29, 0.85); /* Dark background */
    border: 1px solid rgba(218, 165, 32, 0.25); /* Muted Gold/Bronze border */
    backdrop-filter: blur(2px); /* Very subtle blur */
    -webkit-backdrop-filter: blur(2px);
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5); /* Subtle shadow */
    padding: 20px 25px; /* Adjust padding */
    text-align: center;
    width: 95%;
    max-width: 450px;
    height: 90vh; /* Use most vertical height */
    max-height: 750px; /* Max height */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* --- Header Layout --- */
header {
    display: flex;
    align-items: center;
    justify-content: center; /* Center title group */
    width: 100%;
    margin-bottom: 5px; /* Less margin below header */
    flex-direction: column; /* Stack elements vertically */
    padding-top: 5px; /* Small space at top */
}

.title-group {
    display: flex;
    align-items: center;
    margin-bottom: 10px; /* Space below logo/title */
}

/* --- Logo Styling --- */
#logo-image {
    width: 35px;
    height: 35px;
    object-fit: contain; /* Scale logo nicely */
    margin-right: 10px; /* Space between logo and title */
    opacity: 0.9;
    vertical-align: middle;
}

header h1 {
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); /* Simple depth shadow */
    margin: 0; /* Remove default margin */
    font-weight: 500; /* Less bold */
    letter-spacing: 1px;
    font-size: 1.6em; /* Adjust size if needed */
}

/* --- Progress Display Styling --- */
.progress-display {
    display: flex;
    justify-content: space-around; /* Space out score, streak, high score */
    align-items: center; /* Align items vertically */
    width: 100%;
    margin-bottom: 10px; /* Space below progress */
    font-size: 1em;
    color: #b0c4de; /* Light Steel Blue for labels */
    flex-wrap: wrap; /* Allow wrapping on small screens if needed */
    gap: 10px; /* Spacing between items */
}

.progress-display div {
    display: flex;
    align-items: center;
}

.progress-display span { /* Style the labels */
    opacity: 0.8;
    font-size: 0.9em;
}

.progress-display strong { /* Style the numbers */
    color: #daa520; /* Gold accent */
    margin-left: 6px; /* Space between label and number */
    font-size: 1.15em; /* Slightly larger numbers */
    font-weight: bold;
    min-width: 20px; /* Ensure space even when 0 */
    text-align: center; /* Center the number */
}

#streak-counter, #high-score {
    /* Base style in strong selector */
}

/* --- Game Area Styling --- */
.game-area {
    flex-grow: 1; /* Take remaining space */
    display: flex;
    flex-direction: column;
    justify-content: center; /* Center content vertically */
    align-items: center;
    padding-bottom: 10px; /* Space above footer */
    width: 100%;
}

.message {
    min-height: 2.2em; /* Reserve space */
    font-size: 1.15em;
    margin-bottom: 20px; /* Space below message */
    color: #f0f0f0;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.message.success {
    color: #8fbc8f; /* DarkSeaGreen */
    font-weight: bold;
    text-shadow: 0 0 4px rgba(143, 188, 143, 0.5); /* Subtle green glow */
}

.message.error {
    color: #FF4136; /* Bright Red */
    font-weight: bold;
    text-shadow: 0 0 5px rgba(255, 65, 54, 0.7); /* Red glow */
}

/* --- Lock Grid Styling --- */
.lock-grid-container {
    width: 90%; /* Responsive width */
    max-width: 320px;
    aspect-ratio: 1 / 1; /* Maintain square shape */
    margin: 0 auto; /* Center horizontally */
}

#lock-grid-svg {
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.15); /* Dark, transparent background */
    border-radius: 10px;
    cursor: pointer;
    border: none; /* No border on SVG itself */
}

/* --- Dot Styling --- */
.dot {
    fill: rgba(30, 45, 50, 0.7); /* Dark teal/grey fill */
    stroke: rgba(218, 165, 32, 0.4); /* Muted gold stroke */
    stroke-width: 1;
    transition: fill 0.2s ease, filter 0.2s ease, stroke 0.2s ease, transform 0.1s ease;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.3));
    /* transform-origin: center center; */ /* For potential scale effects */
}

.dot.active {
    fill: #f5f5f5; /* Off-white center */
    stroke: #daa520; /* Clear Gold/Bronze stroke */
    stroke-width: 1.5;
    /* Focused gold glow */
    filter: drop-shadow(0 0 4px rgba(218, 165, 32, 0.7)) drop-shadow(0 0 8px rgba(218, 165, 32, 0.5));
    /* transform: scale(1.1); */ /* Optional: slight pop effect */
}

/* --- Line Styling --- */
.pattern-line {
    stroke: #daa520; /* Gold/Bronze */
    stroke-width: 4;
    stroke-linecap: round;
    opacity: 0.9;
    /* Subtle gold glow */
    filter: drop-shadow(0 0 3px rgba(218, 165, 32, 0.7)) drop-shadow(0 0 5px rgba(218, 165, 32, 0.5));
}

.computer-pattern-line {
    stroke: #FF4136; /* Bright Red */
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 5, 5;
    opacity: 0.95; /* Make error line very visible */
    /* Brighter red glow */
    filter: drop-shadow(0 0 4px rgba(255, 65, 54, 0.8)) drop-shadow(0 0 8px rgba(255, 65, 54, 0.6));
}

/* --- Footer Styling --- */
footer {
    padding-top: 10px; /* Reduced padding */
    height: 25px; /* Small defined height */
    display: flex;
    justify-content: center;
    align-items: center;
}

footer p {
    font-size: 0.8em;
    opacity: 0.5;
    color: #b0c4de;
}

/* --- Classes to Trigger Effects --- */
.error-shake {
  animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

.success-flash {
  animation: flash 0.4s ease-out;
}

.score-pulse, .pulse-effect {
   display: inline-block; /* Needed for transform */
   animation: pulse 0.5s ease-in-out;
}

/* --- Responsive Adjustments --- */
@media (max-height: 700px) {
     .game-container { padding: 15px 20px; max-height: 95vh;} /* Allow more height */
    header h1 { font-size: 1.5em; }
    #logo-image { width: 30px; height: 30px; margin-right: 8px;}
    .message { font-size: 1.1em; margin-bottom: 15px; }
    .progress-display { font-size: 0.95em; }
}

@media (max-width: 400px) {
    header h1 { font-size: 1.3em; letter-spacing: 0.5px;}
    #logo-image { width: 28px; height: 28px; margin-right: 6px;}
    .pattern-line { stroke-width: 3.5; }
    .computer-pattern-line { stroke-width: 3.5; }
    .progress-display { font-size: 0.9em; gap: 5px; justify-content: center;}
    .progress-display strong { font-size: 1.1em;}
    .message { font-size: 1.05em; }
}