/* ================================
   Font Face - Daeojamjil (더잠실체)
================================ */
@font-face {
    font-family: 'Daeojamjil';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2302_01@1.0/TheJamsil1Thin.woff2') format('woff2');
    font-weight: 100;
    font-display: swap;
}

@font-face {
    font-family: 'Daeojamjil';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2302_01@1.0/TheJamsil2Light.woff2') format('woff2');
    font-weight: 300;
    font-display: swap;
}

@font-face {
    font-family: 'Daeojamjil';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2302_01@1.0/TheJamsil3Regular.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'Daeojamjil';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2302_01@1.0/TheJamsil4Medium.woff2') format('woff2');
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: 'Daeojamjil';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2302_01@1.0/TheJamsil5Bold.woff2') format('woff2');
    font-weight: 700;
    font-display: swap;
}

@font-face {
    font-family: 'Daeojamjil';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2302_01@1.0/TheJamsil6ExtraBold.woff2') format('woff2');
    font-weight: 800;
    font-display: swap;
}

/* ================================
   CSS Variables
================================ */
:root {
    --bg-primary: #000000;
    --bg-secondary: #1a1a2e;
    --bg-card: #252542;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --accent-gold: #ffd700;
    --accent-blue: #00d4ff;
    --accent-red: #ff4757;
    --accent-green: #2ed573;
    --border-color: #3a3a5c;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* ================================
   Reset & Base
================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: 'Daeojamjil', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 400;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
}

/* ================================
   Layout
================================ */
#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ================================
   Header
================================ */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent-gold);
    letter-spacing: 2px;
}

.coin-display {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 700;
}

.coin-display i {
    color: var(--accent-gold);
}

#coin-amount {
    color: var(--accent-gold);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bank-btn {
    width: 40px;
    height: 40px;
    background: var(--bg-card);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-gold);
    font-size: 1.1rem;
}

.bank-btn:active {
    background: var(--accent-gold);
    color: #000;
}

/* ================================
   Main Content
================================ */
.main {
    flex: 1;
    padding: 20px;
    max-width: 400px;
    margin: 0 auto;
    width: 100%;
}

/* ================================
   Game Common Layout
================================ */
.game-section {
    padding: 0;
    margin-bottom: 20px;
}

.section-padding {
    padding-left: 20px;
    padding-right: 20px;
}

/* ================================
   Game Grid
================================ */
.game-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    max-width: 500px;
    margin: 0 auto;
}

.game-card {
    background: var(--bg-card);
    border-radius: 15px;
    padding: 25px 15px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border-color);
}

.game-card:active {
    transform: scale(0.95);
}

.game-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    color: var(--accent-blue);
}

.game-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.game-odds {
    font-size: 0.85rem;
    color: var(--accent-gold);
    font-weight: 500;
}

/* ================================
   Footer
================================ */
.footer {
    padding: 15px 20px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.footer-link {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-link:active {
    color: var(--accent-blue);
}

/* ================================
   Common Components
================================ */

/* 버튼 */
.btn {
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    transition: transform 0.1s, opacity 0.2s;
}

.btn:active {
    transform: scale(0.95);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-gold), #ffaa00);
    color: #fff;
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-danger {
    background: var(--accent-red);
    color: #fff;
}

.btn-success {
    background: var(--accent-green);
    color: #fff;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 시작 버튼 */
.start-section {
    margin-bottom: 15px;
}

.btn-start {
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* 입력 필드 */
.input {
    width: 100%;
    padding: 12px 15px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
}

.input:focus {
    border-color: var(--accent-blue);
    outline: none;
}

/* 배팅 관련 */
.bet-section {
    background: var(--bg-secondary);
    border-radius: 15px;
    padding: 15px;
    margin: 0 0 15px 0;
}

.bet-input-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.bet-input {
    flex: 1;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
}

.bet-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.bet-btn {
    flex: 1;
    min-width: 60px;
    padding: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
}

.bet-btn:active {
    background: var(--accent-blue);
    color: #fff;
}

/* 결과 표시 */
.result {
    text-align: center;
    padding: 20px;
    border-radius: 15px;
    margin: 20px 0;
    font-size: 1.2rem;
    font-weight: 700;
}

.result-win {
    background: rgba(46, 213, 115, 0.2);
    border: 2px solid var(--accent-green);
    color: var(--accent-green);
}

.result-lose {
    background: rgba(255, 71, 87, 0.2);
    border: 2px solid var(--accent-red);
    color: var(--accent-red);
}

/* 게임 페이지 헤더 */
.page-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.back-btn {
    font-size: 1.2rem;
    color: var(--text-secondary);
    background: none;
    padding: 5px;
}

.page-title {
    font-size: 1.2rem;
    font-weight: 700;
}

/* 유틸리티 */
.text-gold { color: var(--accent-gold); }
.text-blue { color: var(--accent-blue); }
.text-red { color: var(--accent-red); }
.text-green { color: var(--accent-green); }
.text-center { text-align: center; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
