:root {
  --glow-color: #d99f26;
  --dark-bg: #1a1a1a;
  --darker-bg: #000000;
  --highlight: #d99f26;
  --tech-lines: rgba(217, 159, 38, 0.2);
}

.analyzer-container {
    max-width: 800px;
    width: 95%;
    margin: 20px auto;
    padding: 15px;
    background: #1a1a1a;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    color: #ffffff;
    font-family: 'DM Sans', sans-serif;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(217, 159, 38, 0.3);
}

.analyzer-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--glow-color), transparent);
  z-index: 1;
  animation: scanline 4s linear infinite;
}

.analyzer-container::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    linear-gradient(90deg, var(--tech-lines) 1px, transparent 1px) 0 0 / 20px 20px,
    linear-gradient(0deg, var(--tech-lines) 1px, transparent 1px) 0 0 / 20px 20px;
  pointer-events: none;
  z-index: -1;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
    justify-content: space-between;
    gap: 15px;
    align-items: center;
    margin-bottom: 30px;
    padding: 15px;
    background: #000000;
    border-radius: 6px;
    border: 1px solid rgba(217, 159, 38, 0.3);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
    position: relative;
}

.controls::before {
  content: 'SYSTEM PARAMETERS';
  position: absolute;
  top: -10px;
  left: 20px;
  background: var(--darker-bg);
  padding: 0 10px;
  font-size: 10px;
  color: var(--glow-color);
  letter-spacing: 1px;
}

.tempo-control,
.difficulty-control,
.duration-control {
    display: flex;
    flex-direction: column;
    min-width: unset;
    align-items: center;
    width: 100%;
    gap: 10px;
}

.tempo-slider-container {
    position: relative;
    width: 100%;;
    padding-bottom: 20px;
}

.tempo-markers {
    position: relative;
    width: 100%;
    height: 20px;
    margin-top: 5px;
    display: flex;
    justify-content: space-between;
}

.tempo-mark {
    font-size: 12px;
    color: #666;
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #111, #222, #111);
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #d99f26;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s ease;
    box-shadow: 0 0 10px rgba(217, 159, 38, 0.5);
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: #ffffff;
}

.start-btn {
    background: #d99f26;
    color: #000000;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    min-width: 150px;
    width: 100%; /* Full width on mobile */
    margin-top: 10px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(217, 159, 38, 0.4);
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.start-btn:after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0) 70%);
  transform: rotate(45deg);
  animation: sheen 3s infinite;
}

.start-btn:hover {
    background: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(217, 159, 38, 0.7);
}

.start-btn:disabled {
    background: #666;
    cursor: not-allowed;
    transform: none;
}

.progress-bar {
    height: 10px;
    background: #333;
    border-radius: 5px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #d99f26, #f0c14b, #d99f26);
    background-size: 200% 100%;
    animation: gradientShift 2s linear infinite;
    width: 0%;
    transition: width 0.1s linear;
}

.visualization {
    background: #000000;
    padding: 20px;
    border-radius: 6px;
    height: 200px;
    position: relative;
    margin-bottom: 20px;
    border: 1px solid rgba(217, 159, 38, 0.3);
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.5);
}

.visualization::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at center, transparent 30%, rgba(0, 0, 0, 0.7) 100%),
    linear-gradient(0deg, rgba(217, 159, 38, 0.05) 1px, transparent 1px) 0 0 / 10px 10px;
  pointer-events: none;
}

.visualization::after {
  content: '';
  position: absolute;
  top: 10px;
  right: 10px;
  width: 8px;
  height: 8px;
  background: var(--glow-color);
  border-radius: 50%;
  animation: blink 2s infinite;
}

.beat-indicator {
    width: 20px;
    height: 20px;
    background: #333;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 0 10px rgba(217, 159, 38, 0.2);
}

.beat-indicator.active {
    background: #d99f26;
    box-shadow: 0 0 30px var(--glow-color);
    transform: translate(-50%, -50%) scale(1.5);
}

.results {
    margin-top: 20px;
    padding: 20px;
    background: #000000;
    border-radius: 6px;
    display: none;
}

.results h3 {
    color: #d99f26;
    margin-bottom: 15px;
    font-family: 'League Gothic', sans-serif;
    text-transform: uppercase;
    position: relative;
    display: inline-block;
    padding-bottom: 5px;
}

.results h3::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glow-color), transparent);
}

.accuracy-meter {
    height: 30px;
    background: #333;
    border-radius: 15px;
    overflow: hidden;
    margin: 10px 0;
}

.accuracy-fill {
    height: 100%;
    background: linear-gradient(90deg, #d99f26, #f0c14b, #d99f26);
    background-size: 200% 100%;
    animation: gradientShift 3s linear infinite;
    width: 0%;
    transition: width 1s ease;
}

#accuracyScore {
    font-size: 24px;
    color: #d99f26;
    font-weight: bold;
    margin: 10px 0;
}

#feedback {
    color: #ffffff;
    margin-top: 10px;
    font-size: 16px;
    line-height: 1.4;
}

.difficulty-control {
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 300px;
}

.difficulty-buttons {
    display: flex;
    gap: 10px;
    width: 100%;
    justify-content: space-between;
}

.difficulty-btn {
    background: #333;
    flex: 1;
    color: #ffffff;
    border: none;
    padding: 8px 10px;
    font-size: 12px; /* Was incorrectly set to 112px */
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 1px solid rgba(51, 51, 51, 0.5);
}

.difficulty-btn:hover {
    background: #444;
}

.difficulty-btn.active {
    background: #d99f26;
    color: #000000;
    box-shadow: 0 0 15px rgba(217, 159, 38, 0.5);
}

.difficulty-btn:before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  background: var(--glow-color);
  transition: all 0.3s ease;
}

.difficulty-btn:hover:before {
  left: 0;
}

.tempo-control {
    flex: 1;
    min-width: 300px;
}

.countdown-display {
    position: fixed; /* Change from absolute to fixed */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 120px;
    color: #d99f26;
    font-weight: bold;
    z-index: 1000; /* Ensure it's above other elements */
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid var(--glow-color);
    text-shadow: 0 0 30px var(--glow-color);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
    padding: 20px;
    border-radius: 10px;
    animation: countdownPulse 1s ease-in-out infinite;
}

@keyframes countdownPulse {
    0% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.2); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

.duration-control {
    display: flex;
    align-items: center;
    gap: 15px;
}

.duration-buttons {
    display: flex;
    gap: 10px;
    width: 100%;
    justify-content: space-between;
}

.duration-btn {
    flex: 1;
    background: #333;
    color: #ffffff;
    border: none;
    padding: 8px 10px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 1px solid rgba(51, 51, 51, 0.5);
}

.duration-btn:hover {
    background: #444;
}

.duration-btn.active {
    background: #d99f26;
    color: #000000;
    box-shadow: 0 0 15px rgba(217, 159, 38, 0.5);
}

.duration-btn:before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  background: var(--glow-color);
  transition: all 0.3s ease;
}

.duration-btn:hover:before {
  left: 0;
}

.timing-analysis {
    margin-top: 30px;
    padding: 20px;
    background: #000000;
    border-radius: 6px;
}

.timing-analysis h3 {
    color: #d99f26;
    margin-bottom: 15px;
    font-family: 'League Gothic', sans-serif;
    text-transform: uppercase;
    position: relative;
    display: inline-block;
    padding-bottom: 5px;
}

.timing-analysis h3::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glow-color), transparent);
}

.timing-graph {
    height: 250px;
    margin-bottom: 20px;
    background: #111;
    border-radius: 6px;
    padding: 15px;
    margin: 0 -15px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.timing-legend {
    display: flex;
    padding: 10px;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.input-meter {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 6px;
    background: #333;
    border-radius: 3px;
    overflow: hidden;
}

.input-level {
    height: 100%;
    width: 0%;
    background: #d99f26;
    transition: width 0.1s linear;
}

.session-history {
    margin-top: 30px;
    padding: 20px;
    background: #000000;
    border-radius: 6px;
}

.session-history h3 {
    color: #d99f26;
    margin-bottom: 15px;
    font-family: 'League Gothic', sans-serif;
    text-transform: uppercase;
    position: relative;
    display: inline-block;
    padding-bottom: 5px;
}

.session-history h3::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glow-color), transparent);
}

.history-graph {
    height: 250px;
    background: #111;
    border-radius: 6px;
    padding: 15px;
    margin: 0 -15px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.timing-graph canvas,
.history-graph canvas {
    width: 100% !important;
    height: 100% !important;
    max-height: 200px;
}

.share-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.social-share-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.share-btn,
.social-btn {
    background: #d99f26;
    color: #000000;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.share-btn:hover,
.social-btn:hover {
    background: #ffffff;
    transform: translateY(-2px);
}

.facebook {
    background: #d99f26;
    color: #000000;
}

.twitter {
    background: #d99f26;
    color: #000000;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.history-view-buttons {
    display: flex;
    gap: 10px;
}

.history-btn {
    background: #333;
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.history-btn:hover {
    background: #444;
}

.history-btn.active {
    background: #d99f26;
    color: #000000;
}

.streak-counter {
    background: #000000;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.streak-display {
    color: #d99f26;
    font-weight: bold;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.streak-display::before {
    font-size: 20px;
}

.streak-display.star-streak::before {
    content: '⭐';
}

.streak-display.fire-streak::before {
    content: '🔥';
}

.golden-streak {
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

#streakCounter {
    transition: all 0.3s ease;
    cursor: help;
}

.email-collection {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.email-modal {
    background: #1a1a1a;
    padding: 2rem;
    border-radius: 8px;
    max-width: 400px;
    width: 90%;
}

.email-modal h3 {
    color: #d99f26;
    margin-bottom: 1rem;
}

.email-modal p {
    color: white;
    margin-bottom: 1.5rem;
}

.email-modal input {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    border: 1px solid #333;
    background: #000;
    color: white;
}

.email-buttons {
    display: flex;
    gap: 1rem;
}

.save-progress-btn,
.maybe-later-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
}

.save-progress-btn {
    background: #d99f26;
    color: black;
    font-weight: bold;
}

.maybe-later-btn {
    background: #333;
    color: white;
}

/* Simplified tutorial styles */
.tutorial-panel {
    background: #000 !important;
    border: 1px solid #d99f26 !important;
    border-radius: 8px !important;
    margin-bottom: 20px !important;
    overflow: hidden !important;
    width: 100% !important;
    max-width: 800px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
}

.tutorial-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 12px 15px !important;
    background: #1a1a1a !important;
    border-bottom: 1px solid #d99f26 !important;
    cursor: pointer !important;
}

.tutorial-header h3 {
    margin: 0 !important;
    color: #d99f26 !important;
    font-size: 16px !important;
}

.tutorial-toggle {
    background: none !important;
    border: none !important;
    color: #d99f26 !important;
    font-size: 20px !important;
    cursor: pointer !important;
    padding: 5px !important;
    line-height: 1 !important;
    position: relative !important;
    width: 30px !important;
    height: 30px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.tutorial-content {
    padding: 15px !important;
    color: #ffffff !important;
    background: #000 !important;
}

.tutorial-step {
    display: none !important;
}

.tutorial-step.active {
    display: block !important;
}

.tutorial-step h4 {
    color: #d99f26 !important;
    margin-top: 0 !important;
}

.tutorial-step p, 
.tutorial-step li {
    color: #ffffff !important;
    margin-bottom: 15px !important;
}

.next-step, .done-tutorial {
    background: #d99f26 !important;
    color: #000 !important;
    border: none !important;
    padding: 8px 16px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    margin-top: 10px !important;
    font-weight: bold !important;
    display: inline-block !important;
}

.next-step:hover, .done-tutorial:hover {
    background: #fff !important;
}

.streak-tabs {
    display: flex;
    gap: 5px;
    margin: 5px 0 15px 0;
    flex-wrap: wrap;
    background: #111;
    padding: 8px;
    border-radius: 4px;
}

.streak-tab-btn {
    background: #222;
    color: #ffffff;
    border: none;
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.streak-tab-btn:hover {
    background: #333;
}

.streak-tab-btn.active {
    background: #d99f26;
    color: #000000;
}

.tab-fade {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.main-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.main-tab-btn {
    background: #333;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    text-align: center;
}

.main-tab-btn:hover {
    background: #444;
    transform: translateY(-2px);
}

.main-tab-btn.active {
    background: #d99f26;
    color: #000000;
    transform: translateY(0);
}

/* Sub tab navigation */
.sub-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    background: #111;
    padding: 10px;
    border-radius: 4px;
}

.sub-tab-btn {
    background: #222;
    color: #ffffff;
    border: none;
    padding: 8px 15px;
    font-size: 13px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    text-align: center;
}

.sub-tab-btn:hover {
    background: #333;
}

.sub-tab-btn.active {
    background: #d99f26;
    color: #000000;
}

/* History view containers */
.history-view {
    display: none;
    animation: fadeIn 0.4s ease;
}

.history-view.active {
    display: block;
}

/* Sync Status Indicator */
.sync-status-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: #1a1a1a;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
}

.sync-status-indicator:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.sync-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sync-path {
    fill: #d99f26; /* Default synced color */
}

/* Sync states */
.sync-status-syncing .sync-path {
    fill: #4d94ff; /* Blue for syncing */
    animation: rotate 2s linear infinite;
}

.sync-status-error .sync-path {
    fill: #ff4d4d; /* Red for error */
}

.sync-status-offline .sync-path {
    fill: #aaaaaa; /* Gray for offline */
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Tooltip */
.sync-tooltip {
    position: absolute;
    bottom: 50px;
    right: 0;
    background: #000;
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

.sync-status-indicator:hover .sync-tooltip {
    opacity: 1;
    visibility: visible;
    bottom: 55px;
}

/* Show error message */
.sync-error-message {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background: #ff4d4d;
    color: #fff;
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 13px;
    max-width: 300px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transform: translateX(120%);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.sync-error-message.show {
    transform: translateX(0);
}

.sync-error-message .close-error {
    position: absolute;
    top: 5px;
    right: 5px;
    cursor: pointer;
    font-size: 16px;
}

/* Add media queries for specific screen sizes */
@media screen and (max-width: 768px) {
    .visualization {
        height: 150px; /* Smaller height on mobile */
    }

    .countdown-display {
        font-size: 80px; /* Smaller countdown size */
    }

    .input-meter {
        width: 80%; /* Wider input meter */
    }

    #accuracyScore {
        font-size: 20px;
    }

    .results h3,
    .timing-analysis h3,
    .session-history h3 {
        font-size: 18px;
    }

    .duration-btn {
        font-size: 14px;
        padding: 10px 16px;
    }

    .difficulty-btn {
        font-size: 14px;
        padding: 8px 14px;
    }

    .start-btn {
        width: auto; /* Reset width on desktop */
        font-size: 14px;
    }

    .controls {
        flex-direction: row; /* Show horizontally on desktop */
    }

    .tempo-control,
    .difficulty-control,
    .duration-control {
        flex-direction: row;
        width: auto;
    }

    .streak-tabs {
        justify-content: center;
    }
    
    .streak-tab-btn {
        flex: 1 0 auto;
        text-align: center;
        font-size: 11px;
        padding: 5px 10px;
    }
    .main-tabs, .sub-tabs {
        flex-wrap: wrap;
    }
    
    .main-tab-btn {
        flex: 1 0 45%;
        padding: 8px 15px;
        font-size: 13px;
    }
    
    .sub-tab-btn {
        flex: 1 0 45%;
        padding: 6px 10px;
        font-size: 12px;
        margin-bottom: 4px;
    }

}

/* Mobile styles */
@media (max-width: 480px) {
    .analyzer-container {
        padding: 10px;
    }

    .controls {
        padding: 10px;
        width: 100%;
        box-sizing: border-box;
    }

    .tempo-control {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .tempo-slider-container {
        width: 90%;
        padding-right: 10px; /* Add some padding to prevent edge touching */
        box-sizing: border-box;
    }

    .difficulty-control {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        width: 90%; /* Ensure full width of parent */
        box-sizing: border-box; /* Include padding in width calculations */
    }

    .difficulty-buttons {
        width: 90%;
        display: flex;
        gap: 4px; /* Reduce gap for smaller screens */
        justify-content: space-between; /* Space out buttons */
    }

    .difficulty-btn {
        font-size: 11px; /* Adjust font for small screens */
        padding: 4px 2px; /* Ensure padding fits within button */
        min-width: 0; /* Allow buttons to shrink */
        flex: 1; /* Distribute space evenly among buttons */
        text-align: center; /* Center button text */
    }

    input[type="range"] {
        width: 100%;
        margin: 0;
    }

    .duration-control {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        width: 100%;
        box-sizing: border-box;
        padding: 0;
    }

    .duration-buttons {
        width: 100%;
        gap: 4px;
        justify-content: space-between;
        box-sizing: border-box;
    }

    .duration-btn {
        flex: 1;
        padding: 6px 4px;
        font-size: 11px;
        min-width: 0;
    }

    .start-btn {
        font-size: 12px;
        padding: 8px 16px;
        min-width: unset;
        align-self: center;
        width: 100%;
        box-sizing: border-box;
    }

    .progress-bar {
        height: 8px;
    }

    .accuracy-meter {
        height: 15px;
    }

    .countdown-display {
        font-size: 80px;
        text-shadow: 0 0 15px rgba(217, 159, 38, 0.4);
    }

    .legend-color {
        width: 12px;
        height: 12px;
    }
    .timing-graph,
    .history-graph {
        height: 200px;
        padding: 10px;
        margin: 0 -10px;
    }
    
    .timing-graph canvas,
    .history-graph canvas {
        max-height: 180px;
    }
    
    .timing-legend {
        justify-content: center;
        font-size: 10px;
    }
    
    .legend-item {
        font-size: 10px;
    }

    .history-header {
        flex-direction: column;
        gap: 15px;
    }

    .history-btn {
        padding: 6px 12px;
        font-size: 12px;
}

    .social-share-buttons {
        flex-direction: column;
    }

    .share-btn,
    .social-btn {
        font-size: 14px;
        padding: 10px 20px;
    }

.tutorial-panel {
        margin-left: -10px;
        margin-right: -10px;
        border-radius: 0;
    }
    
    .tutorial-content {
        padding: 10px;
    }
    
    .tutorial-content.collapsed {
        padding: 0 10px;
    }
    
    .next-step, .done-tutorial {
        padding: 6px 12px;
        font-size: 14px;
    }

    .streak-tab-btn {
        flex: 1 0 100%;
        margin-bottom: 5px;
    }
    .main-tab-btn, .sub-tab-btn {
        flex: 1 0 100%;
        margin-bottom: 5px;
    }
    
    .main-tabs, .sub-tabs {
        gap: 5px;
    }
}

/* Add better touch handling for mobile */
@media (hover: none) {
    .difficulty-btn:hover,
    .duration-btn:hover,
    .start-btn:hover {
        transform: none;
    }

    input[type="range"]::-webkit-slider-thumb {
        width: 24px; /* Larger touch target */
        height: 24px;
    }
}

@keyframes blink {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

@keyframes scanline {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(calc(100vh)); }
}

@keyframes sheen {
  0%, 100% { transform: rotate(45deg) translateX(-100%); }
  50% { transform: rotate(45deg) translateX(100%); }
}

@keyframes gradientShift {
  0% { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}