@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;700&display=swap');

body {
    font-family: 'Noto Sans JP', sans-serif;
    background-color: #f4f7f6;
    color: #333;
    margin: 0;
    padding: 20px;
    
    /* セーフエリア & スワイプ暴発対策 */
    padding-top: max(20px, env(safe-area-inset-top));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
    overscroll-behavior-y: none;
    overscroll-behavior-x: none;

    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    box-sizing: border-box;
}

.container {
    width: 100%;
    max-width: 480px;
    background: #ffffff;
    padding: 40px 30px;
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

h2 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin: 0 0 10px 0;
    border-bottom: none;
    font-weight: 700;
}

.shop-logo {
    max-height: 80px;
    object-fit: contain;
    margin-bottom: 15px;
}

.time-display {
    font-size: 2.8rem;
    font-weight: 700;
    color: #34495e;
    margin-bottom: 30px;
    letter-spacing: 2px;
    font-variant-numeric: tabular-nums;
}

.waiting-info {
    background: #e0f2f1;
    color: #00695c;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 1.1rem;
    margin-bottom: 40px;
    border: none;
    display: inline-block;
    font-weight: bold;
}

.waiting-info strong {
    font-size: 1.5rem;
    margin-left: 5px;
    color: #004d40;
}

h3 {
    font-size: 1.3rem;
    color: #7f8c8d;
    margin-bottom: 25px;
    font-weight: normal;
    line-height: 1.5;
}

/* Counter Controls */
.counter {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin-bottom: 50px;
}

.counter button {
    width: 72px;
    height: 72px;
    border: none;
    background-color: #ecf0f1;
    color: #2c3e50;
    font-size: 28px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.counter button:hover {
    background-color: #dfe6e9;
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.counter button:active {
    transform: scale(0.95) translateY(0);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.counter span {
    font-size: 4rem;
    font-weight: 800;
    color: #2c3e50;
    width: 100px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* Issue Button */
.issue-btn {
    width: 100%;
    padding: 20px;
    font-size: 1.3rem;
    font-weight: bold;
    color: white;
    background: linear-gradient(135deg, #3498db, #2980b9);
    border: none;
    border-radius: 16px;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(52, 152, 219, 0.4);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.issue-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(52, 152, 219, 0.5);
}

/* Secondary Button (Back) */
.btn-secondary {
    padding: 20px;
    background-color: #ecf0f1;
    color: #7f8c8d;
    border: none;
    border-radius: 16px;
    font-weight: bold;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.btn-secondary:hover {
    background-color: #dfe6e9;
    color: #2c3e50;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

.btn-secondary:active {
    transform: translateY(0);
    box-shadow: none;
}

.issue-btn:active {
    transform: translateY(1px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.issue-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-disabled {
    opacity: 0.7;
    background: #95a5a6 !important;
}

/* Modal */
.ticket-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(44, 62, 80, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s;
}

.ticket-content {
    background: white;
    padding: 50px 30px;
    border-radius: 30px;
    text-align: center;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 50px 100px rgba(0,0,0,0.3);
    animation: modalPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

@keyframes modalPop {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.ticket-content h2 {
    font-size: 2rem;
    color: #27ae60;
    margin-bottom: 20px;
    border-bottom: none;
}

.ticket-num {
    font-size: 5rem;
    font-weight: 800;
    color: #34495e;
    margin: 20px 0;
    line-height: 1;
    letter-spacing: -2px;
}

.ticket-content p {
    color: #7f8c8d;
    margin: 8px 0;
    font-size: 1.1rem;
}

canvas#qr-code {
    margin-top: 30px;
    padding: 10px;
    border-radius: 16px;
    background: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.close-btn {
    margin-top: 25px;
    padding: 12px 35px;
    background: white;
    border: 2px solid #bdc3c7;
    border-radius: 50px;
    color: #7f8c8d;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}
.close-btn:hover {
    border-color: #95a5a6;
    color: #2c3e50;
    background: #fdfdfd;
}

/* Print Overrides */
@media print {
    body {
        margin: 0;
        padding: 0;
        background: white;
    }
    .ticket-modal {
        position: fixed;
        background: white;
    }
    .ticket-content {
        box-shadow: none;
        width: 100%;
        max-width: none;
        padding: 0;
        animation: none;
    }
    .issue-btn, .counter, .time-display, .waiting-info, h2, h3 { 
        display: none; 
    }
    button {
        display: none !important;
    }
}
