/* タイマーセクション用スタイル - レスポンシブ対応強化 */

.timer-section.fullscreen {
    background: linear-gradient(135deg, #fff0f5 0%, #f0f8ff 50%, #ffe5f1 100%);
    border-radius: 25px;
    padding: 24px;
    margin: 16px;
    box-shadow: 0 15px 30px rgba(254, 197, 187, 0.2);
    min-height: calc(100vh - 32px);
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.timer-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    height: 100%;
    position: relative;
}

.timer-character {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.timer-buddy-avatar {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 15px;
}

.timer-buddy-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid white;
    box-shadow: 0 10px 25px rgba(254, 197, 187, 0.4);
    animation: float-character 6s ease-in-out infinite;
}

.timer-mood-indicator {
    position: absolute;
    right: -5px;
    bottom: 5px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--warning-color), var(--warning-light));
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 1rem;
    box-shadow: 0 5px 12px rgba(255, 211, 165, 0.4);
    border: 2px solid white;
    animation: pulse-strong 3s infinite;
}

.timer-speech-bubble {
    background: linear-gradient(145deg, #ffffff, #fff0f5);
    border-radius: 20px;
    padding: 12px 20px;
    max-width: 250px;
    box-shadow: 0 10px 25px rgba(254, 197, 187, 0.25);
    border: 2px solid var(--cute-pink);
    text-align: center;
    margin-bottom: 15px;
    position: relative;
}

.timer-speech-bubble::after {
    content: '';
    position: absolute;
    top: -12px;
    left: 50%;
    margin-left: -12px;
    border-width: 0 12px 12px 12px;
    border-style: solid;
    border-color: var(--cute-pink) transparent;
}

.timer-speech-bubble p {
    color: var(--text-color);
    font-weight: 600;
    font-size: 0.95rem;
    margin: 0;
}

/* タイマー円形 - 画面サイズ別調整 */
.timer-circle {
    position: relative;
    margin: 10px 0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timer-svg {
    transform: rotate(-90deg);
    overflow: visible;
    filter: drop-shadow(0 0 15px rgba(254, 197, 187, 0.3));
}

.timer-track {
    fill: none;
    stroke: #f0f0f0;
    stroke-width: 8;
}

.timer-progress {
    fill: none;
    stroke: url(#timer-gradient);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dashoffset: 0;
    filter: drop-shadow(0 0 8px rgba(254, 197, 187, 0.6));
    transition: stroke-dashoffset 1s linear;
}

.timer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--text-color);
    pointer-events: none;
}

.timer-time {
    font-weight: 800;
    margin-bottom: 5px;
    background: linear-gradient(135deg, var(--primary-color), var(--cute-lavender));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    letter-spacing: 0.05em;
    line-height: 1;
}

.timer-label {
    color: var(--text-light);
    font-weight: 600;
    font-size: 0.9rem;
}

.timer-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
    flex-shrink: 0;
}

.timer-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--cute-pink));
    color: white;
    border: none;
    border-radius: 25px;
    padding: 10px 20px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 6px 15px rgba(254, 197, 187, 0.3);
    font-weight: 700;
    min-height: 44px;
}

.timer-btn.pause {
    background: linear-gradient(135deg, var(--warning-color), var(--accent-color));
}

.timer-btn.stop {
    background: linear-gradient(135deg, var(--danger-color), var(--danger-light));
}

.timer-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(254, 197, 187, 0.4);
}

.timer-btn i {
    font-size: 1rem;
}

/* 画面サイズ別タイマー調整 */

/* 超小型デバイス (320px-374px) */
@media screen and (max-width: 374px) {
    .timer-section.fullscreen {
        padding: 16px;
        margin: 8px;
        min-height: calc(100vh - 16px);
    }
    
    .timer-container {
        max-width: 300px;
    }
    
    .timer-buddy-avatar {
        width: 60px;
        height: 60px;
        margin-bottom: 10px;
    }
    
    .timer-mood-indicator {
        width: 22px;
        height: 22px;
        font-size: 0.8rem;
    }
    
    .timer-speech-bubble {
        padding: 8px 14px;
        max-width: 200px;
        margin-bottom: 10px;
        border-radius: 16px;
    }
    
    .timer-speech-bubble p {
        font-size: 0.8rem;
    }
    
    .timer-circle {
        width: 180px;
        height: 180px;
        margin: 8px 0;
    }
    
    .timer-svg {
        width: 180px;
        height: 180px;
    }
    
    .timer-progress {
        stroke-dasharray: 440; /* 2 * π * 70 */
    }
    
    .timer-time {
        font-size: 2.2rem;
    }
    
    .timer-label {
        font-size: 0.8rem;
    }
    
    .timer-controls {
        gap: 10px;
        margin-top: 10px;
    }
    
    .timer-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
        border-radius: 20px;
    }
    
    .timer-btn i {
        font-size: 0.9rem;
    }
}

/* 小型デバイス (375px-479px) */
@media screen and (min-width: 375px) and (max-width: 479px) {
    .timer-section.fullscreen {
        padding: 18px;
        margin: 10px;
        min-height: calc(100vh - 20px);
    }
    
    .timer-container {
        max-width: 350px;
    }
    
    .timer-buddy-avatar {
        width: 70px;
        height: 70px;
        margin-bottom: 12px;
    }
    
    .timer-mood-indicator {
        width: 25px;
        height: 25px;
        font-size: 0.9rem;
    }
    
    .timer-speech-bubble {
        padding: 10px 16px;
        max-width: 220px;
        margin-bottom: 12px;
    }
    
    .timer-speech-bubble p {
        font-size: 0.85rem;
    }
    
    .timer-circle {
        width: 220px;
        height: 220px;
        margin: 10px 0;
    }
    
    .timer-svg {
        width: 220px;
        height: 220px;
    }
    
    .timer-progress {
        stroke-dasharray: 503; /* 2 * π * 80 */
    }
    
    .timer-time {
        font-size: 2.5rem;
    }
    
    .timer-label {
        font-size: 0.85rem;
    }
    
    .timer-controls {
        gap: 12px;
        margin-top: 12px;
    }
    
    .timer-btn {
        padding: 9px 18px;
        font-size: 0.9rem;
    }
}

/* 中型デバイス (480px-767px) */
@media screen and (min-width: 480px) and (max-width: 767px) {
    .timer-section.fullscreen {
        padding: 20px;
        margin: 12px;
        min-height: calc(100vh - 24px);
    }
    
    .timer-container {
        max-width: 400px;
    }
    
    .timer-buddy-avatar {
        width: 85px;
        height: 85px;
        margin-bottom: 15px;
    }
    
    .timer-mood-indicator {
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }
    
    .timer-speech-bubble {
        padding: 12px 20px;
        max-width: 260px;
        margin-bottom: 15px;
    }
    
    .timer-speech-bubble p {
        font-size: 0.95rem;
    }
    
    .timer-circle {
        width: 280px;
        height: 280px;
        margin: 15px 0;
    }
    
    .timer-svg {
        width: 280px;
        height: 280px;
    }
    
    .timer-progress {
        stroke-dasharray: 691; /* 2 * π * 110 */
    }
    
    .timer-time {
        font-size: 3.2rem;
    }
    
    .timer-label {
        font-size: 1rem;
    }
    
    .timer-controls {
        gap: 18px;
        margin-top: 18px;
    }
    
    .timer-btn {
        padding: 12px 24px;
        font-size: 1rem;
    }
    
    .timer-btn i {
        font-size: 1.1rem;
    }
}

/* タブレット (768px-1023px) */
@media screen and (min-width: 768px) and (max-width: 1023px) {
    .timer-section.fullscreen {
        padding: 30px;
        margin: 0;
        min-height: 100vh;
        border-radius: 0;
    }
    
    .timer-container {
        max-width: 500px;
    }
    
    .timer-buddy-avatar {
        width: 100px;
        height: 100px;
        margin-bottom: 20px;
    }
    
    .timer-mood-indicator {
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }
    
    .timer-speech-bubble {
        padding: 16px 24px;
        max-width: 300px;
        margin-bottom: 20px;
        border-radius: 25px;
    }
    
    .timer-speech-bubble p {
        font-size: 1.1rem;
    }
    
    .timer-circle {
        width: 350px;
        height: 350px;
        margin: 20px 0;
    }
    
    .timer-svg {
        width: 350px;
        height: 350px;
    }
    
    .timer-progress {
        stroke-dasharray: 879; /* 2 * π * 140 */
        stroke-width: 10;
    }
    
    .timer-track {
        stroke-width: 10;
    }
    
    .timer-time {
        font-size: 4rem;
    }
    
    .timer-label {
        font-size: 1.2rem;
    }
    
    .timer-controls {
        gap: 25px;
        margin-top: 25px;
    }
    
    .timer-btn {
        padding: 16px 32px;
        font-size: 1.2rem;
        border-radius: 30px;
    }
    
    .timer-btn i {
        font-size: 1.3rem;
    }
}

/* デスクトップ (1024px以上) */
@media screen and (min-width: 1024px) {
    .timer-section.fullscreen {
        padding: 40px;
        margin: 0;
        min-height: 100vh;
        border-radius: 0;
    }
    
    .timer-container {
        max-width: 600px;
    }
    
    .timer-buddy-avatar {
        width: 120px;
        height: 120px;
        margin-bottom: 25px;
    }
    
    .timer-mood-indicator {
        width: 40px;
        height: 40px;
        font-size: 1.4rem;
    }
    
    .timer-speech-bubble {
        padding: 20px 30px;
        max-width: 350px;
        margin-bottom: 25px;
        border-radius: 30px;
    }
    
    .timer-speech-bubble p {
        font-size: 1.3rem;
    }
    
    .timer-circle {
        width: 420px;
        height: 420px;
        margin: 25px 0;
    }
    
    .timer-svg {
        width: 420px;
        height: 420px;
    }
    
    .timer-progress {
        stroke-dasharray: 1005; /* 2 * π * 160 */
        stroke-width: 12;
    }
    
    .timer-track {
        stroke-width: 12;
    }
    
    .timer-time {
        font-size: 5rem;
    }
    
    .timer-label {
        font-size: 1.4rem;
    }
    
    .timer-controls {
        gap: 30px;
        margin-top: 30px;
    }
    
    .timer-btn {
        padding: 18px 36px;
        font-size: 1.3rem;
        border-radius: 35px;
    }
    
    .timer-btn i {
        font-size: 1.4rem;
    }
}

/* 横向き対応 */
@media screen and (orientation: landscape) and (max-height: 500px) {
    .timer-section.fullscreen {
        padding: 10px;
        min-height: calc(100vh - 20px);
    }
    
    .timer-container {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        max-width: 90vw;
        gap: 20px;
    }
    
    .timer-character {
        margin-bottom: 0;
        flex-shrink: 0;
        order: 1;
    }
    
    .timer-buddy-avatar {
        width: 60px !important;
        height: 60px !important;
        margin-bottom: 8px !important;
    }
    
    .timer-speech-bubble {
        padding: 6px 12px !important;
        max-width: 150px !important;
        margin-bottom: 0 !important;
    }
    
    .timer-speech-bubble p {
        font-size: 0.7rem !important;
    }
    
    .timer-circle {
        width: 200px !important;
        height: 200px !important;
        margin: 0 !important;
        order: 2;
        flex-shrink: 0;
    }
    
    .timer-svg {
        width: 200px !important;
        height: 200px !important;
    }
    
    .timer-time {
        font-size: 2rem !important;
    }
    
    .timer-label {
        font-size: 0.8rem !important;
    }
    
    .timer-controls {
        flex-direction: column;
        gap: 8px !important;
        margin-top: 0 !important;
        order: 3;
        flex-shrink: 0;
    }
    
    .timer-btn {
        padding: 8px 16px !important;
        font-size: 0.8rem !important;
        min-width: 80px;
    }
}

/* アニメーション効果 */
@keyframes pulse-strong {
    0%, 100% { 
        transform: scale(1); 
        box-shadow: 0 6px 15px rgba(255, 211, 165, 0.4); 
    }
    50% { 
        transform: scale(1.1); 
        box-shadow: 0 8px 20px rgba(255, 211, 165, 0.6); 
    }
}

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

/* SVGの動的サイズ調整 */
.timer-svg circle {
    transition: all 0.3s ease;
}

/* タイマー数字のパルス効果 */
.timer-time {
    animation: timer-pulse 2s ease-in-out infinite;
}

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