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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    padding: 1rem;
    position: relative;
    overflow-x: hidden;
}

.background-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}

.manga-panel {
    position: absolute;
    width: 180px;
    height: 240px;
    background-size: cover;
    background-position: center;
    border-radius: 15px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    opacity: 0.15;
    filter: blur(1px) grayscale(0.3);
    transform-style: preserve-3d;
}

.panel-1 {
    background-image: url('images/panel1.jpg');
    top: 10%;
    left: 5%;
    transform: rotate(-15deg) translateZ(0);
    animation: float1 8s ease-in-out infinite;
}

.panel-2 {
    background-image: url('images/panel2.jpg');
    top: 15%;
    right: 8%;
    transform: rotate(10deg) translateZ(0);
    animation: float2 10s ease-in-out infinite;
}

.panel-3 {
    background-image: url('images/panel3.jpg');
    bottom: 20%;
    left: 8%;
    transform: rotate(8deg) translateZ(0);
    animation: float3 12s ease-in-out infinite;
}

.panel-4 {
    background-image: url('images/panel4.jpg');
    bottom: 10%;
    right: 5%;
    transform: rotate(-12deg) translateZ(0);
    animation: float4 9s ease-in-out infinite;
}

@keyframes float1 {
    0%, 100% { transform: rotate(-15deg) translateY(0px); }
    50% { transform: rotate(-15deg) translateY(-10px); }
}

@keyframes float2 {
    0%, 100% { transform: rotate(10deg) translateY(0px); }
    50% { transform: rotate(10deg) translateY(8px); }
}

@keyframes float3 {
    0%, 100% { transform: rotate(8deg) translateY(0px); }
    50% { transform: rotate(8deg) translateY(-6px); }
}

@keyframes float4 {
    0%, 100% { transform: rotate(-12deg) translateY(0px); }
    50% { transform: rotate(-12deg) translateY(12px); }
}

.container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 25px;
    padding: 2rem;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    text-align: center;
    min-width: 320px;
    max-width: 400px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 1;
}

.header {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    padding-top: 3rem;
}

.header-nav-mobile {
    display: none;
    position: absolute;
    top: -0.5rem;
    left: 0;
    z-index: 10;
}

.home-button-mobile {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    text-decoration: none;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.home-button-mobile:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: translateY(-1px);
}

.home-button-mobile .home-icon {
    font-size: 1rem;
}

.nav-controls {
    position: absolute;
    top: -0.5rem;
    left: 0;
    z-index: 10;
}

.home-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    padding: 0.6rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: #667eea;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.1);
}

.home-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.5);
}

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

.home-icon {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.home-btn:hover .home-icon {
    transform: scale(1.1);
}

.home-text {
    font-family: inherit;
}

h1 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-weight: 300;
    font-size: 2rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: #6c7b7f;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0;
    opacity: 0.8;
}

.mode-selector {
    margin-bottom: 2rem;
    background: #f8f9fa;
    border-radius: 15px;
    padding: 1.5rem;
}

.mode-selector h3 {
    margin-bottom: 1rem;
    color: #333;
    font-size: 1.1rem;
    font-weight: 500;
}

.mode-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.mode-btn {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-width: 80px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #666;
}

.mode-btn:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.mode-btn.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.mode-icon {
    font-size: 1.5rem;
}

.mode-selector.hidden {
    display: none;
}

.timer-display {
    margin-bottom: 2rem;
    position: relative;
}

.time {
    font-size: 4rem;
    font-weight: 300;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-family: 'Courier New', monospace;
    text-shadow: 0 4px 20px rgba(102, 126, 234, 0.2);
    transition: all 0.3s ease;
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.time::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, transparent 60%, rgba(102, 126, 234, 0.1) 61%, rgba(102, 126, 234, 0.05) 100%);
    border-radius: 50%;
    z-index: -1;
    animation: pulse-ring 3s ease-in-out infinite;
}

@keyframes pulse-ring {
    0%, 100% { 
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.7;
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.05);
        opacity: 0.3;
    }
}

.mode {
    font-size: 1.2rem;
    color: #666;
    font-weight: 500;
    padding: 0.5rem 1rem;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 20px;
    display: inline-block;
    margin-top: 0.5rem;
    transition: all 0.3s ease;
}

.controls {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.8rem 1.8rem;
    border: none;
    border-radius: 25px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    min-width: 100px;
    white-space: nowrap;
}

.btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn.primary:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6b4096 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.btn.secondary {
    background: rgba(255, 255, 255, 0.8);
    color: #667eea;
    border: 1px solid rgba(102, 126, 234, 0.2);
    backdrop-filter: blur(10px);
}

.btn.secondary:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.settings {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: left;
}

.settings h3 {
    margin-bottom: 1rem;
    color: #333;
    text-align: center;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.setting-item:last-child {
    margin-bottom: 0;
}

.setting-item label {
    font-weight: 500;
    color: #555;
}

.setting-item input {
    width: 60px;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    text-align: center;
    font-size: 1rem;
}

.stats {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    color: #555;
}

.work-mode {
    color: #e74c3c !important;
}

.break-mode {
    color: #27ae60 !important;
}

@media (max-width: 480px) {
    .header-nav-mobile {
        display: block;
    }
    
    .nav-controls {
        display: none;
    }
    
    .container {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .time {
        font-size: 3rem;
    }
    
    .time::before {
        width: 180px;
        height: 180px;
    }
    
    .controls {
        gap: 0.5rem;
    }
    
    .btn {
        flex: 1;
        min-width: auto;
        padding: 0.8rem 1rem;
        font-size: 0.85rem;
    }
    
    .mode-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .mode-btn {
        flex-direction: row;
        width: 100%;
        justify-content: flex-start;
        text-align: left;
    }
    
    .manga-panel {
        width: 120px;
        height: 160px;
    }
    
    .panel-1, .panel-3 {
        left: 2%;
    }
    
    .panel-2, .panel-4 {
        right: 2%;
    }
    
    .header {
        padding-top: 2.5rem;
    }
}