@media (min-width: 769px) {
    #main-section {
        display: grid;
        grid-template-rows: 1fr 1fr;
        justify-items: center;
        align-items: center;
        height: 100%;
        max-height: 100%;
        width: 100%;
        overflow: hidden;
    }

    #ticketing-section {
        height: 100%;
        max-height: 100%;
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        overflow: hidden;
    }

    #ticketing-info-section {
        width: 85%;
        height: 80%;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        align-items: center;
        gap: 0;
        background: linear-gradient(145deg, #ffffff 0%, #f8f9ff 50%, #f0f1ff 100%);
        border-radius: 24px;
        border: none;
        box-shadow: 0 12px 40px rgba(107, 91, 154, 0.15),
                    0 6px 20px rgba(0, 0, 0, 0.08),
                    inset 0 1px 0 rgba(255, 255, 255, 0.8);
        padding: 35px 40px;
        box-sizing: border-box;
    }

    #timeline-container {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    #countdown {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        font-weight: bold;
        font-size: clamp(28px, 4vw, 56px);
        text-align: center;
        background: linear-gradient(135deg, #6b5b9a, #8470b3);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        text-shadow: 0 2px 4px rgba(107, 91, 154, 0.3);
        white-space: nowrap;
        overflow: hidden;
    }

    .timeline-wrapper {
        width: 100%;
        display: flex;
        align-items: center;
        gap: 15px;
    }

    .timeline-label {
        font-size: clamp(14px, 1.5vw, 18px);
        font-weight: 700;
        background: linear-gradient(135deg, #6b5b9a, #8470b3);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        min-width: 50px;
        text-align: center;
    }

    #timeline-bar {
        flex: 1;
        height: 36px;
        background: linear-gradient(180deg, #e8e8e8 0%, #d0d0d0 100%);
        border-radius: 18px;
        position: relative;
        overflow: visible;
        box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.15),
                    0 2px 4px rgba(0, 0, 0, 0.05);
        border: 2px solid rgba(107, 91, 154, 0.1);
    }

    #timeline-highlight {
        position: absolute;
        left: 0;
        top: 0;
        width: 50%;
        height: 100%;
        background: linear-gradient(135deg, #8470b3 0%, #6b5b9a 50%, #5a4a89 100%);
        border-radius: 18px 0 0 18px;
        box-shadow: 0 0 20px rgba(107, 91, 154, 0.6),
                    inset 0 2px 4px rgba(255, 255, 255, 0.3);
        animation: pulse-highlight 2s infinite;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #timeline-highlight::after {
        content: '예매 가능 구간';
        color: white;
        font-size: clamp(11px, 1.2vw, 14px);
        font-weight: 700;
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
        white-space: nowrap;
    }

    @keyframes pulse-highlight {
        0%, 100% {
            box-shadow: 0 0 20px rgba(107, 91, 154, 0.6);
        }
        50% {
            box-shadow: 0 0 30px rgba(107, 91, 154, 0.8);
        }
    }

    #timeline-pointer {
        position: absolute;
        top: 50%;
        left: 0%;
        transform: translate(-50%, -50%);
        width: 24px;
        height: 24px;
        background: linear-gradient(135deg, #6b5b9a, #8470b3);
        border: 4px solid white;
        border-radius: 50%;
        box-shadow: 0 4px 12px rgba(107, 91, 154, 0.5),
                    0 0 0 2px rgba(107, 91, 154, 0.2);
        transition: left 0.3s ease;
        z-index: 10;
    }

    #action-button {
        width: 100%;
        height: clamp(60px, 8vh, 80px);
        border: none;
        border-radius: 18px;
        cursor: pointer;
        background: linear-gradient(135deg, #8470b3 0%, #6b5b9a 100%);
        color: white;
        font-size: clamp(18px, 2vw, 24px);
        font-family: my-font, sans-serif;
        font-weight: 700;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 10px 30px rgba(107, 91, 154, 0.35),
                    0 5px 15px rgba(0, 0, 0, 0.1),
                    inset 0 1px 0 rgba(255, 255, 255, 0.3);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
        overflow: hidden;
    }

    #action-button::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
        transition: left 0.6s;
    }

    #action-button:hover::before {
        left: 100%;
    }

    #action-button:hover {
        transform: translateY(-2px);
        box-shadow: 0 12px 32px rgba(107, 91, 154, 0.4),
                    0 6px 16px rgba(0, 0, 0, 0.15);
    }

    #action-button:active {
        transform: translateY(0);
        box-shadow: 0 4px 16px rgba(107, 91, 154, 0.3);
    }

    #button-text {
        letter-spacing: 0.5px;
    }

    #action-button.waiting {
        background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
        box-shadow: 0 8px 24px rgba(107, 114, 128, 0.3);
        cursor: not-allowed;
        opacity: 0.7;
    }

    #action-button.ready {
        background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
        box-shadow: 0 8px 24px rgba(139, 92, 246, 0.35);
        animation: pulse 1.5s infinite;
    }

    @keyframes pulse {
        0%, 100% {
            box-shadow: 0 10px 30px rgba(139, 92, 246, 0.35);
        }
        50% {
            box-shadow: 0 12px 40px rgba(139, 92, 246, 0.5);
        }
    }

    #action-button.active {
        animation: pulse-active 1.5s infinite;
    }

    @keyframes pulse-active {
        0%, 100% {
            box-shadow: 0 10px 30px rgba(107, 91, 154, 0.35);
        }
        50% {
            box-shadow: 0 12px 40px rgba(107, 91, 154, 0.55);
        }
    }

    #modal-section {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.5);
        justify-content: center;
        align-items: center;
        z-index: 1000;
        display: none;
    }

    #modal-content {
        background-color: white;
        width: 40vw;
        height: 50vh;
        border-radius: 10px;
        border: 3px solid darkslateblue;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

    #modal-title {
        font-size: 25px;
        font-weight: bold;
    }

    #waiting-info-section {
        background-color: #E6E6FA;
        width: 30vw;
        height: 20vh;
        border-radius: 10px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 20px;
    }

    #waiting-mention {
        font-weight: bold;
        line-height: 1.5;
    }

    #waiting-number {
        font-weight: bold;
        font-size: 25px;
        color: darkslateblue;
    }

    #progress-container {
        margin-top: 10px;
        width: 30vw;
        height: 10%;
        border: 3px solid darkslateblue;
        border-radius: 10px;
    }

    #progress-bar {
        width: 0;
        height: 100%;
        background-color: darkslateblue;
    }
}


@media (max-width: 768px) {
    #main-section {
        width: 100%;
        overflow: hidden;
        display: grid;
        grid-auto-flow: row;
        grid-template-rows: 5fr 5fr;
        justify-items: center;
        align-items: start;
    }

    #button-container {
        width: 100%;
        display: flex;
        justify-content: start;
        align-items: center;
        flex-direction: column;
        height: 100%;
        overflow: hidden;
    }

    #round-button {
        height: 90%;
        aspect-ratio: 1/1;
        border: none;
        border-radius: 50%;
        cursor: pointer;
        color: white;
        background: darkslateblue;
        font-size: clamp(13px, 3vw, 18px);
        font-family: my-font, sans-serif;
    }

    #countdown-message-section {
        width: 100%;
        text-align: center;
        background-color: #514897;
        color: white;
        height: 100%;
        overflow: hidden;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: clamp(10px, 2.5vw, 14px);
    }

    #countdown-message {
        font-size: clamp(10px, 2.5vw, 14px);
    }

    #countdown-message-important {
        background: white;
        color: darkslateblue;
        margin-left: 5px;
        padding: 3px;
        box-sizing: border-box;
        border-radius: 5px;
    }

    #countdown {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        font-weight: bold;
        font-size: clamp(20px, 4vw, 24px);
        text-align: center;
        background: linear-gradient(135deg, #6b5b9a, #8470b3);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        text-shadow: 0 2px 4px rgba(107, 91, 154, 0.3);
        white-space: nowrap;
        overflow: hidden;
    }

    #ticketing-section {
        width: 100%;
        overflow: hidden;
        height: 100%;
        max-height: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    #ticketing-info-section {
        width: 90%;
        height: 85%;
        display: grid;
        grid-template-rows: 3fr 2fr;
        justify-items: center;
        align-items: center;
        background: linear-gradient(145deg, #ffffff 0%, #f8f9ff 50%, #f0f1ff 100%);
        border-radius: 20px;
        border: none;
        box-shadow: 0 8px 30px rgba(107, 91, 154, 0.15),
                    0 4px 15px rgba(0, 0, 0, 0.08),
                    inset 0 1px 0 rgba(255, 255, 255, 0.8);
        padding: 25px 20px;
        box-sizing: border-box;
    }

    #timeline-container {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .timeline-wrapper {
        width: 100%;
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .timeline-label {
        font-size: clamp(12px, 3vw, 16px);
        font-weight: 700;
        background: linear-gradient(135deg, #6b5b9a, #8470b3);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        min-width: 30px;
        text-align: center;
    }

    #timeline-bar {
        flex: 1;
        height: clamp(28px, 5vw, 36px);
        background: linear-gradient(180deg, #e8e8e8 0%, #d0d0d0 100%);
        border-radius: 16px;
        position: relative;
        overflow: visible;
        box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.15),
                    0 1px 3px rgba(0, 0, 0, 0.05);
        border: 2px solid rgba(107, 91, 154, 0.1);
    }

    #timeline-highlight {
        position: absolute;
        left: 0;
        top: 0;
        width: 50%;
        height: 100%;
        background: linear-gradient(135deg, #8470b3 0%, #6b5b9a 50%, #5a4a89 100%);
        border-radius: 16px 0 0 16px;
        box-shadow: 0 0 15px rgba(107, 91, 154, 0.6),
                    inset 0 1px 3px rgba(255, 255, 255, 0.3);
        animation: pulse-highlight 2s infinite;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #timeline-highlight::after {
        content: '예매 가능 구간';
        color: white;
        font-size: clamp(9px, 2.2vw, 12px);
        font-weight: 700;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
        white-space: nowrap;
    }

    #timeline-pointer {
        position: absolute;
        top: 50%;
        left: 0%;
        transform: translate(-50%, -50%);
        width: clamp(20px, 4vw, 24px);
        height: clamp(20px, 4vw, 24px);
        background: linear-gradient(135deg, #6b5b9a, #8470b3);
        border: 3px solid white;
        border-radius: 50%;
        box-shadow: 0 3px 10px rgba(107, 91, 154, 0.5),
                    0 0 0 2px rgba(107, 91, 154, 0.2);
        transition: left 0.3s ease;
        z-index: 10;
    }

    #action-button {
        width: 100%;
        height: 70%;
        white-space: nowrap;
        border: none;
        border-radius: 16px;
        cursor: pointer;
        background: linear-gradient(135deg, #8470b3 0%, #6b5b9a 100%);
        color: white;
        font-size: clamp(10px, 4vw, 22px);
        font-family: my-font, sans-serif;
        font-weight: 700;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 8px 24px rgba(107, 91, 154, 0.35),
                    0 4px 12px rgba(0, 0, 0, 0.1),
                    inset 0 1px 0 rgba(255, 255, 255, 0.3);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
        overflow: hidden;
    }

    #action-button:active {
        transform: scale(0.98);
        box-shadow: 0 4px 12px rgba(107, 91, 154, 0.3);
    }

    #button-text {
        letter-spacing: 0.5px;
    }

    #action-button.waiting {
        background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
        box-shadow: 0 6px 20px rgba(107, 114, 128, 0.3);
        cursor: not-allowed;
        opacity: 0.7;
    }

    #action-button.ready {
        background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
        box-shadow: 0 6px 20px rgba(139, 92, 246, 0.35);
        animation: pulse 1.5s infinite;
    }

    #action-button.active {
        animation: pulse-active 1.5s infinite;
    }

    #modal-section {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.5);
        justify-content: center;
        align-items: center;
        z-index: 1000;
        display: none;
    }

    #modal-content {
        background-color: white;
        width: 80vw;
        height: 80vw;
        border-radius: 10px;
        border: 3px solid darkslateblue;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

    #modal-title {
        font-size: clamp(18px, 4.5vw, 24px);
        font-weight: bold;
    }

    #waiting-info-section {
        background-color: #E6E6FA;
        width: 80%;
        height: 50%;
        border-radius: 10px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 20px;
    }

    #waiting-mention {
        font-weight: bold;
        line-height: 1.5;
        font-size: clamp(11px, 2.8vw, 14px);
    }

    #waiting-number {
        font-weight: bold;
        font-size: clamp(13px, 3.5vw, 18px);
        color: darkslateblue;
    }

    #progress-container {
        margin-top: 10px;
        width: 100%;
        height: 1vh;
        border: 3px solid darkslateblue;
        border-radius: 10px;
    }

    #progress-bar {
        width: 0;
        height: 1vh;
        background-color: darkslateblue;
        border-radius: 25px;
    }
}