:root {
    --card-width: 400px;
    --mini-card-width: 200px;
    --card-title-text: 36px;
    --card-desc-text: 22px;
    --root-scale: 1;
}
@media (max-width: 700px) {
    :root {
        --card-width: 200px;
        --mini-card-width: 100px;
        --root-scale: 0.5;
    }
}
html, body {
    font-family: "Noto Sans KR", sans-serif;
    height: 100%;
    margin: 0;
}
body {
    display: flex;
    flex-direction: column;
}

footer {
    padding-bottom: 90px;
}
@media (max-width: 700px) {
    footer {
        padding-bottom: 60px;
    }
}

.navbar {
    position: sticky;   /* 스크롤해도 상단 고정 */
    top: 0;
    background: #111;
    color: white;

    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 5px 16px;
    z-index: 10;
    gap: 5px;

    font-size: 1.2rem;
}
@media (max-width: 610px) {
    .navbar {
        justify-content: center;
        gap: 10px 30px;
    }
}
.menu a {
    color: white;
    display: block;
    text-align: center;
    margin-left: 12px;
    text-decoration: none;
}

.search-area {
    display: flex;
    height: 30px;
}
.search-area input {
    flex: 1;
    font-size: 0.9rem;
}
.search-area button {
    flex-shrink: 0; /* 줄어들지 않게 */
}
.exp {
    text-align: center;
    font-size: 1rem;
}
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    padding: 12px 20px;
    border-radius: 10px;

    background: #f3f4f6;
    color: #222;

    font-size: 1rem;
    font-weight: 600;

    border: none;
    cursor: pointer;

    transition: all 0.2s ease;
}
.back-btn:hover {
    background: #e5e7eb;
    transform: translateX(-2px);
}
.back-btn:active {
    transform: scale(0.96);
}

.common-btn {
    display: inline-flex;
    align-self: center;
    padding: 10px 10px;
    background: #4f46e5;
    color: white;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    font-size: 1rem;
}
.common-btn:hover {
    background: #4338ca;
    transform: translateY(-2px);
}

.btn-auth {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 10px;
    background: #4caf50;
    color: white;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 500;
}
.btn-auth:hover {
    background: #43a047;
}

/* form이 레이아웃 깨는 거 방지 */
.auth-form {
    display: inline;
    margin: 0;
}

.content {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.game-layout {
    flex: 1;
    display: flex;
    height: 100%;
}

.left-menu {
    padding: 50px 0px;
    background: #111;
    width: 100px;
    flex-shrink: 0;

    text-align: right;
    padding-right: 20px;
}
.left-menu a {
    color: white;
    font-size: 1.2rem;
    display: block;
    padding: 20px 0;
    text-decoration: none;
}
.game-content {
    padding: 20px 10px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    justify-content: center;
}
.game-inner {
    width: 100%;
    max-width: 1000px;
}

.grid-section {
    display: grid;
    padding: 12px;
    grid-template-columns: repeat(auto-fit, minmax(var(--mini-card-width), var(--mini-card-width)));
    gap: 20px;
    overflow-x: auto;
    justify-content: center;
}

/* 광고 */
.ad-section {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f3f3f3;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 90px;
    z-index: 10;
}
@media (max-width: 700px) {
    .ad-section {
        height: 60px;
    }
}

.card-link {
    text-decoration: none;
    color: inherit;
    display: inline-block;
    cursor: pointer;
    transition: transform .2s ease;
}
.card-link:hover {
    transform: scale(1.03);
}
.card-link:active {
    transform: scale(0.96);
}

.game-container-horizontal {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}
.game-container-vertical {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.game-info {
    display: flex;
    gap: 12px;
    flex-direction: column;
    max-width: 550px;
}
.game-info h1 {
    font-size: 1.5rem;
    text-align: center;
    line-height: 1;
}
.game-info-table {
    display: grid;
    grid-template-columns: 120px 1fr;
    row-gap: 8px;
    column-gap: 12px;
    font-size: 1rem;
    align-content: start;
    padding: 10px 10px;
    margin-top: auto;
}
.game-info-table .value  {
    color: #222;
}
.game-info-table .label {
    font-weight: 600;
    color: #666;
}
.game-cover {
    height: 300px;
}
.game-cover img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.game-card {
    position: relative;
    width: var(--card-width);
    overflow: hidden;
    --scale: 1;
}
.game-card img {
    position: relative;
    width: 100%;
    display: block;
}
.game-card-mini {
    width: var(--mini-card-width);
    --scale: 0.5;
}
.game-card img {
    position: relative;
    width: 100%;
    display: block;
}
.game-card-border {
    position: relative;
    width: 100%;
    display: block;
    z-index: 5;
}
.game-card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1;
}

.game-card-img {
    position: absolute;
    inset: 2%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}
.game-card-img img {
    width: 100%;
    display: block;
}

.game-card-text-title {
    position: absolute;
    top: 5%;
    left: 5%;
    right: 5%;
    color: white;
    z-index: 4;
}
.game-card-text-title .title {
    text-align: center;
    margin: 0;
    font-size: calc(var(--card-title-text) * var(--root-scale) * var(--scale));
    text-shadow:
        0 calc(4px * var(--root-scale) * var(--scale)) calc(6px * var(--root-scale) * var(--scale)) rgba(0,0,0,1);
}
.game-card-text-title .desc {
    margin: 6px 0 0;
    font-size: calc(var(--card-desc-text) * var(--root-scale) * var(--scale));
    text-shadow:
        0 calc(4px * var(--root-scale) * var(--scale)) calc(6px * var(--root-scale) * var(--scale)) rgba(0,0,0,1);
}

.blur-area {
    position: absolute;
    bottom: 2%;
    left: 2%;
    right: 2%;
    height: 30%;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0),
        rgba(0,0,0,0.2),
        rgba(0,0,0,0.4)
    );
    z-index: 3;
}
.stat {
    position: absolute;
    left: 10%;
    right: 10%;
    display: grid;
    grid-template-columns: calc(100px * var(--root-scale) * var(--scale)) 1fr;
    align-items: center;
    z-index: 10;
}
.stat-label {
    font-family: 'Binggrae', sans-serif;
    font-size: calc(var(--card-desc-text) * var(--root-scale) * var(--scale));
    color: white;
    white-space: nowrap;
    text-shadow:
        0 calc(4px * var(--root-scale) * var(--scale)) calc(6px * var(--root-scale) * var(--scale)) rgba(0,0,0,1);
}
.stat-value {
    display: grid;
    grid-template-columns: repeat(5,1fr);
}
.stat-cell {
    height: calc(8px * var(--root-scale) * var(--scale));
    background: gray;
    border-radius: 2px;
    border: 1px solid rgba(255,255,255,0.12);
}
.stat-cell.active {
    background: linear-gradient(
        180deg,
        #2affaa 0%,
        #00c853 50%,
        #009944 100%
    );
    border: 1px solid rgba(255,255,255,0.25);
}
.card-option{
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.card-download-btn {
    display: inline-flex;
    align-self: center;
    padding: 5px 10px;
    background: gray;
    color: white;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    font-size: 1rem;
}
.score-toggle{
    position: relative;
    width: 120px;
    height: 30px;
    background: #222;
    border-radius: 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 12px;
    user-select: none;
}
.score-toggle span{
    flex:1;
    text-align:center;
    z-index:2;
    color:#bbb;
}
.score-toggle span.active{
    color:white;
}
.toggle-indicator{
    position:absolute;
    width:50%;
    height:100%;
    background:#4CAF50;
    border-radius:20px;
    transition: transform 0.25s ease;
}

.rating-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.rating-block {
    border-radius: 12px;
}
.rating-title {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 6px;
}
.star-rating {
    display: flex;
    gap: 6px;
    font-size: 34px;
    cursor: pointer;
    user-select: none;
    justify-content: center;
}
.star {
    color: #d1d5db;
    transition: 0.15s;
}
.star.active {
    color: gold;
}
.review-textarea {
    width: 100%;
    box-sizing: border-box;
    min-height: 120px;
    margin-top: 14px;
    padding: 10px;
    font-size: 1.0rem;
    border-radius: 8px;
    border: 1px solid #ddd;
    resize: vertical;
}
.review-textarea:focus {
    outline: none;
    border-color: #4f46e5;
}
.rating-value {
    font-size: 1rem;
    margin-top: 6px;
    color: #555;
}

/* board list page */
.post-content {
    line-height: 1.7;
    font-size: 1rem;
}
.post-content p {
    margin-bottom: 1rem;
}

.board-container {
    max-width: 900px;
}

.board-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #ffffff;
    margin-bottom: 16px;
    transition: box-shadow .15s ease, transform .15s ease;
}

.board-card:hover {
    box-shadow: 0 6px 18px rgba(0,0,0,.08);
    transform: translateY(-2px);
}

.board-card-link {
    display: block;
    padding: 16px 18px;
    color: inherit;
    text-decoration: none;
}

.board-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.board-title-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.board-title {
    font-weight: 600;
    font-size: 1rem;
}

.board-badge {
    background: #dc3545;
    color: white;
    font-size: 0.7rem;
    padding: 4px 7px;
    border-radius: 6px;
}

.board-private {
    background: #ffc107;
    color: #212529;
    font-size: 0.7rem;
    padding: 4px 7px;
    border-radius: 6px;
}

.board-date {
    font-size: .8rem;
    color: #6b7280;
    white-space: nowrap;
}

.board-meta {
    margin-top: 10px;
    font-size: .8rem;
    color: #6b7280;
    display: flex;
    gap: 14px;
}

/* board detail page */

.board-back-link {
    font-size: .85rem;
    color: #6b7280;
    text-decoration: none;
}

.board-back-link:hover {
    text-decoration: underline;
}

.board-detail {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: white;
    padding: 24px 26px;
}

.board-detail-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.board-detail-title-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.board-detail-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
}

.board-detail-meta {
    font-size: .85rem;
    color: #6b7280;
}

.board-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 20px 0;
}

.board-detail-content {
    line-height: 1.8;
    font-size: 1rem;
    color: #111827;
}

.board-detail-content p {
    margin-bottom: 1rem;
}

.board-detail-footer {
    display: flex;
    justify-content: flex-end;
}

.board-recommend-btn {
    border: 1px solid #2563eb;
    color: #2563eb;
    background: white;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: .85rem;
    cursor: pointer;
    transition: background .15s ease;
}

.board-recommend-btn:hover {
    background: #2563eb;
    color: white;
}

.pagination {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 8px 14px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 1.2rem;
}

.pagination a {
    background: #222;
    color: #fff;
    transition: 0.2s ease;
}

.pagination a:hover {
    background: #444;
}

.pagination span {
    font-size: 1.2rem;
}