/* 해시 코인 플립 - 3D 클레이메이션 / 성 내부 / 스팀펑크 */
* { box-sizing: border-box; margin: 0; padding: 0; }

.cf-body {
    min-height: 100vh;
    background: #2d1b4e;
    font-family: 'Pretendard', 'Malgun Gothic', sans-serif;
    color: #f5e6d3;
    overflow-x: hidden;
}

.cf-root {
    position: relative;
    min-height: 100vh;
    max-width: 900px;
    margin: 0 auto;
    padding: 16px;
}

/* 배경: 성 내부 (보라색 벽, 돌계단) */
.cf-bg {
    position: fixed;
    inset: 0;
    background-color: #2d1b4e;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -2;
}
.cf-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(45,27,78,0.4) 0%, rgba(60,35,90,0.7) 50%, rgba(45,27,78,0.9) 100%);
    z-index: -1;
}

/* 상단: 나무 간판 + 제목 배너 */
.cf-header {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.cf-point-sign {
    display: flex;
    align-items: baseline;
    gap: 4px;
    padding: 10px 20px;
    background: linear-gradient(180deg, #8b6914 0%, #6b4e0a 50%, #5a4008 100%);
    border: 3px solid #a08020;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.2);
    font-weight: 800;
}
.cf-point-label { font-size: 0.85rem; color: #f5e6d3; }
.cf-point-val { font-size: 1.3rem; color: #ffd93d; margin: 0 4px; }
.cf-point-unit { font-size: 1rem; color: #f5e6d3; }

.cf-title-banner {
    flex: 1;
    text-align: center;
    padding: 12px 24px;
    background: linear-gradient(180deg, #f5e6c8 0%, #e8d4a8 50%, #d4c090 100%);
    border: 2px solid #8b7355;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    color: #4a3520;
}
.cf-title-banner h1 { font-size: 1.4rem; font-weight: 900; }
.cf-title-banner p { font-size: 0.75rem; color: #6b5344; margin-top: 2px; }

.cf-guide-btn {
    padding: 8px 16px;
    background: linear-gradient(180deg, #5a4a3a 0%, #3d3328 100%);
    border: 2px solid #8b7355;
    border-radius: 8px;
    color: #f5e6d3;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}
.cf-guide-btn:hover { background: #6b5a4a; transform: scale(1.02); }

/* 메인: 캐릭터 + 동전 */
.cf-main {
    position: relative;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cf-scene {
    position: relative;
    width: 100%;
    max-width: 400px;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cf-platform {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 180px;
    height: 24px;
    background: linear-gradient(180deg, #6b6b6b 0%, #4a4a4a 100%);
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.1);
}

.cf-character {
    position: absolute;
    bottom: 44px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 130px;
    z-index: 3;
    transition: transform 0.15s ease;
}
.cf-character.flipping {
    transform: translateX(-50%) translateY(-8px) scale(1.05);
}
.cf-minion-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.4));
}

.cf-coin-wrap {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 120px;
    z-index: 5;
}

.cf-coin {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    transform-style: preserve-3d;
}
.cf-coin.spinning.spin-heads {
    animation: cf-spin-heads 0.9s ease-out forwards;
}
.cf-coin.spinning.spin-tails {
    animation: cf-spin-tails 0.9s ease-out forwards;
}
@keyframes cf-spin-heads {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(1800deg); }
}
@keyframes cf-spin-tails {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(1980deg); }
}

.cf-coin-face {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backface-visibility: hidden;
    border: 4px solid;
    box-shadow: 0 6px 20px rgba(0,0,0,0.4), inset 0 2px 4px rgba(255,255,255,0.3);
}
.cf-coin-face.cf-heads {
    background: linear-gradient(145deg, #ffd700 0%, #e6b800 50%, #cc9900 100%);
    border-color: #e6c235;
}
.cf-coin-face.cf-tails {
    background: linear-gradient(145deg, #c0c0c0 0%, #a0a0a0 50%, #808080 100%);
    border-color: #909090;
    transform: rotateY(180deg);
}
.cf-coin-hand { font-size: 2.2rem; margin-bottom: 4px; }
.cf-coin-label { font-size: 0.65rem; font-weight: 800; letter-spacing: 0.05em; color: #4a3520; }

/* 하단: 조작판 (나무 + 톱니바퀴) */
.cf-control {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    padding: 20px 12px;
    background: linear-gradient(180deg, #8b6914 0%, #6b4e0a 30%, #5a4008 70%, #4a3506 100%);
    border: 4px solid #a08020;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5), inset 0 2px 4px rgba(255,255,255,0.1);
}

.cf-gear {
    width: 48px;
    height: 48px;
    background: radial-gradient(circle at 30% 30%, #6b6b6b, #3a3a3a 50%, #2a2a2a);
    border-radius: 50%;
    border: 4px solid #5a5a5a;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5), inset 0 2px 4px rgba(255,255,255,0.1);
}

.cf-control-inner {
    flex: 1;
    max-width: 420px;
}

.cf-choice-btns {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}
.cf-choice-btn {
    flex: 1;
    padding: 14px 20px;
    border: 3px solid;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
}
.cf-heads-btn {
    background: linear-gradient(180deg, #8b7355 0%, #6b5344 100%);
    border-color: #a08060;
    color: #f5e6d3;
}
.cf-tails-btn {
    background: linear-gradient(180deg, #4a5568 0%, #2d3748 100%);
    border-color: #5a6578;
    color: #e2e8f0;
}
.cf-choice-btn:hover { transform: scale(1.02); filter: brightness(1.1); }
.cf-choice-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.cf-point-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(180deg, #6b4e0a 0%, #5a4008 100%);
    border: 2px solid #8b6914;
    border-radius: 10px;
}
.cf-point-bar label {
    font-size: 0.9rem;
    font-weight: 700;
    color: #f5e6d3;
    min-width: 40px;
}
.cf-bet-input {
    flex: 1;
    padding: 8px 12px;
    background: #2a1f0a;
    border: 2px solid #5a4008;
    border-radius: 8px;
    color: #ffd93d;
    font-size: 1.1rem;
    font-weight: 700;
}
.cf-bet-unit { font-size: 0.9rem; color: #f5e6d3; font-weight: 700; }
.cf-quick-btns {
    display: flex;
    gap: 6px;
}
.cf-quick-btn {
    width: 44px;
    height: 36px;
    padding: 0;
    background: linear-gradient(180deg, #5a4a3a 0%, #3d3328 100%);
    border: 2px solid #8b7355;
    border-radius: 8px;
    color: #f5e6d3;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}
.cf-quick-btn:hover { background: #6b5a4a; }
.cf-quick-btn.active { background: #c9a227; color: #2a1f0a; border-color: #ffd93d; }

/* 오른쪽: Provably Fair 패널 */
.cf-verify-panel {
    position: absolute;
    top: 120px;
    right: 16px;
    width: 200px;
}

.cf-verify-machine {
    padding: 16px;
    background: linear-gradient(180deg, #3d3328 0%, #2a2218 50%, #1a1510 100%);
    border: 3px solid #5a4a3a;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.05);
}

.cf-verify-clock {
    width: 40px;
    height: 40px;
    margin: 0 auto 12px;
    background: radial-gradient(circle, #4a4a4a 30%, #2a2a2a 70%);
    border: 3px solid #6b6b6b;
    border-radius: 50%;
    box-shadow: inset 0 0 8px rgba(0,0,0,0.5);
}

.cf-verify-title {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    color: #a08060;
    margin-bottom: 6px;
}
.cf-verify-hash {
    font-family: 'Courier New', monospace;
    font-size: 0.65rem;
    word-break: break-all;
    color: #c9a227;
    min-height: 2.5em;
    margin-bottom: 12px;
}

.cf-verify-formula {
    font-size: 0.8rem;
    color: #f5e6d3;
    margin-bottom: 12px;
}
.cf-verify-formula p {
    font-size: 0.65rem;
    color: #8b7355;
    margin-top: 6px;
}
.cf-f-icon { font-size: 1rem; }

.cf-verify-btn {
    width: 100%;
    padding: 10px 16px;
    background: linear-gradient(180deg, #8b6914 0%, #6b4e0a 100%);
    border: 2px solid #a08020;
    border-radius: 8px;
    color: #f5e6d3;
    font-size: 0.85rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
}
.cf-verify-btn:hover { background: #9b7924; transform: scale(1.02); }

.cf-login-msg {
    text-align: center;
    padding: 24px;
    color: #c9a227;
}
.cf-login-msg a { color: #ffd93d; }

/* 반응형: 검증 패널 하단으로 */
@media (max-width: 768px) {
    .cf-verify-panel {
        position: static;
        width: 100%;
        margin-top: 20px;
    }
    .cf-verify-machine { max-width: 320px; margin: 0 auto; }
}
