/* =============================================
   주사위 내기 스타일 (dc- prefix)
   ============================================= */

html { background: #000; }

.dc-body {
    overflow: hidden;
    height: 100dvh;
    max-width: 480px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #f0f0f0;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

.dc-game {
    width: 100%;
    height: 100dvh;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    position: relative;
    background: #0f0f1a;
}

/* Top Bar */
.dc-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    z-index: 10;
    flex-shrink: 0;
}
.dc-back {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
}
.dc-back:hover { color: #fff; }
.dc-info-badge {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.2);
}

/* Content */
.dc-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 24px;
    overflow-y: auto;
}

/* ===== Setup Screen ===== */
.dc-setup-wrap {
    width: 100%;
    max-width: 360px;
    text-align: center;
}
.dc-setup-emoji { font-size: 64px; margin-bottom: 12px; }
.dc-setup-title {
    font-size: 26px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 6px;
}
.dc-setup-desc {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 20px;
    line-height: 1.5;
}

/* Mode selector */
.dc-mode-wrap {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    justify-content: center;
}
.dc-mode-btn {
    flex: 1;
    padding: 12px 8px;
    border: 2px solid #2d2d44;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}
.dc-mode-btn.dc-mode-active {
    border-color: #6C5CE7;
    background: rgba(108, 92, 231, 0.15);
    color: #fff;
}

/* Name input */
.dc-input-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.dc-name-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #2d2d44;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}
.dc-name-input:focus { border-color: #6C5CE7; }
.dc-name-input::placeholder { color: rgba(255, 255, 255, 0.3); }

.dc-btn-add {
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    background: #6C5CE7;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.1s;
}
.dc-btn-add:active { transform: scale(0.95); }

/* Player list */
.dc-player-list {
    width: 100%;
    margin-bottom: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}
.dc-player-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(108, 92, 231, 0.12);
    border: 1px solid rgba(108, 92, 231, 0.3);
    border-radius: 20px;
    font-size: 14px;
    color: #fff;
}
.dc-player-remove {
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.dc-player-count {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 16px;
}

.dc-btn-start {
    padding: 16px 48px;
    background: linear-gradient(135deg, #6C5CE7, #a855f7);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s;
}
.dc-btn-start:active { transform: scale(0.95); }
.dc-btn-start:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ===== Playing Screen ===== */
.dc-play-wrap {
    width: 100%;
    max-width: 360px;
    text-align: center;
}
.dc-turn-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 4px;
}
.dc-turn-name {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 24px;
}

/* 3D Dice */
.dc-dice-scene {
    width: 120px;
    height: 120px;
    perspective: 600px;
    margin: 0 auto 24px;
}
.dc-dice-cube {
    width: 120px;
    height: 120px;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateX(-25deg) rotateY(25deg);
    transition: transform 0.15s;
}
.dc-dice-cube.dc-rolling {
    animation: dc-roll 0.6s ease-out;
}

@keyframes dc-roll {
    0%   { transform: rotateX(0deg) rotateY(0deg); }
    25%  { transform: rotateX(360deg) rotateY(180deg); }
    50%  { transform: rotateX(720deg) rotateY(360deg); }
    75%  { transform: rotateX(1080deg) rotateY(540deg); }
    100% { transform: rotateX(var(--rx)) rotateY(var(--ry)); }
}

.dc-dice-face {
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 16px;
    background: linear-gradient(145deg, #ffffff, #e8e8e8);
    border: 2px solid rgba(0, 0, 0, 0.08);
    display: grid;
    padding: 18px;
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.05);
}
.dc-face-1 { grid-template: 1fr / 1fr; transform: rotateY(0deg) translateZ(60px); }
.dc-face-2 { grid-template: 1fr 1fr / 1fr; transform: rotateY(180deg) translateZ(60px); }
.dc-face-3 { grid-template: 1fr 1fr 1fr / 1fr; transform: rotateY(90deg) translateZ(60px); }
.dc-face-4 { grid-template: 1fr 1fr / 1fr 1fr; transform: rotateY(-90deg) translateZ(60px); }
.dc-face-5 { grid-template: 1fr 1fr 1fr / 1fr 1fr; transform: rotateX(90deg) translateZ(60px); }
.dc-face-6 { grid-template: 1fr 1fr 1fr / 1fr 1fr; transform: rotateX(-90deg) translateZ(60px); }

.dc-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #555, #222);
    justify-self: center;
    align-self: center;
}

/* Face 1 - center */
.dc-face-1 .dc-dot { justify-self: center; align-self: center; }

/* Face 2 - diagonal */
.dc-face-2 .dc-dot:nth-child(1) { justify-self: end; align-self: start; }
.dc-face-2 .dc-dot:nth-child(2) { justify-self: start; align-self: end; }

/* Face 3 - diagonal + center */
.dc-face-3 .dc-dot:nth-child(1) { justify-self: end; align-self: start; }
.dc-face-3 .dc-dot:nth-child(2) { justify-self: center; align-self: center; }
.dc-face-3 .dc-dot:nth-child(3) { justify-self: start; align-self: end; }

/* Face 4 - corners */
/* default grid handles this */

/* Face 5 - 4 corners + center */
.dc-face-5 .dc-dot:nth-child(5) { grid-column: 1 / -1; }

/* Face 6 - 3x2 */
/* default grid handles this */

.dc-btn-roll {
    padding: 16px 48px;
    background: linear-gradient(135deg, #6C5CE7, #a855f7);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s;
    margin-bottom: 20px;
}
.dc-btn-roll:active { transform: scale(0.95); }
.dc-btn-roll:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Score list */
.dc-score-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
}
.dc-score-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    font-size: 14px;
}
.dc-score-row.dc-current {
    background: rgba(108, 92, 231, 0.15);
    border: 1px solid rgba(108, 92, 231, 0.3);
}
.dc-score-name {
    flex: 1;
    font-weight: 600;
    color: #fff;
}
.dc-score-val {
    font-size: 20px;
    font-weight: 800;
    color: #6C5CE7;
    min-width: 32px;
    text-align: center;
}
.dc-score-wait {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.3);
}

/* Toast */
.dc-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    white-space: nowrap;
}
.dc-toast-show { opacity: 1; pointer-events: auto; }
