* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Noto Sans KR", Arial, sans-serif;
    background: #f5f7fb;
    color: #222;
}

a {
    color: inherit;
    text-decoration: none;
}

.game-page {
    min-height: 100vh;
}

.game-header {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 50;
}

.game-header-inner {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    height: 68px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.game-logo {
    font-size: 20px;
    font-weight: 900;
    color: #2563eb;
    letter-spacing: -0.5px;
}

.game-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    white-space: nowrap;
}

.game-nav a {
    display: inline-flex;
    align-items: center;
    height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    color: #555;
}

.game-nav a.active,
.game-nav a:hover {
    background: #2563eb;
    color: #fff;
}

.game-container {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 30px 16px 70px;
}

.game-hero {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    border-radius: 26px;
    padding: 44px 32px;
    color: #fff;
    margin-bottom: 28px;
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.25);
}

.game-hero h1 {
    margin: 12px 0;
    font-size: 34px;
    font-weight: 900;
    letter-spacing: -1px;
}

.game-hero p {
    margin: 0;
    font-size: 16px;
    line-height: 1.7;
    opacity: 0.95;
}

.game-badge {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    color: inherit;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.5px;
}

.game-title-box {
    text-align: center;
    margin-bottom: 24px;
}

.game-title-box .game-badge {
    background: #dbeafe;
    color: #2563eb;
}

.game-title-box h1 {
    margin: 12px 0 8px;
    font-size: 32px;
    font-weight: 900;
}

.game-title-box p {
    margin: 0;
    color: #666;
    font-size: 15px;
}

.section-title {
    margin-bottom: 16px;
}

.section-title h2 {
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 900;
}

.section-title p {
    margin: 0;
    color: #777;
}

.game-card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.game-menu-card {
    background: #fff;
    border-radius: 22px;
    padding: 24px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.07);
    transition: 0.2s;
    min-height: 230px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.game-menu-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.12);
}

.game-menu-card.disabled {
    opacity: 0.55;
    cursor: default;
}

.game-menu-card.disabled:hover {
    transform: none;
}

.game-menu-icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    background: #eff6ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    margin-bottom: 18px;
}

.game-menu-content h3 {
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 900;
}

.game-menu-content p {
    margin: 0;
    color: #666;
    line-height: 1.6;
    font-size: 14px;
}

.game-menu-arrow {
    margin-top: 20px;
    font-weight: 900;
    color: #2563eb;
}

.game-box {
    background: #fff;
    border-radius: 22px;
    padding: 26px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-row label {
    font-weight: 800;
    font-size: 14px;
}

.form-row input {
    height: 46px;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 0 14px;
    font-size: 15px;
    outline: none;
    transition: 0.2s;
}

.form-row input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.btn-area {
    display: flex;
    gap: 10px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.btn-area.center {
    justify-content: center;
}

button,
.btn-link {
    border: 0;
    cursor: pointer;
    border-radius: 14px;
    min-height: 48px;
    padding: 0 22px;
    font-size: 15px;
    font-weight: 800;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: #2563eb;
    color: #fff;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-gray {
    background: #e5e7eb;
    color: #111827;
}

.btn-gray:hover {
    background: #d1d5db;
}

.btn-danger {
    background: #ef4444;
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-link {
    background: #2563eb;
    color: #fff;
    margin-top: 18px;
}

.input-section {
    margin-top: 28px;
    border-top: 1px solid #eef0f4;
    padding-top: 22px;
}

.sub-title {
    margin-bottom: 14px;
}

.sub-title h2 {
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 900;
}

.sub-title p {
    margin: 0;
    font-size: 14px;
    color: #777;
}

.name-area {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.notice {
    margin-top: 16px;
    font-size: 13px;
    color: #777;
    line-height: 1.6;
}

.status-box {
    text-align: center;
    background: #111827;
    color: #fff;
    padding: 18px;
    border-radius: 18px;
    margin-bottom: 24px;
    display: none;
}

.status-box strong {
    color: #facc15;
}
/* ==============================
   ·£´ý ¹úÄ¢ Ä«µå °ÔÀÓ
============================== */

.game-select {
    height: 46px;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 0 14px;
    font-size: 15px;
    outline: none;
    background: #fff;
}

.game-select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.card-stage {
    display: none;
    background: #fff;
    border-radius: 22px;
    padding: 26px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
}

.card-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.game-card {
    position: relative;
    display: block;
    width: 100%;
    height: 150px;
    min-height: 0;
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
    perspective: 1000px;
}

.game-card:focus {
    outline: none;
}

.game-card:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.35);
    outline-offset: 4px;
    border-radius: 18px;
}
.card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transition: transform 0.45s ease;
    transform-style: preserve-3d;
}

.card-front,
.card-back {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    padding: 12px;
    text-align: center;
    overflow: hidden;
}

.card-front {
    background: linear-gradient(145deg, #2563eb, #7c3aed);
    color: #fff;
    flex-direction: column;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.card-back {
    background: #fff;
    border: 2px solid #e5e7eb;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    visibility: hidden;
    transform: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

/* °ø°³µÈ Ä«µå */
.game-card.open .card-inner {
    transform: none;
}

.game-card.open .card-front {
    opacity: 0;
    visibility: hidden;
}

.game-card.open .card-back {
    opacity: 1;
    visibility: visible;
}
.card-question {
    font-size: 38px;
    font-weight: 900;
    line-height: 1;
}

.game-card.penalty-card .card-back {
    border-color: #fecdd3;
    background: #fff1f2;
}

.game-card.safe-card .card-back {
    border-color: #bfdbfe;
    background: #eff6ff;
}

.game-card.penalty-card .penalty {
    color: #ef4444;
}

.game-card.safe-card .safe {
    color: #2563eb;
}

.card-front-text {
    position: absolute;
    bottom: 18px;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 1px;
    opacity: 0.85;
}

.card-back .name {
    font-size: 20px;
    font-weight: 900;
    line-height: 1.25;
    word-break: keep-all;
}

.card-back .safe {
    color: #2563eb;
    font-weight: 900;
}

.card-back .penalty {
    color: #ef4444;
    font-weight: 900;
}

.penalty-text,
.safe-text {
    font-size: 14px;
    color: #555;
    line-height: 1.4;
    word-break: keep-all;
}

.game-card.done {
    cursor: not-allowed;
}

.game-card.done .card-inner {
    opacity: 0.96;
}

.game-card.penalty-card .card-back {
    border-color: #fecdd3;
    background: #fff1f2;
}

.game-card.shuffle {
    animation: shuffleCard 0.8s ease-in-out infinite;
}

@keyframes shuffleCard {
    0% {
        transform: rotate(0deg) translateY(0);
    }
    25% {
        transform: rotate(4deg) translateY(-6px);
    }
    50% {
        transform: rotate(-4deg) translateY(5px);
    }
    75% {
        transform: rotate(3deg) translateY(-3px);
    }
    100% {
        transform: rotate(0deg) translateY(0);
    }
}

.result-area {
    display: none;
    background: #fff;
    border-radius: 22px;
    padding: 26px;
    margin-top: 24px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.result-area h2 {
    margin: 0 0 16px;
    font-size: 22px;
}

.winner-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.winner-item {
    background: #fff1f2;
    border: 1px solid #fecdd3;
    border-radius: 14px;
    padding: 14px;
    font-weight: 900;
    color: #be123c;
}

.safe-result {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

#shareCardBtn:disabled,
#openAllBtn:disabled,
#openNextBtn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

@media (max-width: 900px) {
    .card-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .card-stage {
        padding: 20px 16px;
    }

    .card-stage .btn-area.center {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .card-stage .btn-area.center button {
        width: 100%;
        padding-left: 10px;
        padding-right: 10px;
    }

    .card-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .game-card {
        height: 132px;
    }

    .card-back .name {
        font-size: 18px;
    }
}

@media (max-width: 420px) {
    .card-stage .btn-area.center {
        grid-template-columns: 1fr;
    }

    .card-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .game-card {
        height: 118px;
    }

    .card-question {
        font-size: 32px;
    }

    .card-front-text {
        bottom: 12px;
    }

    .card-back .name {
        font-size: 16px;
    }

    .penalty-text,
    .safe-text {
        font-size: 13px;
    }
}

.game-card.safe-card .card-back {
    border-color: #bfdbfe;
    background: #eff6ff;
}

.game-card.safe-card .safe {
    color: #1d4ed8;
}

/* ==============================
   »ç´Ù¸® °ÔÀÓ
============================== */

.ladder-play-box {
    background: #fff;
    border-radius: 22px;
    padding: 26px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
}

.ladder-top-info {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.ladder-top-info h2 {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 900;
}

.ladder-top-info p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.ladder-action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.ladder-zoom-area {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.btn-small {
    border: 0;
    cursor: pointer;
    border-radius: 12px;
    min-height: 36px;
    padding: 0 13px;
    font-size: 13px;
    font-weight: 800;
    background: #e5e7eb;
    color: #111827;
}

.btn-small:hover {
    background: #d1d5db;
}

#ladderZoomText {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    height: 36px;
    border-radius: 12px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 900;
}

.ladder-scroll-guide {
    display: none;
    margin-bottom: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #c2410c;
    font-size: 13px;
    font-weight: 800;
}

.ladder-scroll-wrap {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 10px;
}

.ladder-board {
    min-width: 720px;
    margin: 0 auto;
    transition: transform 0.2s ease;
}

.ladder-name-row {
    display: grid;
    grid-template-columns: repeat(var(--ladder-count, 5), 1fr);
    gap: 10px;
    margin-bottom: 12px;
}

.ladder-name-row.bottom {
    margin-top: 12px;
    margin-bottom: 0;
}

.ladder-name-item {
    min-height: 44px;
    border: 0;
    border-radius: 14px;
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 900;
    font-size: 14px;
    padding: 8px 10px;
    cursor: pointer;
    word-break: keep-all;
    line-height: 1.3;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: 0.2s;
}

.ladder-name-item:hover {
    background: #dbeafe;
    transform: translateY(-2px);
}

.ladder-name-item.result {
    background: #f3f4f6;
    color: #111827;
    cursor: default;
}

.ladder-name-item.result:hover {
    transform: none;
}

.ladder-name-item.active {
    background: #ef4444;
    color: #fff;
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.25);
}

.ladder-name-item.done {
    background: #e5e7eb;
    color: #6b7280;
    cursor: not-allowed;
    opacity: 0.8;
}

.ladder-name-item.done:hover {
    transform: none;
}

.ladder-canvas-wrap {
    width: 100%;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 12px;
}

#ladderCanvas {
    display: block;
    width: 100%;
    height: auto;
}

.ladder-result-area {
    display: none;
}

@media (max-width: 768px) {
    .ladder-top-info {
        flex-direction: column;
    }

    .ladder-action-buttons {
        width: 100%;
        justify-content: flex-start;
    }

    .ladder-action-buttons button {
        flex: 1 1 calc(50% - 8px);
    }

    .ladder-play-box {
        padding: 20px 16px;
    }

    .ladder-name-item {
        font-size: 13px;
        min-height: 42px;
    }

    .ladder-zoom-area {
        justify-content: center;
    }
}

@media (max-width: 420px) {
    .ladder-action-buttons button {
        flex: 1 1 100%;
    }

    .btn-small {
        flex: 1;
    }
}

/* ==============================
   SEO º»¹® ¿µ¿ª
============================== */

.seo-content-box {
    background: #fff;
    border-radius: 22px;
    padding: 30px;
    margin-top: 28px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    line-height: 1.8;
}

.seo-content-box h2 {
    margin: 28px 0 10px;
    font-size: 22px;
    font-weight: 900;
    color: #111827;
}

.seo-content-box h2:first-child {
    margin-top: 0;
}

.seo-content-box p {
    margin: 0 0 14px;
    color: #4b5563;
    font-size: 15px;
}

@media (max-width: 768px) {
    .seo-content-box {
        padding: 22px 18px;
    }

    .seo-content-box h2 {
        font-size: 19px;
    }

    .seo-content-box p {
        font-size: 14px;
    }
}


	.calc-ad-wrap {
		margin: 0 0 18px;
		padding: 14px;
		border-radius: 18px;
		background: #ffffff;
		border: 1px solid var(--calc-border);
		box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
		text-align: center;
		overflow: hidden;
	}

	.calc-ad-wrap.bottom {
		margin: 22px 0 0;
	}

	.calc-ad-label {
		margin: 0 0 8px;
		font-size: 12px;
		font-weight: 800;
		color: var(--calc-muted);
		text-align: center;
	}

	.calc-coupang-ad {
		max-width: 100%;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	.calc-kakao-ad {
		display: flex;
		justify-content: center;
		align-items: center;
		min-height: 250px;
	}
