* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    min-height: 100vh;
    padding: 10px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@supports (padding: max(0px)) {
    body {
        padding-left: max(10px, env(safe-area-inset-left));
        padding-right: max(10px, env(safe-area-inset-right));
        padding-top: max(10px, env(safe-area-inset-top));
        padding-bottom: max(10px, env(safe-area-inset-bottom));
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* Hero Banner */
.hero-banner {
    width: 100%;
    overflow: hidden;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
}

.hero-image {
    width: 100%;
    height: auto;
    display: block;
    max-height: 450px;
    object-fit: contain;
}

/* Header */
header {
    background: linear-gradient(135deg, #4a90e2 0%, #2c7cc1 100%);
    color: white;
    padding: 30px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
    padding: 0 20px;
}

.app-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    animation: spin 20s linear infinite;
}

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

.mascot-icon {
    width: 100px;
    height: 100px;
    object-fit: contain;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.header-text {
    text-align: center;
    flex: 1;
}

header h1 {
    font-size: 2.8em;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    font-weight: 800;
    letter-spacing: 2px;
}

.tagline {
    font-size: 1.2em;
    opacity: 0.95;
    font-style: italic;
    font-weight: 500;
}

.score-board {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-size: 1.3em;
    font-weight: bold;
}

/* Tabs */
.tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 3px solid #dee2e6;
    overflow-x: auto;
}

.tab {
    flex: 1;
    padding: 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 600;
    transition: all 0.3s;
    border-bottom: 4px solid transparent;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
}

.tab:hover {
    background: #e9ecef;
}

.tab:active {
    background: #dee2e6;
}

.tab.active {
    background: white;
    border-bottom-color: #4a90e2;
    color: #4a90e2;
}

/* Tab Content */
.tab-content {
    display: none;
    padding: 30px;
    animation: fadeIn 0.5s;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Lesson Cards */
.lesson-card {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    border-left: 5px solid #4a90e2;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.lesson-card h3 {
    color: #4a90e2;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.lesson-content {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    align-items: center;
}

.lesson-image-container {
    flex-shrink: 0;
    text-align: center;
    width: 100%;
    max-width: 400px;
}

.lesson-image {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.mini-clock-demo {
    flex-shrink: 0;
}

.lesson-points {
    flex: 1;
    min-width: 250px;
}

.lesson-points li {
    margin: 15px 0;
    font-size: 1.1em;
    line-height: 1.6;
}

/* Time Examples */
.time-examples {
    display: grid;
    gap: 15px;
    width: 100%;
}

.example {
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    font-size: 1.2em;
    border-left: 4px solid #ff9800;
}

/* Conversion Rules */
.conversion-rule {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.2em;
}

.step-by-step {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    border: 2px solid #e9ecef;
}

.step-by-step h4 {
    color: #ff9800;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.step-by-step ol {
    margin-left: 20px;
}

.step-by-step li {
    margin: 15px 0;
    line-height: 1.8;
    font-size: 1.1em;
}

.step-by-step code {
    background: #f8f9fa;
    padding: 5px 10px;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    color: #4a90e2;
    font-weight: bold;
    font-size: 1.1em;
}

/* Clock Container */
.clock-container {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    justify-content: center;
    align-items: flex-start;
}

.analog-clock {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.clock-controls {
    flex: 1;
    min-width: 300px;
}

.time-display {
    background: #4a90e2;
    color: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 20px;
}

.digital-time {
    font-size: 3em;
    font-weight: bold;
    margin-bottom: 10px;
    font-family: 'Courier New', monospace;
}

.french-time {
    font-size: 1.5em;
    opacity: 0.9;
}

.control-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.control-buttons button {
    padding: 15px;
    border: none;
    background: #ff9800;
    color: white;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: all 0.3s;
    min-height: 44px;
    touch-action: manipulation;
}

.control-buttons button:hover {
    background: #f57c00;
    transform: scale(1.05);
}

.control-buttons button:active {
    transform: scale(0.98);
    background: #e65100;
}

.manual-input {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

.manual-input label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
    color: #4a90e2;
}

.manual-input input {
    width: calc(50% - 5px);
    padding: 12px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 16px;
    margin-right: 10px;
    min-height: 44px;
}

.manual-input button {
    width: 100%;
    margin-top: 10px;
    padding: 12px;
    border: none;
    background: #4a90e2;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: all 0.3s;
    min-height: 44px;
    touch-action: manipulation;
}

.manual-input button:hover {
    background: #357abd;
}

.manual-input button:active {
    background: #2c6aa8;
    transform: scale(0.98);
}

/* Digital Clock */
.digital-clock-container {
    text-align: center;
    margin-bottom: 40px;
}

.big-digital-clock {
    font-size: 6em;
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: white;
    padding: 40px;
    border-radius: 20px;
    display: inline-block;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
}

.time-period {
    font-size: 2em;
    color: #4a90e2;
    font-weight: bold;
}

.digital-lessons {
    max-width: 800px;
    margin: 0 auto;
}

.digital-examples {
    display: grid;
    gap: 15px;
}

.digital-example {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    padding: 20px;
    border-radius: 10px;
    font-size: 1.2em;
    border: 2px solid #e9ecef;
}

.digit-time {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #4a90e2;
    font-size: 1.3em;
}

.arrow {
    color: #ff9800;
    font-size: 1.5em;
}

.word-time {
    color: #333;
    font-weight: 600;
}

/* Conversion Tool */
.conversion-tool {
    max-width: 800px;
    margin: 0 auto 40px;
}

.converter-input {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 30px;
}

.converter-input label {
    display: block;
    color: white;
    font-size: 1.5em;
    margin-bottom: 15px;
    font-weight: bold;
}

.converter-input input {
    width: 200px;
    padding: 15px;
    border: none;
    border-radius: 10px;
    font-size: 1.3em;
    text-align: center;
    margin-right: 15px;
    min-height: 44px;
}

.converter-input button {
    padding: 15px 30px;
    border: none;
    background: #ff9800;
    color: white;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.2em;
    font-weight: bold;
    transition: all 0.3s;
    min-height: 44px;
    touch-action: manipulation;
}

.converter-input button:hover {
    background: #f57c00;
    transform: scale(1.05);
}

.converter-input button:active {
    background: #e65100;
    transform: scale(0.98);
}

.conversion-steps {
    min-height: 200px;
}

.conversion-result {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    border: 3px solid #4a90e2;
}

.conversion-result.animated {
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.conversion-result h3 {
    color: #4a90e2;
    margin-bottom: 25px;
    font-size: 1.8em;
    text-align: center;
}

.step {
    background: white;
    padding: 20px;
    margin: 20px 0;
    border-radius: 10px;
    border-left: 5px solid #ff9800;
    animation: stepFade 0.5s ease-out;
    animation-fill-mode: both;
}

.step:nth-child(2) { animation-delay: 0.2s; }
.step:nth-child(3) { animation-delay: 0.4s; }
.step:nth-child(4) { animation-delay: 0.6s; }
.step:nth-child(5) { animation-delay: 0.8s; }

@keyframes stepFade {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.step strong {
    color: #ff9800;
    font-size: 1.2em;
    display: block;
    margin-bottom: 10px;
}

.calculation {
    background: #4a90e2;
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
    font-family: 'Courier New', monospace;
    font-size: 1.3em;
    text-align: center;
    font-weight: bold;
}

.final-answer {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    padding: 25px;
    border-radius: 15px;
    margin-top: 25px;
    text-align: center;
    animation: pulse 1s;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.final-answer strong {
    display: block;
    font-size: 1.5em;
    margin-bottom: 15px;
}

.big-result {
    font-size: 2em;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.quick-conversions {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.quick-conversions h3 {
    color: #4a90e2;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.quick-conversions button {
    margin: 10px;
    padding: 15px 25px;
    border: 2px solid #4a90e2;
    background: white;
    color: #4a90e2;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    transition: all 0.3s;
    min-height: 44px;
    touch-action: manipulation;
}

.quick-conversions button:hover {
    background: #4a90e2;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(74, 144, 226, 0.3);
}

.quick-conversions button:active {
    transform: translateY(0);
    background: #357abd;
}

/* Games */
.game-selector {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
}

.game-btn {
    padding: 15px 30px;
    border: 2px solid #4a90e2;
    background: white;
    color: #4a90e2;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    transition: all 0.3s;
    min-height: 44px;
    touch-action: manipulation;
}

.game-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(74, 144, 226, 0.3);
}

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

.game-btn.active {
    background: #4a90e2;
    color: white;
}

.game-container {
    display: none;
    max-width: 700px;
    margin: 0 auto;
    background: #f8f9fa;
    padding: 30px;
    border-radius: 15px;
}

.game-container.active {
    display: block;
    animation: fadeIn 0.5s;
}

.game-container h3 {
    color: #4a90e2;
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.8em;
}

.game-clock {
    text-align: center;
    margin-bottom: 30px;
    background: white;
    padding: 20px;
    border-radius: 15px;
    display: inline-block;
}

.question-box {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 25px;
    border: 3px solid #4a90e2;
}

.question-box h4 {
    color: #4a90e2;
    font-size: 1.5em;
    margin-bottom: 15px;
}

.question-box p {
    font-size: 1.2em;
    color: #666;
}

.time-equation {
    font-size: 2em;
    font-weight: bold;
    color: #ff9800;
    margin-top: 15px;
}

.game-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.option-btn {
    padding: 20px;
    border: 3px solid #4a90e2;
    background: white;
    color: #4a90e2;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.3em;
    font-weight: bold;
    transition: all 0.3s;
    min-height: 60px;
    touch-action: manipulation;
}

.option-btn:hover {
    background: #4a90e2;
    color: white;
    transform: scale(1.05);
}

.option-btn:active {
    transform: scale(0.98);
    background: #357abd;
    color: white;
}

.game-feedback {
    min-height: 80px;
    text-align: center;
    margin-bottom: 20px;
}

.correct {
    background: #38ef7d;
    color: white;
    padding: 20px;
    border-radius: 10px;
    font-size: 1.5em;
    font-weight: bold;
    animation: bounce 0.5s;
    position: relative;
}

.correct::before {
    content: '';
    position: absolute;
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 100px;
    background: url('celebration.png') no-repeat center center;
    background-size: contain;
    animation: celebrationFade 1s ease-out;
}

@keyframes celebrationFade {
    0% {
        opacity: 0;
        transform: translateX(-50%) scale(0.5);
    }
    50% {
        opacity: 1;
        transform: translateX(-50%) scale(1.1);
    }
    100% {
        opacity: 0.8;
        transform: translateX(-50%) scale(1);
    }
}

.incorrect {
    background: #ff6b6b;
    color: white;
    padding: 20px;
    border-radius: 10px;
    font-size: 1.3em;
    font-weight: bold;
    animation: shake 0.5s;
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

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

.next-btn {
    width: 100%;
    padding: 15px;
    border: none;
    background: #ff9800;
    color: white;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.2em;
    font-weight: bold;
    transition: all 0.3s;
    min-height: 50px;
    touch-action: manipulation;
}

.next-btn:hover {
    background: #f57c00;
    transform: scale(1.02);
}

.next-btn:active {
    background: #e65100;
    transform: scale(0.98);
}

/* Celebration */
.celebration {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #4a90e2 0%, #2c7cc1 100%);
    color: white;
    padding: 40px 60px;
    border-radius: 20px;
    font-size: 2em;
    font-weight: bold;
    z-index: 1000;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: celebrationPop 0.5s ease-out;
}

@keyframes celebrationPop {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* Time Format Explanation */
.time-format-explanation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.format-section {
    background: white;
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #4a90e2;
}

.format-section h4 {
    color: #4a90e2;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.format-section ul {
    margin-left: 20px;
}

.format-section li {
    margin: 10px 0;
    line-height: 1.6;
}

.conversion-examples-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    background: #4a90e2;
    border: 3px solid #4a90e2;
    border-radius: 10px;
    overflow: hidden;
    margin: 20px 0;
}

.conversion-ex-header {
    background: #4a90e2;
    color: white;
    padding: 15px;
    font-weight: bold;
    text-align: center;
    font-size: 1.2em;
}

.conversion-ex-cell {
    background: white;
    padding: 15px;
    text-align: center;
    font-size: 1.1em;
    font-weight: 600;
}

/* Answer Input Box */
.answer-input-box {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

.answer-input-box input {
    padding: 15px;
    font-size: 1.3em;
    border: 3px solid #4a90e2;
    border-radius: 10px;
    text-align: center;
    width: 200px;
    font-weight: bold;
    min-height: 50px;
}

.submit-answer-btn {
    padding: 15px 30px;
    background: #4a90e2;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    min-height: 50px;
    touch-action: manipulation;
}

.submit-answer-btn:hover {
    background: #357abd;
    transform: scale(1.05);
}

.submit-answer-btn:active {
    background: #2c6aa8;
    transform: scale(0.98);
}

/* Mistake Tracker */
.mistake-reminder {
    background: #fff3cd;
    border: 3px solid #ffc107;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    animation: reminderPulse 2s infinite;
}

@keyframes reminderPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.mistake-reminder h4 {
    color: #ff9800;
    margin-bottom: 10px;
    font-size: 1.3em;
}

.mistake-reminder p {
    font-size: 1.1em;
    line-height: 1.6;
}

/* Detailed Explanation */
.detailed-explanation {
    background: #e3f2fd;
    border-left: 5px solid #2196f3;
    padding: 20px;
    margin-top: 15px;
    border-radius: 5px;
    animation: slideDown 0.5s;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        padding: 0 20px;
    }
    to {
        opacity: 1;
        max-height: 500px;
        padding: 20px;
    }
}

.detailed-explanation h4 {
    color: #2196f3;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.detailed-explanation ol, .detailed-explanation ul {
    margin-left: 20px;
}

.detailed-explanation li {
    margin: 10px 0;
    line-height: 1.6;
}

.detailed-explanation code {
    background: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    color: #4a90e2;
    font-weight: bold;
}

/* iPad Portrait & Landscape */
@media (min-width: 768px) and (max-width: 1024px) {
    body {
        padding: 15px;
    }

    .container {
        max-width: 100%;
    }

    .tab {
        font-size: 1em;
        padding: 18px;
    }

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

    .clock-container {
        justify-content: center;
    }

    .game-selector {
        flex-wrap: wrap;
        justify-content: center;
    }

    .game-btn {
        padding: 12px 20px;
        font-size: 1em;
    }
}

/* Mobile Devices */
@media (max-width: 767px) {
    body {
        padding: 5px;
    }

    .container {
        border-radius: 10px;
    }

    .hero-image {
        max-height: 250px;
    }

    .header-content {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
        gap: 15px;
        padding: 0 10px;
    }

    .app-logo {
        width: 60px;
        height: 60px;
    }

    .header-text {
        text-align: center;
        flex-basis: 100%;
        order: -1;
    }

    header {
        padding: 20px 15px;
    }

    .mascot-icon {
        width: 70px;
        height: 70px;
    }

    header h1 {
        font-size: 1.8em;
    }

    .tagline {
        font-size: 1em;
    }

    .score-board {
        font-size: 0.95em;
        gap: 15px;
        flex-direction: column;
    }

    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .tabs::-webkit-scrollbar {
        display: none;
    }

    .tab {
        padding: 12px 8px;
        font-size: 0.85em;
        white-space: nowrap;
        min-width: fit-content;
    }

    .tab-content {
        padding: 15px;
    }

    .lesson-card {
        padding: 15px;
        margin-bottom: 15px;
    }

    .lesson-card h3 {
        font-size: 1.2em;
    }

    .lesson-content {
        flex-direction: column;
        gap: 15px;
    }

    .lesson-image-container {
        max-width: 100%;
    }

    .lesson-image {
        max-width: 100%;
    }

    .lesson-points {
        min-width: 100%;
    }

    .lesson-points li {
        font-size: 1em;
    }

    .example {
        font-size: 1em;
        padding: 12px 15px;
    }

    .step-by-step {
        padding: 15px;
    }

    .step-by-step h4 {
        font-size: 1.1em;
    }

    .step-by-step li {
        font-size: 1em;
    }

    .clock-container {
        flex-direction: column;
        gap: 20px;
    }

    .analog-clock {
        padding: 20px;
    }

    #analogClockSVG {
        width: 250px;
        height: 250px;
    }

    .big-digital-clock {
        font-size: 2.5em;
        padding: 20px;
    }

    .time-period {
        font-size: 1.5em;
    }

    .digital-time {
        font-size: 2.5em;
    }

    .french-time {
        font-size: 1.2em;
    }

    .control-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .control-buttons button {
        font-size: 0.9em;
        padding: 12px;
    }

    .manual-input input {
        width: calc(50% - 5px);
        font-size: 16px;
    }

    .game-options {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .option-btn {
        font-size: 1.1em;
        padding: 18px;
    }

    .digital-example {
        flex-direction: column;
        text-align: center;
        gap: 10px;
        padding: 15px;
    }

    .digit-time {
        font-size: 1.2em;
    }

    .converter-input {
        padding: 20px 15px;
    }

    .converter-input label {
        font-size: 1.2em;
    }

    .converter-input input {
        width: 100%;
        max-width: 250px;
        margin-right: 0;
        margin-bottom: 15px;
        font-size: 1.2em;
    }

    .converter-input button {
        width: 100%;
        max-width: 250px;
        font-size: 1.1em;
    }

    .quick-conversions button {
        margin: 5px;
        padding: 12px 20px;
        font-size: 1em;
    }

    .time-format-explanation {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .format-section {
        padding: 15px;
    }

    .format-section h4 {
        font-size: 1.1em;
    }

    .format-section li {
        font-size: 0.95em;
    }

    .conversion-examples-grid {
        font-size: 0.9em;
    }

    .conversion-ex-header {
        font-size: 1em;
        padding: 12px;
    }

    .conversion-ex-cell {
        padding: 12px;
        font-size: 1em;
    }

    .answer-input-box {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .answer-input-box input {
        width: 100%;
        font-size: 1.2em;
    }

    .submit-answer-btn {
        width: 100%;
        font-size: 1.1em;
    }

    .game-selector {
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
    }

    .game-btn {
        padding: 10px 15px;
        font-size: 0.9em;
        flex: 1 1 auto;
        min-width: 120px;
    }

    .game-container {
        padding: 20px 15px;
    }

    .game-container h3 {
        font-size: 1.4em;
    }

    .question-box {
        padding: 20px 15px;
    }

    .question-box h4 {
        font-size: 1.2em;
    }

    .time-equation {
        font-size: 1.5em;
    }

    #gameClockSVG {
        width: 200px;
        height: 200px;
    }

    .step {
        padding: 15px;
    }

    .step strong {
        font-size: 1.1em;
    }

    .calculation {
        font-size: 1.1em;
        padding: 12px;
    }

    .conversion-result {
        padding: 20px 15px;
    }

    .conversion-result h3 {
        font-size: 1.4em;
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    body {
        padding: 5px;
    }

    header h1 {
        font-size: 1.3em;
    }

    .mascot-icon {
        width: 60px;
        height: 60px;
    }

    .tab {
        font-size: 0.75em;
        padding: 10px 6px;
    }

    .big-digital-clock {
        font-size: 2em;
        padding: 15px;
    }

    .game-btn {
        min-width: 100px;
        font-size: 0.85em;
        padding: 8px 12px;
    }

    .control-buttons button {
        font-size: 0.85em;
        padding: 10px;
    }

    .lesson-card h3 {
        font-size: 1.1em;
    }
}
