/* =============================================
   끝말잇기 게임 스타일
   ============================================= */

html { background: #000; }

.wc-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;
}

/* Game Area */
.wc-game {
    width: 100%;
    height: 100dvh;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: background-color 0.15s;
}

/* Top Bar */
.wc-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    z-index: 10;
    flex-shrink: 0;
}
.wc-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);
}
.wc-back:hover { color: #fff; }
.wc-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);
}

/* Timer */
.wc-timer-wrap {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}
.wc-timer-bar {
    height: 100%;
    width: 100%;
    border-radius: 0 3px 3px 0;
    transition: width 0.1s linear, background 0.3s;
}

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

/* ===== States ===== */

/* Intro */
.state-intro { background: #0f0f23; }
.state-intro .wc-content {
    justify-content: flex-start;
    padding-top: 40px;
}

.wc-intro-emoji { font-size: 72px; margin-bottom: 16px; }
.wc-intro-title {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 8px;
}
.wc-intro-desc {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
    margin-bottom: 24px;
    text-align: center;
}
.wc-intro-desc strong { color: #ffd700; }

.wc-best {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 10px 18px;
    margin-bottom: 12px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.wc-challenge {
    background: rgba(255, 215, 0, 0.15);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 12px;
    padding: 14px 20px;
    margin-bottom: 24px;
    font-size: 16px;
    color: #ffd700;
    text-align: center;
}
.wc-challenge strong { font-size: 22px; }

.wc-btn-start {
    display: inline-block;
    padding: 16px 48px;
    background: #10B981;
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s;
}
.wc-btn-start:active { transform: scale(0.95); }

/* Playing */
.state-playing { background: #0f0f23; }
.state-playing .wc-content {
    justify-content: flex-end;
    padding-top: 8px;
    padding-bottom: 8px;
}

/* Status bar */
.wc-status-bar {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 400px;
    margin-bottom: 8px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    flex-shrink: 0;
}
.wc-status-bar strong {
    color: #fff;
    font-weight: 700;
}

/* Chat area */
.wc-chat-area {
    flex: 1;
    width: 100%;
    max-width: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 8px 0;
    min-height: 0;
}

.wc-msg {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 15px;
    line-height: 1.4;
    word-break: break-word;
    animation: wcSlideIn 0.25s ease;
}

@keyframes wcSlideIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.wc-msg-ai {
    align-self: flex-start;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #c4b5fd;
    border-bottom-left-radius: 4px;
}

.wc-msg-player {
    align-self: flex-end;
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
    border-bottom-right-radius: 4px;
}

.wc-msg-system {
    align-self: center;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    padding: 6px 14px;
    border-radius: 20px;
}

.wc-msg-thinking {
    align-self: flex-start;
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
    padding: 8px 14px;
}

.wc-msg .wc-msg-word {
    font-size: 20px;
    font-weight: 800;
}

.wc-msg .wc-msg-last-char {
    color: #fbbf24;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.wc-msg .wc-msg-label {
    font-size: 11px;
    opacity: 0.6;
    display: block;
    margin-bottom: 2px;
}

/* Input area */
.wc-input-area {
    display: flex;
    gap: 8px;
    width: 100%;
    max-width: 400px;
    flex-shrink: 0;
    margin-top: 8px;
}
.wc-word-input {
    flex: 1;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    outline: none;
    text-align: center;
}
.wc-word-input::placeholder { color: rgba(255, 255, 255, 0.25); font-weight: 400; }
.wc-word-input:focus { border-color: rgba(16, 185, 129, 0.6); }
.wc-word-input:disabled {
    opacity: 0.4;
    cursor: default;
}

.wc-btn-submit {
    padding: 14px 24px;
    background: #10B981;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s;
    flex-shrink: 0;
}
.wc-btn-submit:active { transform: scale(0.95); }
.wc-btn-submit:disabled {
    opacity: 0.4;
    cursor: default;
}

/* Thinking dots animation */
.wc-dots::after {
    content: '';
    animation: wcDots 1.2s steps(4, end) infinite;
}
@keyframes wcDots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
}

/* Result — 공통 game-result.css 사용 */
.state-result { background: #0f0f23; }
.state-result .wc-content {
    justify-content: flex-start;
    padding-top: 32px;
}

/* Toast */
.wc-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;
}
.wc-toast-show {
    opacity: 1;
    pointer-events: auto;
}

/* Feedback */
.wc-feedback {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    font-weight: 900;
    z-index: 100;
    animation: wcPop 0.5s ease forwards;
    pointer-events: none;
    text-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

@keyframes wcPop {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    50% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* Win / lose result banner */
.wc-game-over-banner {
    text-align: center;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 8px;
    font-size: 15px;
    font-weight: 700;
}
.wc-banner-win {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}
.wc-banner-lose {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}
