/* 기본 리셋 및 전역 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-red: #ff0000;
    --dark-red: #cc0000;
    --bg-black: #000000;
    --text-white: #ffffff;
    --text-gray: #888888;
    --glow-color: rgba(255, 0, 0, 0.5);
}

body {
    font-family: 'Courier New', monospace;
    background: var(--bg-black);
    color: var(--text-white);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* 배경 - 정적 (애니메이션 제거) */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 0, 0, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(255, 0, 0, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* 화면 전환 */
.screen {
    display: none;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.screen.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 초기 설정 화면 */
.container {
    max-width: 500px;
    width: 90%;
    padding: 40px;
    background: rgba(20, 20, 20, 0.95);
    border: 2px solid var(--primary-red);
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.3);
}

/* 로고 컨테이너 */
.logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.app-logo {
    width: 120px;
    height: 120px;
    filter: drop-shadow(0 0 20px var(--primary-red)) drop-shadow(0 0 40px var(--primary-red));
    animation: logoFloat 3s ease-in-out infinite;
}

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

/* 글리치 효과 타이틀 */
.glitch-wrapper {
    margin-bottom: 20px;
}

.title {
    font-size: 2.5rem;
    text-align: center;
    font-weight: bold;
    letter-spacing: 3px;
    color: var(--primary-red);
    position: relative;
    text-shadow: 
        0 0 10px var(--primary-red),
        0 0 20px var(--primary-red),
        0 0 30px var(--primary-red);
}

.glitch {
    animation: glitch 5s infinite;
}

@keyframes glitch {
    0%, 95%, 100% {
        transform: translate(0);
    }
    96% {
        transform: translate(-1px, 1px);
    }
    97% {
        transform: translate(1px, -1px);
    }
    98% {
        transform: translate(-1px, -1px);
    }
    99% {
        transform: translate(1px, 1px);
    }
}

/* subtitle 제거됨 */

/* 폼 스타일 */
.setup-form {
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 25px;
}

.input-with-icon {
    display: flex;
    align-items: center;
    gap: 15px;
}

.input-icon {
    font-size: 2rem;
    min-width: 40px;
    text-align: center;
    filter: grayscale(100%) brightness(40%) sepia(100%) hue-rotate(-50deg) saturate(600%) contrast(0.8) drop-shadow(0 0 8px var(--primary-red));
}

.form-group input {
    flex: 1;
    padding: 12px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--primary-red);
    border-radius: 5px;
    color: var(--text-white);
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus {
    outline: none;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.3);
    border-color: var(--text-white);
}

/* 시작 버튼 */
.btn-start {
    width: 100%;
    padding: 20px;
    background: var(--primary-red);
    border: none;
    border-radius: 5px;
    color: var(--text-white);
    font-size: 2rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: background 0.3s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-start:hover {
    background: var(--dark-red);
    transform: scale(1.05);
}

.btn-start:active {
    transform: scale(0.95);
}

.btn-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.8));
}

/* warning 제거됨 */

/* 타이머 화면 */
.timer-container {
    width: 95%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.timer-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
}

.timer-title {
    font-size: 1.5rem;
    color: var(--primary-red);
    letter-spacing: 5px;
    text-shadow: 0 0 10px var(--glow-color);
    text-align: center;
}

.timer-footer {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-top: 60px;
    gap: 20px;
}

.footer-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.footer-info .version {
    font-size: 0.7rem;
    color: var(--primary-red);
    font-family: monospace;
    letter-spacing: 2px;
    opacity: 0.6;
}

.credits {
    font-size: 0.7rem;
    color: var(--primary-red);
    font-family: monospace;
    letter-spacing: 2px;
    opacity: 0.6;
}

/* version 제거됨 */

.btn-reset {
    background: transparent;
    border: none;
    color: var(--primary-red);
    padding: 0;
    cursor: pointer;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.btn-reset svg {
    width: 100%;
    height: 100%;
}

.btn-reset:hover {
    transform: scale(1.2) rotate(90deg);
}

/* 타이머 디스플레이 */
.timer-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-bottom: 40px;
    flex-wrap: nowrap;
    overflow-x: auto;
    --font-scale: 1.0;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.timer-display::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.timer-segment {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: auto;
    flex-shrink: 0;
}

.timer-value {
    font-size: calc(4rem * var(--font-scale));
    font-weight: bold;
    color: var(--primary-red);
    text-shadow: 
        0 0 10px var(--primary-red),
        0 0 20px var(--primary-red),
        0 0 30px var(--primary-red),
        0 0 40px var(--primary-red);
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
    will-change: contents;
    transition: font-size 0.3s ease;
}

/* flicker 애니메이션 제거 - 깜빡임 방지 */

/* timer-label 제거됨 */

.timer-separator {
    font-size: calc(3rem * var(--font-scale));
    color: var(--primary-red);
    opacity: 0.7;
    animation: blink 2s infinite;
    margin: 0 2px;
    flex-shrink: 0;
    transition: font-size 0.3s ease;
}

@keyframes blink {
    0%, 49%, 100% { opacity: 0.7; }
    50%, 99% { opacity: 0.3; }
}

/* 밀리초 세그먼트 스타일 */
#milliseconds {
    font-size: calc(2.5rem * var(--font-scale));
    opacity: 0.8;
    transition: font-size 0.3s ease;
}

/* milliseconds label 제거됨 */

/* 프로그레스 바 */
.progress-container {
    width: 50%;
    margin: 0 auto 40px;
    padding: 0 20px;
}

.progress-bar-wrapper {
    width: 100%;
    height: 20px;
    background: rgba(255, 0, 0, 0.1);
    border: 2px solid rgba(255, 0, 0, 0.3);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, 
        var(--primary-red) 0%, 
        #ff3333 50%, 
        var(--primary-red) 100%);
    border-radius: 8px;
    transition: width 0.5s ease;
    box-shadow: 
        0 0 10px var(--primary-red),
        0 0 20px var(--primary-red),
        inset 0 0 10px rgba(255, 255, 255, 0.2);
    position: relative;
    animation: progressGlow 2s ease-in-out infinite;
}

@keyframes progressGlow {
    0%, 100% {
        box-shadow: 
            0 0 10px var(--primary-red),
            0 0 20px var(--primary-red),
            inset 0 0 10px rgba(255, 255, 255, 0.2);
    }
    50% {
        box-shadow: 
            0 0 15px var(--primary-red),
            0 0 30px var(--primary-red),
            0 0 40px var(--primary-red),
            inset 0 0 15px rgba(255, 255, 255, 0.3);
    }
}

.progress-percentage {
    text-align: center;
    margin-top: 10px;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-red);
    font-family: 'Courier New', monospace;
    text-shadow: 
        0 0 10px var(--primary-red),
        0 0 20px var(--primary-red);
    letter-spacing: 2px;
}

/* 생명 정보 - 제거됨 */
.life-info {
    display: none;
}

/* 명언 - 제거됨 */
.quote {
    display: none;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .container {
        padding: 30px 20px;
    }
    
    .app-logo {
        width: 100px;
        height: 100px;
    }
    
    .title {
        font-size: 1.8rem;
    }
    
    .input-icon {
        font-size: 1.5rem;
        min-width: 30px;
    }
    
    .btn-icon {
        font-size: 2rem;
    }
    
    .timer-title {
        font-size: 1rem;
        letter-spacing: 2px;
    }
    
    .progress-container {
        padding: 0 10px;
    }
    
    .progress-bar-wrapper {
        height: 16px;
    }
    
    .progress-percentage {
        font-size: 1.2rem;
        margin-top: 8px;
    }
    
    .footer-info .version {
        font-size: 0.7rem;
    }
    
    .credits {
        font-size: 0.6rem;
    }
    
    .timer-display {
        gap: 3px;
    }
    
    .timer-segment {
        min-width: auto;
    }
    
    .timer-value {
        font-size: calc(2.5rem * var(--font-scale));
    }
    
    #milliseconds {
        font-size: calc(1.8rem * var(--font-scale));
    }
    
    .timer-separator {
        font-size: calc(2rem * var(--font-scale));
        margin: 0 1px;
    }
    
    .timer-label {
        font-size: 0.6rem;
    }
    
    /* life-info, quote 제거됨 */
}

@media (max-width: 480px) {
    .timer-display {
        gap: 2px;
    }
    
    .timer-value {
        font-size: calc(2rem * var(--font-scale));
    }
    
    #milliseconds {
        font-size: calc(1.4rem * var(--font-scale));
    }
    
    .timer-separator {
        font-size: calc(1.5rem * var(--font-scale));
        margin: 0;
    }
    
    .header-right {
        gap: 10px;
    }
}

@media (max-width: 360px) {
    .timer-display {
        gap: 1px;
    }
    
    .timer-value {
        font-size: calc(1.7rem * var(--font-scale));
    }
    
    #milliseconds {
        font-size: calc(1.2rem * var(--font-scale));
    }
    
    .timer-separator {
        font-size: calc(1.3rem * var(--font-scale));
        margin: 0;
    }
    
    .timer-title {
        font-size: 0.9rem;
        letter-spacing: 1px;
    }
}

/* 편집 모달 */
.edit-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.edit-modal .modal-content {
    background: rgba(20, 20, 20, 0.95);
    border: 2px solid var(--primary-red);
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    padding: 40px;
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.edit-modal .modal-header {
    text-align: center;
    margin-bottom: 30px;
}

.edit-modal .modal-header h2 {
    color: var(--primary-red);
    margin: 0;
    display: flex;
    justify-content: center;
    filter: drop-shadow(0 0 10px var(--primary-red));
}

.edit-modal .modal-header h2 svg {
    width: 36px;
    height: 36px;
}

.modal-form .form-group {
    margin-bottom: 25px;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.btn-save,
.btn-cancel {
    flex: 1;
    padding: 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-save svg,
.btn-cancel svg {
    width: 32px;
    height: 32px;
}

.btn-save {
    background: var(--primary-red);
    color: var(--text-white);
}

.btn-save:hover {
    background: var(--dark-red);
    transform: scale(1.1);
}

.btn-cancel {
    background: rgba(255, 0, 0, 0.2);
    border: 1px solid var(--primary-red);
    color: var(--text-white);
}

.btn-cancel:hover {
    background: rgba(255, 0, 0, 0.3);
    border-color: var(--text-white);
    transform: scale(1.1);
}

/* 변경사항 모달 */
.changelog-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: rgba(20, 20, 20, 0.95);
    border: 2px solid var(--primary-red);
    border-radius: 10px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 0 30px var(--glow-color);
    animation: slideUp 0.3s ease;
}

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

.modal-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 0, 0, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: var(--primary-red);
    font-size: 1.5rem;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-gray);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-close:hover {
    color: var(--primary-red);
    transform: rotate(90deg);
}

.modal-body {
    padding: 20px;
    max-height: 50vh;
    overflow-y: auto;
    color: var(--text-white);
}

.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--primary-red);
    border-radius: 4px;
}

.changelog-item {
    margin-bottom: 30px;
}

.changelog-item h3 {
    color: var(--primary-red);
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.changelog-date {
    color: var(--text-gray);
    font-size: 0.9rem;
    font-weight: normal;
}

.changelog-item ul {
    list-style: none;
    padding-left: 0;
}

.changelog-item li {
    padding: 8px 0 8px 25px;
    position: relative;
    color: var(--text-white);
    line-height: 1.6;
}

.changelog-item li:before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--primary-red);
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 0, 0, 0.3);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-update,
.btn-cancel {
    padding: 10px 20px;
    border-radius: 5px;
    font-family: monospace;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-update {
    background: var(--primary-red);
    border: none;
    color: var(--text-white);
}

.btn-update:hover {
    background: var(--dark-red);
    box-shadow: 0 0 20px var(--glow-color);
}

.btn-cancel {
    background: transparent;
    border: 1px solid var(--text-gray);
    color: var(--text-gray);
}

.btn-cancel:hover {
    border-color: var(--primary-red);
    color: var(--primary-red);
}

/* 폰트 크기 조절 슬라이더 */
.font-size-control {
    padding: 20px;
    background: rgba(255, 0, 0, 0.05);
    border: 1px solid rgba(255, 0, 0, 0.3);
    border-radius: 8px;
    margin-top: 10px;
}

.font-size-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
    color: var(--primary-red);
    font-size: 1.1rem;
    font-weight: bold;
}

.font-size-label svg {
    filter: drop-shadow(0 0 5px var(--primary-red));
}

.font-size-slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 0, 0, 0.2);
    border-radius: 5px;
    outline: none;
    cursor: pointer;
    margin-bottom: 10px;
}

.font-size-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: var(--primary-red);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px var(--primary-red), 0 0 20px var(--primary-red);
    transition: all 0.3s ease;
}

.font-size-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 15px var(--primary-red), 0 0 30px var(--primary-red);
}

.font-size-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: var(--primary-red);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px var(--primary-red), 0 0 20px var(--primary-red);
    transition: all 0.3s ease;
}

.font-size-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 15px var(--primary-red), 0 0 30px var(--primary-red);
}

.font-size-markers {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-gray);
    padding: 0 5px;
}

.font-size-markers span {
    opacity: 0.6;
}
