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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    transition: background 0.3s ease, color 0.3s ease;
}

/* ダークモードスタイル */
body.dark-mode {
    background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1e 100%);
    color: #e2e8f0;
}

body.dark-mode .container {
    background: rgba(30, 30, 45, 0.95);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

body.dark-mode .status {
    color: #e2e8f0;
}

body.dark-mode .status.working {
    color: #cbd5e1;
}

body.dark-mode .status.break {
    color: #f87171;
}

body.dark-mode .status.paused {
    color: #fbbf24;
}

body.dark-mode .timer-display {
    color: #e2e8f0;
}

body.dark-mode .hidden-timer {
    color: #94a3b8;
}

body.dark-mode .btn {
    background: #3b82f6;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

body.dark-mode .btn:hover {
    background: #2563eb;
}

body.dark-mode .btn.pause {
    background: #10b981;
}

body.dark-mode .btn.pause:hover {
    background: #34d399;
}


body.dark-mode .hamburger-menu {
    background: rgba(30, 30, 45, 0.9);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

body.dark-mode .hamburger-menu:hover {
    background: rgba(45, 45, 60, 0.95);
}

body.dark-mode .hamburger-menu span {
    background: #e2e8f0;
}

body.dark-mode .hamburger-menu.disabled {
    opacity: 0.3;
}

body.dark-mode .hamburger-menu.disabled span {
    background: #6b7280;
}

body.dark-mode .side-menu {
    background: #1e1e2e;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.5);
}

body.dark-mode .side-menu-header {
    border-bottom: 1px solid #374151;
}

body.dark-mode .side-menu-header h3 {
    color: #e2e8f0;
}

body.dark-mode .setting-group label {
    color: #cbd5e1;
}

body.dark-mode .setting-group input[type="number"] {
    background: #374151;
    border: 2px solid #4b5563;
    color: #e2e8f0;
}

body.dark-mode .setting-group select {
    background: #374151;
    border: 2px solid #4b5563;
    color: #e2e8f0;
}

body.dark-mode .sound-setting-label {
    color: #cbd5e1;
}

body.dark-mode .sound-selector select {
    background: #374151;
    border: 2px solid #4b5563;
    color: #e2e8f0;
}

body.dark-mode .test-sound-btn {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border-color: #2563eb;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

body.dark-mode .test-sound-btn:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    border-color: #1d4ed8;
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

body.dark-mode .setting-divider {
    background: #374151;
}

body.dark-mode .volume-control input[type="range"] {
    background: #374151;
}

body.dark-mode #volume-value {
    color: #94a3b8;
}

body.dark-mode .feedback-btn {
    background: #3b82f6;
}

body.dark-mode .feedback-btn:hover {
    background: #2563eb;
}

body.dark-mode .feedback-description {
    color: #94a3b8;
}

body.dark-mode .fullscreen-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: #10b981;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

body.dark-mode .fullscreen-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    border-color: #059669;
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

body.dark-mode .fullscreen-description {
    color: #94a3b8;
}

.container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 500px;
    width: 90%;

    /* 文字選択とコピーを無効化（集中妨害防止） */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

.status {
    font-size: 1.8rem;
    margin-bottom: 30px;
    font-weight: 500;
}

.status.working {
    color: #2d3748;
}

.status.break {
    color: #e53e3e;
}

.status.paused {
    color: #f59e0b;
}

.timer-display {
    font-size: 4rem;
    font-weight: bold;
    margin: 30px 0;
    font-family: 'Courier New', monospace;
}

.hidden-timer {
    font-size: 1.2rem;
    color: #718096;
    margin: 30px 0;
    font-style: italic;
}

.controls {
    margin: 30px 0;
}

.btn {
    background: #4299e1;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    border-radius: 50px;
    cursor: pointer;
    margin: 0 10px;
    transition: all 0.3s ease;
}

.btn:hover {
    background: #3182ce;
    transform: translateY(-2px);
}

.btn:disabled {
    background: #a0aec0;
    cursor: not-allowed;
    transform: none;
}

.btn.pause {
    background: #10b981;
}

.btn.pause:hover {
    background: #059669;
}


/* ハンバーガーメニュー */
.hamburger-menu {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    z-index: 1002;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.hamburger-menu:hover {
    transform: scale(1.05);
    background: white;
}

.hamburger-menu span {
    width: 24px;
    height: 3px;
    background: #2d3748;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.hamburger-menu.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.hamburger-menu.disabled span {
    background: #cbd5e0;
}

/* サイドメニュー */
.side-menu {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 1001;
    overflow-y: auto;

    /* 設定メニューでは文字選択を有効にする */
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

.side-menu.open {
    right: 0;
}

.side-menu-header {
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.side-menu-header h3 {
    margin: 0;
    color: #2d3748;
    font-size: 1.3rem;
    text-align: center;
}

.side-menu-content {
    padding: 20px;
}

.setting-group {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.setting-group label {
    font-weight: 500;
    color: #4a5568;
    font-size: 0.95rem;
}

.setting-group input[type="number"] {
    width: 80px;
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
}

.setting-group input[type="checkbox"] {
    transform: scale(1.3);
    cursor: pointer;
}


.test-sound-btn {
    padding: 10px 20px;
    border: 2px solid #3182ce;
    border-radius: 8px;
    background: linear-gradient(135deg, #3182ce 0%, #2c5aa0 100%);
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(49, 130, 206, 0.2);
    min-width: 120px;
}

.test-sound-btn:hover {
    background: linear-gradient(135deg, #2c5aa0 0%, #2553a0 100%);
    border-color: #2c5aa0;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(49, 130, 206, 0.3);
}

.test-sound-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(49, 130, 206, 0.2);
}

.setting-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 20px 0;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sound-setting-group {
    margin-bottom: 20px;
}

.sound-setting-label {
    display: block;
    font-weight: 500;
    color: #4a5568;
    font-size: 0.95rem;
    margin-bottom: 12px;
}

.sound-selector {
    margin-bottom: 10px;
}

.sound-selector select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    background: white;
    cursor: pointer;
}

.sound-test {
    display: flex;
    justify-content: center;
}

.volume-control input[type="range"] {
    flex: 1;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.volume-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #4299e1;
    border-radius: 50%;
    cursor: pointer;
}

.volume-control input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #4299e1;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

#volume-value {
    min-width: 40px;
    font-size: 0.9rem;
    color: #718096;
}

/* フィードバックセクション */
.feedback-section {
    padding: 15px 0;
    text-align: center;
}

.feedback-btn {
    width: 100%;
    background: #4299e1;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 8px;
}

.feedback-btn:hover {
    background: #3182ce;
    transform: translateY(-1px);
}

.feedback-description {
    margin: 0;
    font-size: 0.85rem;
    color: #718096;
    line-height: 1.3;
}

.fullscreen-section {
    margin-bottom: 20px;
    text-align: center;
}

.fullscreen-btn {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid #059669;
    border-radius: 8px;
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: white;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(5, 150, 105, 0.2);
}

.fullscreen-btn:hover {
    background: linear-gradient(135deg, #047857 0%, #065f46 100%);
    border-color: #047857;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(5, 150, 105, 0.3);
}

.fullscreen-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(5, 150, 105, 0.2);
}

.fullscreen-description {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 8px;
    text-align: center;
}

/* オーバーレイ */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1000;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Google Analytics通知（メニュー内） */
.analytics-notice-menu {
    padding: 15px 0 5px;
    text-align: center;
    border-top: 1px solid #e2e8f0;
    margin-top: 10px;
}

.analytics-notice-menu p {
    margin: 0;
    font-size: 0.75rem;
    color: #9ca3af;
    line-height: 1.3;
}

body.dark-mode .analytics-notice-menu {
    border-top: 1px solid #374151;
}

body.dark-mode .analytics-notice-menu p {
    color: #6b7280;
}

.hidden {
    display: none;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }

    100% {
        opacity: 1;
    }
}

.working-indicator {
    animation: pulse 2s infinite;
}