/* 試着ツール全体の枠 */
#try-on-container-qi {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

/* ビデオ（隠し要素） */
#webcam {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.01;
    pointer-events: none;
}

/* メインの描画画面 */
#output-canvas {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    background: #000;
}

/* メインボタンのデザイン */
.main-action-btn {
    background: #333;
    color: #fff;
    border: none;
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: bold;
    margin: 20px auto;
    cursor: pointer;
    display: block;
    transition: background 0.3s;
}

.main-action-btn:active {
    background: #555;
}

/* レンズ選択グリッド */
.control-label {
    font-size: 0.85rem;
	text-align: center;
    color: #888;
    margin: 20px 0 10px;
}

.lens-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0 10px;
}

.lens-item {
    flex: 0 0 85px; 
    background: rgba(0, 0, 0, 0.4); 
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 10px 5px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.2s, background 0.2s;
}

.lens-item:active {
    background: #fff;
    border-color: #ccc;
}

.lens-item img {
    width: 50px; 
    height: 50px;
    margin-bottom: 6px;
    background: #ffffff; 
    border-radius: 50%; 
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3); 
    filter: none;
    object-fit: contain;
}

.lens-item span {
    font-size: 0.75rem;
    color: #333;
    font-weight: 500;
}
.lens-item.is-selected {
	background: rgba(255, 255, 255, 0.25);
    border: 2px solid #ffffff;
}
.lens-item.is-selected img {
	background: #ffffff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 1.0); 

}
.lens-item.is-selected .lens-none-icon {
	width: 50px;
    height: 50px;
    background: #eeeeee;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 6px;
}
.lens-none-icon {
    width: 50px;
    height: 50px;
    background: #eeeeee;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 6px;
    box-sizing: border-box;
}
.stop-area {
    margin-top: 30px;
    padding-bottom: 20px;
}

.text-link-btn {
    background: #333;
    color: #fff;
    border: none;
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: bold;
    margin: 20px auto;
    cursor: pointer;
    display: block;
    transition: background 0.3s;
}
.video-wrapper {
	position: relative;
    width: 100%;
    background: #1a1a1a;
    border-radius: 20px;
    overflow: hidden;
    aspect-ratio: 3 / 4; 
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

#waiting-area {
    position: absolute;
    z-index: 10;
    text-align: center;
    width: 100%;
    transition: opacity 0.5s;
}

#waiting-logo {
    width: 60%; 
    height: auto;
    margin-bottom: 15px;
}

.waiting-text {
    color: #888;
    font-size: 1rem;
    letter-spacing: 0.05em;
}
#output-canvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100%;
    min-height: 100%;
    object-fit: cover; 
    opacity: 0;
    transition: opacity 0.5s;
}

#active-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 20;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 70%, transparent 100%);
    padding: 20px 0 15px;
    display: none; 
}

.control-label {
    font-size: 0.75rem;
    text-align: center;
    color: #fff; 
    margin: 0 0 10px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.lens-grid {
    display: flex;
    flex-wrap: nowrap; 
    overflow-x: auto; 
    gap: 12px;
    padding: 0 15px 10px;
    -webkit-overflow-scrolling: touch;
}

.lens-grid::-webkit-scrollbar {
    display: none;
}

.lens-item {
	flex: 0 0 85px; 
    background: rgba(0, 0, 0, 0.4); 
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 12px 5px; 
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center; 
    justify-content: center; 
    transition: background 0.2s, border-color 0.2s; 
    box-sizing: border-box; 
}

.lens-item img {
	width: 50px;
    height: 50px;
    margin-bottom: 6px;
    background: #ffffff;
    border-radius: 50%;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    object-fit: contain;
    display: block;
}

.lens-item span {
    font-size: 0.65rem;
    color: #fff;
    white-space: nowrap; 
}

.stop-area {
    margin-top: 20px;
    text-align: center;
    width: 100%;
}

#stop-camera {
    background: #333;
    color: #fff;
    border: none;
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: bold;
    margin: 20px auto;
    cursor: pointer;
    display: block;
    transition: background 0.3s;
}
.text-link-btn {
    
}

.zoom-toggle-area {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 20;
}

.zoom-btn {
    width: 46px;
    height: 46px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
}

.zoom-btn.is-active {
    background: rgba(255, 255, 255, 0.8);
    color: #1a1a1a;
    border-color: #fff;
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}


.top-controls-flex {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-type-selection {
    display: flex;
    gap: 5px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    padding: 4px;
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.color-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid transparent;
    font-size: 0.65rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
    color: #333;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.color-btn.spring { background: #ffe4e1; color: #d05a6e; } 
.color-btn.summer { background: #e0f0ff; color: #4a86e8; } 
.color-btn.autumn { background: #fdf5e6; color: #b8860b; } 
.color-btn.winter { background: #f8f8ff; color: #191970; } 
.color-btn.reset  { background: #666;    color: #fff; }

.color-btn.is-selected {
    border-color: #fff;
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
}
#lens-detail-area {
    display: none;
    width: 100%;
    background: #FFFFFF;
    padding: 10px; 
    box-sizing: border-box;
    position: relative;
    border-top: 1px solid #eee;
}

#lens-detail-area.is-active {
    display: block;
}

.detail-slim-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    padding-right: 30px; 
}

#detail-package-img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    background: #f5f5f5;
}

#detail-catch {
    font-size: 0.75rem;
    margin: 0 0 2px;
    color: #333;
    font-weight: bold;
    line-height: 1.3;
}

.detail-gdia-tag {
    font-size: 0.65rem;
    color: #888;
}

.cart-btn {
    width: 100%;
    background: #1a1a1a;
    color: #fff;
    border: none;
    padding: 10px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 0.85rem;
}

.close-detail-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    z-index: 10;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    color: #000;
    border: none;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
}

.recommend-visual {
    width: 100%;
    margin-bottom: 10px;
    overflow: hidden;
}

#detail-recommend-img {
    height: auto;
    width: 85%;
    margin: 0 auto;
    display: block;
}

#detail-catch-text{
	margin: 5% auto 2%;
    font-size: min(4vw, 20px);
    text-align: center;
	font-weight: bold;
}
