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

:root {
    --primary-color: #4a90e2;
    --secondary-color: #50c878;
    --danger-color: #e74c3c;
    --text-color: #333;
    --bg-color: #f5f7fa;
    --card-bg: #ffffff;
    --border-color: #e1e8ed;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.15);
    --theme-primary: #667eea;
    --theme-secondary: #764ba2;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-secondary) 100%);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    padding: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--bg-color);
    box-shadow: var(--shadow-hover);
    overflow: hidden;
    position: relative;
}

header {
    background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-secondary) 100%);
    color: white;
    padding: 30px 20px;
    text-align: center;
    margin: 0;
    position: relative;
}

.header-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.header-controls .btn {
    width: auto;
    padding: 8px 20px;
    font-size: 0.9em;
}

.header-controls #darkModeBtn {
    background: #ff8c42;
    color: white;
    border: 2px solid #ff6b1a;
}

.header-controls #darkModeBtn:hover {
    background: #ff6b1a;
    border-color: #ff8c42;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 140, 66, 0.4);
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.95;
    margin-bottom: 15px;
}

.theme-selector {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.theme-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.theme-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.theme-btn.active {
    background: rgba(255, 255, 255, 0.4);
    border-color: white;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.daily-quote {
    margin-top: 15px;
    font-style: italic;
    opacity: 0.9;
    font-size: 0.95em;
}

main {
    padding: 30px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

section {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

section:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

section h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.5em;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
}

.input-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

.input-group input,
.input-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    font-family: inherit;
}

.input-group input:focus,
.input-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: #357abd;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.4);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
    margin: 5px;
    flex: 1;
    min-width: 120px;
}

.btn-secondary:hover {
    background: #45b869;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(80, 200, 120, 0.4);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
    padding: 8px 15px;
    font-size: 0.9em;
}

.btn-danger:hover {
    background: #c0392b;
}

.result-box {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
    display: none;
}

.result-box.show {
    display: block;
    animation: slideIn 0.5s ease;
}

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

.result-box h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.3em;
}

.result-box .dday-number {
    font-size: 2.5em;
    font-weight: bold;
    color: var(--primary-color);
    margin: 10px 0;
}

.result-box .dday-text {
    font-size: 1.2em;
    color: var(--text-color);
}

.detailed-time {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.time-item {
    text-align: center;
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    min-width: 80px;
    transition: transform 0.3s ease;
}

.time-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.time-value {
    display: block;
    font-size: 2em;
    font-weight: bold;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.number-animate {
    display: inline-block;
}

.number-rolling {
    animation: numberRoll 0.8s ease-out;
}

.number-pulse {
    animation: numberPulse 0.3s ease;
}

@keyframes numberRoll {
    0% {
        transform: translateY(-20px) rotateX(90deg);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateY(0) rotateX(0deg);
        opacity: 1;
    }
}

@keyframes numberPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
        color: var(--secondary-color);
    }
}

.time-label {
    display: block;
    font-size: 0.9em;
    color: #666;
    margin-top: 5px;
}

.animate-count {
    animation: countPulse 0.5s ease;
}

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

.share-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.share-btn {
    background: #6c757d;
    color: white;
    padding: 8px 15px;
    font-size: 0.9em;
    flex: 1;
    min-width: 120px;
}

.share-btn:hover {
    background: #5a6268;
}

.quick-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.memo-section textarea {
    resize: vertical;
    min-height: 100px;
}

.memo-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.memo-actions .btn {
    flex: 1;
}

.memos-list {
    display: grid;
    gap: 15px;
    margin-top: 20px;
}

.memo-item {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid var(--secondary-color);
}

.memo-date {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 8px;
}

.memo-text {
    color: var(--text-color);
    line-height: 1.6;
}

.memo-actions-inline {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.memo-actions-inline .btn {
    flex: 1;
    min-width: 80px;
    padding: 5px 10px;
    font-size: 0.85em;
}

.widget-section {
    grid-column: span 1;
}

.widget-result {
    margin-top: 20px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 10px;
    display: none;
}

.widget-result.show {
    display: block;
}

.widget-preview,
.widget-code {
    margin-bottom: 20px;
}

.widget-code textarea {
    font-size: 0.9em;
    resize: vertical;
}

.ad-container {
    margin: 20px auto;
    text-align: center;
    padding: 10px;
}

.ad-top {
    margin-top: 0;
}

.ad-bottom {
    margin-bottom: 20px;
}


footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 30px;
}

footer p {
    margin: 5px 0;
    font-size: 0.9em;
}

footer p:first-child {
    margin-top: 0;
}

footer p:last-child {
    margin-bottom: 0;
}

.footer-email {
    color: #4ade80;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.footer-email:hover {
    color: #22c55e;
    text-decoration: underline;
    transform: translateY(-1px);
}

/* 반응형 디자인 */
@media (min-width: 768px) {
    main {
        grid-template-columns: 1fr 1fr;
    }
    
    .calculator-section {
        grid-column: span 1;
    }
    
    .quick-calc-section,
    .memo-section,
    .widget-section {
        grid-column: span 2;
    }
}

@media (min-width: 1024px) {
    main {
        grid-template-columns: 1fr 1fr;
    }
    
    header h1 {
        font-size: 3em;
    }
    
    .quick-buttons {
        justify-content: center;
    }
    
    .btn-secondary {
        flex: 0 1 auto;
    }
    
    .share-buttons {
        justify-content: center;
    }
}

@media (max-width: 767px) {
    header {
        padding: 20px 15px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .quick-buttons {
        flex-direction: column;
    }
    
    .btn-secondary {
        width: 100%;
        margin: 5px 0;
    }
    
    .share-buttons {
        flex-direction: column;
    }
    
    .share-btn {
        width: 100%;
        min-height: 44px;
        padding: 10px 15px;
        white-space: normal;
        line-height: 1.4;
    }
    
    .countdown-share-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .countdown-share-buttons .share-btn {
        width: 100%;
        min-width: auto;
        min-height: 48px;
        padding: 12px 15px;
        font-size: 0.9em;
        white-space: normal;
        line-height: 1.4;
    }
    
    .detailed-time {
        gap: 10px;
    }
    
    .time-item {
        min-width: 70px;
        padding: 10px 15px;
    }
    
    .time-value {
        font-size: 1.5em;
    }
}

/* 로딩 애니메이션 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(74, 144, 226, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

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

/* 서버 시계 스타일 */
.server-time-section {
    grid-column: span 2;
    text-align: center;
}

.server-time-display {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 40px 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.time-main {
    font-size: 4em;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    letter-spacing: 5px;
}

.time-hours, .time-minutes, .time-seconds {
    color: #4ade80;
}

.time-milliseconds {
    color: #fbbf24;
    font-size: 0.6em;
}

.time-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.1em;
    margin-bottom: 10px;
}

.status-indicator {
    font-size: 1.2em;
    animation: pulse 2s ease-in-out infinite;
}

.status-indicator.synced {
    color: #4ade80;
}

.status-indicator.syncing {
    color: #fbbf24;
    animation: spin 1s linear infinite;
}

.status-indicator.error {
    color: #ef4444;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.time-offset {
    font-size: 0.9em;
    opacity: 0.9;
    color: #cbd5e1;
}

.time-selector-wrapper {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.time-selector-label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95em;
}

.time-selector {
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    background: var(--card-bg);
    color: var(--text-color);
    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    min-width: 200px;
}

.time-selector:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.server-time-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.server-time-controls .btn {
    width: auto;
    min-width: 150px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 플랫폼 시간 비교 */
.platform-time-section {
    grid-column: span 2;
}

.platform-list {
    display: grid;
    gap: 15px;
}

.platform-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.platform-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.platform-name {
    font-weight: bold;
    font-size: 1.2em;
    color: var(--text-color);
    min-width: 100px;
}

.platform-time {
    font-family: 'Courier New', monospace;
    font-size: 1.5em;
    font-weight: bold;
    color: var(--primary-color);
    flex: 1;
    text-align: center;
}

.platform-offset {
    font-size: 0.9em;
    color: #666;
    min-width: 80px;
    text-align: right;
}

.platform-offset.positive {
    color: #ef4444;
}

.platform-offset.negative {
    color: #4ade80;
}

.platform-offset.default {
    opacity: 0.7;
    font-style: italic;
}

.platform-offset.measured {
    font-weight: 600;
}

/* 카운트다운 스타일 */
.countdown-section {
    grid-column: span 2;
}

.countdown-display {
    margin-top: 30px;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    text-align: center;
    color: white;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.countdown-main {
    font-size: 5em;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    letter-spacing: 5px;
    color: #4ade80;
}

.countdown-main.warning {
    color: #fbbf24;
    animation: pulse 1s ease-in-out infinite;
}

.countdown-main.danger {
    color: #ef4444;
    animation: pulse 0.5s ease-in-out infinite;
}

.countdown-label {
    font-size: 1.2em;
    opacity: 0.9;
}

.countdown-share-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.countdown-share-buttons .share-btn {
    min-width: 150px;
    min-height: 44px;
    height: auto;
    padding: 10px 15px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 정확도 측정 */
.accuracy-section {
    grid-column: span 2;
}

.accuracy-section .btn {
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.accuracy-info {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.accuracy-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.accuracy-item:last-child {
    border-bottom: none;
}

.accuracy-label {
    font-weight: 600;
    color: var(--text-color);
}

.accuracy-value {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1.1em;
}

.accuracy-value.good {
    color: #4ade80;
}

.accuracy-value.warning {
    color: #fbbf24;
}

.accuracy-value.bad {
    color: #ef4444;
}

/* 체크리스트 */
.checklist-section {
    grid-column: span 2;
}

.checklist-items {
    display: grid;
    gap: 15px;
}

.checklist-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.checklist-item:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.checklist-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 15px;
    cursor: pointer;
}

.checklist-item input[type="checkbox"]:checked + span {
    text-decoration: line-through;
    opacity: 0.7;
}

.checklist-item:has(input[type="checkbox"]:checked) {
    border-left-color: var(--secondary-color);
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
}

/* 체크리스트 완료 메시지 */
.checklist-complete-message {
    margin-top: 25px;
    padding: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.5s ease;
}

.checklist-complete-message.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
    animation: bounceIn 0.6s ease;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(-10px);
    }
    50% {
        transform: scale(1.05) translateY(0);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.complete-message-text {
    font-size: 1.5em;
    font-weight: bold;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    line-height: 1.5;
}

/* 암전 모드 */
body.dark-mode {
    background: #000;
    color: #fff;
}

body.dark-mode .container {
    background: #000;
}

body.dark-mode header {
    background: #000;
    color: #fff;
}

body.dark-mode header h1 {
    color: #fff;
}

body.dark-mode .subtitle {
    color: #e0e0e0;
}

body.dark-mode section {
    background: #0a0a0a;
    color: #fff;
    border-color: #333;
}

body.dark-mode section h2 {
    color: #fff;
    border-color: #333;
}

body.dark-mode .server-time-display {
    background: linear-gradient(135deg, #000 0%, #0a0a0a 100%);
    border: 2px solid #4ade80;
}

body.dark-mode .time-main {
    color: #4ade80;
    text-shadow: 0 0 20px #4ade80;
}

body.dark-mode .countdown-display {
    background: linear-gradient(135deg, #000 0%, #0a0a0a 100%);
    border: 2px solid #4ade80;
}

body.dark-mode .countdown-main {
    color: #4ade80;
    text-shadow: 0 0 20px #4ade80;
}

body.dark-mode .countdown-label {
    color: #e0e0e0;
}

body.dark-mode .platform-item,
body.dark-mode .accuracy-info {
    background: #0a0a0a;
    border-color: #333;
    color: #fff;
}

body.dark-mode .checklist-item {
    background: #000000;
    border-color: #1a1a1a;
    color: #fff;
}

body.dark-mode .platform-name {
    color: #fff;
}

body.dark-mode .platform-time {
    color: #4ade80;
}

body.dark-mode .platform-offset {
    color: #e0e0e0;
}

body.dark-mode .platform-offset.positive {
    color: #ff6b6b;
}

body.dark-mode .platform-offset.negative {
    color: #4ade80;
}

body.dark-mode .input-group label {
    color: #fff;
}

body.dark-mode .input-group input,
body.dark-mode .input-group textarea {
    background: #0a0a0a;
    border-color: #444;
    color: #fff;
}

body.dark-mode .input-group input:focus,
body.dark-mode .input-group textarea:focus {
    border-color: #4ade80;
    background: #111;
}

body.dark-mode .time-selector-label {
    color: #fff;
}

body.dark-mode .time-selector {
    background: #0a0a0a;
    border-color: #444;
    color: #fff;
}

body.dark-mode .time-selector:focus {
    border-color: #4ade80;
    background: #111;
}

body.dark-mode .time-selector option {
    background: #0a0a0a;
    color: #fff;
}

body.dark-mode .accuracy-label {
    color: #fff;
}

body.dark-mode .accuracy-value {
    color: #e0e0e0;
}

body.dark-mode .checklist-item {
    color: #fff;
    background: #000000;
    border-left-color: #1a1a1a;
}

body.dark-mode .checklist-item:hover {
    background: #0a0a0a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

body.dark-mode .checklist-item:has(input[type="checkbox"]:checked) {
    background: #0d1b0d;
    border-left-color: #4ade80;
}

body.dark-mode .checklist-item span {
    color: #fff;
}

body.dark-mode .checklist-complete-message {
    color: #fff;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid #2a2a3e;
}

body.dark-mode .complete-message-text {
    color: #4ade80;
}

body.dark-mode .btn-primary {
    background: #4ade80;
    color: #000;
}

body.dark-mode .btn-primary:hover {
    background: #5ef08f;
    color: #000;
}

body.dark-mode .btn-secondary {
    background: #333;
    color: #fff;
}

body.dark-mode .btn-secondary:hover {
    background: #444;
    color: #fff;
}

body.dark-mode .header-controls .btn {
    background: #333;
    color: #fff;
}

body.dark-mode .header-controls .btn:hover {
    background: #444;
    color: #fff;
}

body.dark-mode footer {
    background: #000;
    color: #e0e0e0;
}

body.dark-mode footer a {
    color: #4ade80;
}

body.dark-mode footer a:hover {
    color: #5ef08f;
}

/* 전체화면 모드 */
body.fullscreen-mode {
    overflow: hidden;
}

body.fullscreen-mode .container {
    max-width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

body.fullscreen-mode header {
    flex-shrink: 0;
}

body.fullscreen-mode main {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

body.fullscreen-mode .server-time-section {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: #000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0;
    padding: 0;
    border-radius: 0 !important;
}

body.fullscreen-mode .server-time-section h2 {
    color: #fff;
    margin-bottom: 20px;
}

body.fullscreen-mode .time-selector-wrapper {
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
}

body.fullscreen-mode .time-selector-label {
    color: #fff;
    font-size: 1em;
    white-space: nowrap;
}

body.fullscreen-mode .time-selector {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
    padding: 12px 18px;
    font-size: 1em;
    min-width: 200px;
}

body.fullscreen-mode .time-selector:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
}

body.fullscreen-mode .time-selector:focus {
    background: rgba(255, 255, 255, 0.2);
    border-color: #4ade80;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.2);
}

body.fullscreen-mode .time-selector option {
    background: #1a1a1a;
    color: #fff;
}

body.fullscreen-mode .server-time-controls {
    display: none;
}

body.fullscreen-mode .sync-btn-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    font-size: 1em;
    min-width: auto;
    width: auto;
    height: auto;
    background: rgba(74, 222, 128, 0.2);
    border: 1px solid rgba(74, 222, 128, 0.4);
    color: #4ade80;
    border-radius: 8px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    cursor: pointer;
    font-weight: 600;
}

body.fullscreen-mode .sync-btn-inline:hover {
    background: rgba(74, 222, 128, 0.3);
    border-color: rgba(74, 222, 128, 0.6);
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.4);
    color: #5ef08f;
}

body.fullscreen-mode .sync-btn-inline:active {
    transform: scale(0.95);
}

body.fullscreen-mode .server-time-display {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 0 !important;
    margin: 0;
}

body.fullscreen-mode .time-main {
    font-size: 8em;
}

/* 위젯 모드 - 일반 모드 */
body.widget-mode {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 420px;
    height: 320px;
    z-index: 10000;
    background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
    border: 2px solid rgba(74, 144, 226, 0.3);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), 
                0 0 0 1px rgba(74, 144, 226, 0.1) inset,
                0 0 40px rgba(74, 144, 226, 0.1);
    backdrop-filter: blur(20px);
    overflow: hidden;
    resize: both;
    min-width: 320px;
    min-height: 240px;
}

/* 위젯 모드 - 암전 모드 */
body.dark-mode.widget-mode {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    border: 2px solid rgba(74, 222, 128, 0.4);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 
                0 0 0 1px rgba(74, 222, 128, 0.2) inset,
                0 0 40px rgba(74, 222, 128, 0.15);
}

body.widget-mode .container {
    width: 100%;
    height: 100%;
    max-width: 100%;
    margin: 0;
    box-shadow: none;
}

/* 위젯 모드 헤더 - 일반 모드 */
body.widget-mode header {
    padding: 12px 15px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.5);
    border-bottom: 1px solid rgba(74, 144, 226, 0.2);
}

body.widget-mode header h1 {
    font-size: 1.1em;
    margin-bottom: 4px;
    color: #1a1a1a;
    font-weight: 600;
    letter-spacing: -0.5px;
}

body.widget-mode .subtitle {
    font-size: 0.7em;
    margin-bottom: 0;
    color: rgba(0, 0, 0, 0.6);
}

body.widget-mode .header-controls {
    margin-top: 8px;
    gap: 6px;
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
}

body.widget-mode .header-controls .btn {
    padding: 6px 10px;
    font-size: 0.7em;
    background: rgba(74, 144, 226, 0.1);
    border: 1px solid rgba(74, 144, 226, 0.3);
    color: #4a90e2;
    font-weight: 600;
    flex: 0 0 auto;
    white-space: nowrap;
}

body.widget-mode .header-controls .btn:hover {
    background: rgba(74, 144, 226, 0.2);
    border-color: rgba(74, 144, 226, 0.5);
    color: #357abd;
}

/* 위젯 모드에서 전체화면 버튼 숨김 */
body.widget-mode #fullscreenBtn {
    display: none !important;
}

/* 위젯 모드 헤더 - 암전 모드 */
body.dark-mode.widget-mode header {
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid rgba(74, 222, 128, 0.2);
}

body.dark-mode.widget-mode header h1 {
    color: #fff;
}

body.dark-mode.widget-mode .subtitle {
    color: rgba(255, 255, 255, 0.7);
}

body.dark-mode.widget-mode .header-controls .btn {
    background: rgba(74, 222, 128, 0.15);
    border: 1px solid rgba(74, 222, 128, 0.4);
    color: #4ade80;
}

body.dark-mode.widget-mode .header-controls .btn:hover {
    background: rgba(74, 222, 128, 0.25);
    border-color: rgba(74, 222, 128, 0.6);
    color: #5ef08f;
}

body.widget-mode main {
    padding: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

body.widget-mode .server-time-section {
    flex: 1;
    margin: 0;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: transparent;
}

/* 위젯 모드 섹션 제목 - 일반 모드 */
body.widget-mode .server-time-section h2 {
    font-size: 0.9em;
    margin-bottom: 12px;
    color: rgba(0, 0, 0, 0.7);
    border: none;
    padding: 0;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* 위젯 모드 섹션 제목 - 암전 모드 */
body.dark-mode.widget-mode .server-time-section h2 {
    color: rgba(255, 255, 255, 0.8);
}

body.widget-mode .server-time-display {
    padding: 0;
    margin: 0;
    border-radius: 0;
    background: transparent;
    border: none;
}

body.widget-mode .time-main {
    font-size: 2.8em;
    letter-spacing: 0;
    line-height: 1.2;
    font-weight: 600;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #4a90e2;
}

/* 위젯 모드 시간 - 일반 모드 */
body.widget-mode .time-hours,
body.widget-mode .time-minutes,
body.widget-mode .time-seconds {
    display: inline-block;
    color: #4a90e2;
    text-shadow: 0 0 10px rgba(74, 144, 226, 0.3);
}

body.widget-mode .time-milliseconds {
    font-size: 0.4em;
    color: rgba(74, 144, 226, 0.7);
    margin-left: 2px;
    display: inline-block;
}

/* 위젯 모드 시간 - 암전 모드 */
body.dark-mode.widget-mode .time-main {
    color: #4ade80;
}

body.dark-mode.widget-mode .time-hours,
body.dark-mode.widget-mode .time-minutes,
body.dark-mode.widget-mode .time-seconds {
    color: #4ade80;
    text-shadow: 0 0 15px rgba(74, 222, 128, 0.5);
}

body.dark-mode.widget-mode .time-milliseconds {
    color: rgba(74, 222, 128, 0.8);
}

body.widget-mode .time-status {
    font-size: 0.9em;
    margin-bottom: 5px;
}

body.widget-mode .time-offset {
    font-size: 0.8em;
}

body.widget-mode .server-time-controls.widget-hidden {
    display: none;
}

body.widget-mode .time-selector-wrapper {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

/* 위젯 모드 셀렉터 - 일반 모드 */
body.widget-mode .time-selector-label {
    font-size: 0.75em;
    color: rgba(0, 0, 0, 0.7);
    white-space: nowrap;
    font-weight: 600;
}

body.widget-mode .time-selector {
    flex: 1;
    padding: 8px 12px;
    font-size: 0.85em;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(74, 144, 226, 0.3);
    border-radius: 8px;
    color: #1a1a1a;
    min-width: 0;
    font-weight: 500;
}

body.widget-mode .time-selector:focus {
    outline: none;
    border-color: rgba(74, 144, 226, 0.6);
    background: #fff;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

body.widget-mode .time-selector option {
    background: #fff;
    color: #1a1a1a;
}

/* 위젯 모드 셀렉터 - 암전 모드 */
body.dark-mode.widget-mode .time-selector-label {
    color: rgba(255, 255, 255, 0.8);
}

body.dark-mode.widget-mode .time-selector {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(74, 222, 128, 0.3);
    color: #fff;
}

body.dark-mode.widget-mode .time-selector:focus {
    border-color: rgba(74, 222, 128, 0.6);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.2);
}

body.dark-mode.widget-mode .time-selector option {
    background: #1a1a1a;
    color: #fff;
}

/* 일반 모드에서 인라인 버튼 숨김 */
.sync-btn-inline {
    display: none;
}

/* 위젯 모드 동기화 버튼 - 일반 모드 */
body.widget-mode .sync-btn-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    font-size: 0.9em;
    min-width: auto;
    width: auto;
    height: auto;
    background: rgba(74, 144, 226, 0.15);
    border: 1px solid rgba(74, 144, 226, 0.4);
    color: #4a90e2;
    border-radius: 8px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    cursor: pointer;
    font-weight: 600;
}

body.widget-mode .sync-btn-inline:hover {
    background: rgba(74, 144, 226, 0.25);
    border-color: rgba(74, 144, 226, 0.6);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(74, 144, 226, 0.3);
    color: #357abd;
}

body.widget-mode .sync-btn-inline:active {
    transform: scale(0.95);
}

/* 위젯 모드 동기화 버튼 - 암전 모드 */
body.dark-mode.widget-mode .sync-btn-inline {
    background: rgba(74, 222, 128, 0.2);
    border: 1px solid rgba(74, 222, 128, 0.4);
    color: #4ade80;
}

body.dark-mode.widget-mode .sync-btn-inline:hover {
    background: rgba(74, 222, 128, 0.3);
    border-color: rgba(74, 222, 128, 0.6);
    box-shadow: 0 0 15px rgba(74, 222, 128, 0.4);
    color: #5ef08f;
}

body.widget-mode section:not(.server-time-section) {
    display: none;
}

body.widget-mode footer {
    display: none;
}

body.widget-mode .ad-container {
    display: none;
}

/* 반응형 디자인 업데이트 */
@media (max-width: 767px) {
    .container {
        margin: 0;
        border-radius: 0;
    }
    
    header {
        padding: 15px 10px;
    }
    
    header h1 {
        font-size: 1.8em;
    }
    
    .subtitle {
        font-size: 0.95em;
    }
    
    main {
        padding: 15px;
        gap: 20px;
    }
    
    section {
        padding: 20px 15px;
        border-radius: 10px;
    }
    
    /* 서버 시계 모바일 최적화 */
    .server-time-display {
        padding: 25px 15px;
    }
    
    .time-main {
        font-size: 2.2em;
        letter-spacing: 1px;
    }
    
    .time-hours, .time-minutes, .time-seconds {
        font-size: 1em;
    }
    
    .time-milliseconds {
        font-size: 0.5em;
    }
    
    .time-status {
        font-size: 0.95em;
    }
    
    .time-offset {
        font-size: 0.85em;
    }
    
    .server-time-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .server-time-controls .btn {
        width: 100%;
        min-width: auto;
        padding: 12px;
        font-size: 0.95em;
    }
    
    /* 플랫폼 시간 비교 모바일 */
    .platform-item {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        padding: 15px;
    }
    
    .platform-name {
        min-width: auto;
        font-size: 1.1em;
    }
    
    .platform-time {
        font-size: 1.3em;
        width: 100%;
    }
    
    .platform-offset {
        min-width: auto;
        text-align: center;
        font-size: 0.9em;
    }
    
    /* 카운트다운 모바일 */
    .countdown-display {
        padding: 20px 15px;
        min-height: 150px;
    }
    
    .countdown-main {
        font-size: 2.2em;
        letter-spacing: 1px;
    }
    
    .countdown-label {
        font-size: 1em;
    }
    
    /* 정확도 측정 모바일 */
    .accuracy-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
        padding: 12px 0;
    }
    
    .accuracy-label {
        font-size: 0.9em;
    }
    
    .accuracy-value {
        font-size: 1em;
    }
    
    /* 체크리스트 모바일 */
    .checklist-item {
        padding: 12px;
        font-size: 0.95em;
    }
    
    .checklist-complete-message {
        padding: 20px 15px;
        margin-top: 20px;
    }
    
    .complete-message-text {
        font-size: 1.2em;
    }
    
    /* 헤더 컨트롤 모바일 */
    .header-controls {
        flex-direction: column;
        gap: 8px;
        margin-top: 10px;
    }
    
    .header-controls .btn {
        width: 100%;
        padding: 10px;
        font-size: 0.9em;
    }
    
    /* 전체화면 모드 모바일 */
    body.fullscreen-mode .time-main {
        font-size: 4em;
        letter-spacing: 2px;
    }
    
    body.fullscreen-mode .time-status {
        font-size: 1em;
    }
    
    body.fullscreen-mode .time-offset {
        font-size: 0.9em;
    }
    
    /* 위젯 모드 모바일 */
    body.widget-mode {
        width: 100%;
        height: 100%;
        top: 0;
        right: 0;
        left: 0;
        bottom: 0;
        min-width: 100%;
        min-height: 100%;
        resize: none;
    }
    
    body.widget-mode .time-main {
        font-size: 2em;
    }
    
    /* 시간 선택기 모바일 */
    .time-selector-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    
    .time-selector-label {
        text-align: center;
    }
    
    .time-selector {
        width: 100%;
        min-width: auto;
    }
    
    /* 입력 필드 모바일 */
    .input-group input,
    .input-group textarea {
        font-size: 16px; /* iOS 줌 방지 */
        padding: 14px 15px;
    }
    
    /* 버튼 모바일 */
    .btn {
        padding: 14px 20px;
        font-size: 1em;
        min-height: 44px; /* 터치 친화적 */
    }
    
    .btn-primary {
        width: 100%;
    }
}

/* 작은 모바일 (480px 이하) */
@media (max-width: 480px) {
    header h1 {
        font-size: 1.5em;
    }
    
    .countdown-share-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .countdown-share-buttons .share-btn {
        width: 100%;
        min-width: auto;
        min-height: 48px;
        padding: 12px 15px;
        font-size: 0.9em;
        white-space: normal;
        line-height: 1.4;
    }
    
    .subtitle {
        font-size: 0.85em;
    }
    
    .time-main {
        font-size: 1.8em;
        letter-spacing: 0;
    }
    
    .countdown-main {
        font-size: 1.8em;
        letter-spacing: 0;
    }
    
    body.fullscreen-mode .time-main {
        font-size: 3em;
    }
    
    .server-time-display {
        padding: 20px 10px;
    }
    
    .platform-time {
        font-size: 1.1em;
    }
    
    section {
        padding: 15px 10px;
    }
}

/* 가로 모드 모바일 */
@media (max-width: 767px) and (orientation: landscape) {
    .time-main {
        font-size: 2em;
    }
    
    .countdown-main {
        font-size: 2em;
    }
    
    body.fullscreen-mode .time-main {
        font-size: 3.5em;
    }
    
    header {
        padding: 10px 15px;
    }
    
    header h1 {
        font-size: 1.5em;
    }
}
