/* 직접 수정할 CSS. 이 파일은 마지막에 로드됩니다.
   예: :root { --accent: #d5aa64; }
   모바일: @media (max-width: 760px) { ... }
   향후 업데이트 때 이 파일은 보존하세요. */

/* 화면마다 스크롤바가 생기고 사라지면서 좌우로 움직이는 현상 방지 , 웹뷰 자동확대 제한 */ 
html {
    overflow-y: scroll;
    scrollbar-gutter: stable;

    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

.site-header .brand-icon {
    width: 24px;
    height: 24px;
    display: block;
    object-fit: contain;
    flex: 0 0 24px;
}


@media (max-width: 760px) {
    .site-header .brand-icon {
        width: 21px;
        height: 21px;
        flex-basis: 21px;
    }
}

/* 게임 최초 로딩 화면 */
.loading.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    min-height: 430px;
    padding: 55px 20px;

    text-align: center;
}

/* 농구공과 회전 테두리 */
.loading-mark {
    position: relative;

    display: grid;
    place-items: center;

    width: 62px;
    height: 62px;
    margin-bottom: 19px;
}

.loading-mark img {
    display: block;
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

/* 농구공 바깥쪽 회전 원 */
.loading-mark::before {
    content: "";

    position: absolute;
    inset: 0;

    border: 2px solid rgba(216, 174, 112, 0.16);
    border-top-color: var(--accent);
    border-right-color: rgba(216, 174, 112, 0.55);
    border-radius: 50%;

    animation: court-loading 0.9s linear infinite;
}

.loading-screen .eyebrow {
    margin: 0 0 7px;
    color: var(--accent);
    font-size: 9px;
    letter-spacing: 2.5px;
}

.loading-screen h1 {
    margin: 0 0 15px;
    font-size: 30px;
}

.loading-copy {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.8;
}

.loading-status {
    margin: 18px 0 0;
    color: #cdbb9e;
    font-size: 10px;
    letter-spacing: 0.2px;
}

.loading-dots {
    display: inline-block;
    width: 12px;
    overflow: hidden;
    vertical-align: bottom;

    animation: loading-dots 1.2s steps(4, end) infinite;
}

@keyframes court-loading {
    to {
        transform: rotate(360deg);
    }
}

@keyframes loading-dots {
    from {
        width: 0;
    }

    to {
        width: 12px;
    }
}

@media (max-width: 760px) {
    .loading.loading-screen {
        min-height: 55svh;
        padding: 38px 16px;
    }

    .loading-mark {
        width: 54px;
        height: 54px;
        margin-bottom: 16px;
    }

    .loading-mark img {
        width: 35px;
        height: 35px;
    }

    .loading-screen h1 {
        margin-bottom: 12px;
        font-size: 26px;
    }

    .loading-copy {
        font-size: 11px;
    }

    .loading-status {
        margin-top: 15px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .loading-mark::before,
    .loading-dots {
        animation: none;
    }
}

/* PC에서는 왕조 5개를 모두 표시 */
@media (min-width: 761px) {
    .boss-list {
        overflow-x: visible;
    }

    .boss-list .boss-option {
        flex: 1 1 0;
        min-width: 0;
    }
}

/* 모바일에서는 오른쪽 끝을 흐리게 하여 가로 영역임을 표현 */
@media (max-width: 760px) {
    .boss-list {
        padding-right: 28px;

        -webkit-mask-image: linear-gradient(
            to right,
            #000 0,
            #000 calc(100% - 25px),
            transparent 100%
        );

        mask-image: linear-gradient(
            to right,
            #000 0,
            #000 calc(100% - 25px),
            transparent 100%
        );
    }
}

/* 왕조 선택 카드 기본 모양 */
.boss-list .boss-option {
    background:
        linear-gradient(145deg, #403027 0%, #2e241e 100%);
    border: 1px solid #66503d;
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

/* 선택된 왕조 */
.boss-list .boss-option.selected {
    background:
        radial-gradient(
            circle at 50% 0%,
            rgba(222, 178, 105, 0.32) 0%,
            transparent 62%
        ),
        linear-gradient(
            145deg,
            #62482f 0%,
            #39291f 100%
        );

    border-color: #e0b46d;
    outline: 1px solid rgba(224, 180, 109, 0.42);
    outline-offset: 2px;

    box-shadow:
        0 0 0 1px rgba(255, 221, 163, 0.12) inset,
        0 7px 18px rgba(0, 0, 0, 0.3),
        0 0 16px rgba(205, 150, 73, 0.16);

    transform: translateY(-2px);
}

/* 마우스를 올렸을 때 */
.boss-list .boss-option:not(.selected):hover {
    border-color: #a78150;
    background:
        linear-gradient(145deg, #4d392a 0%, #352820 100%);
}

/* 키보드로 선택할 때 */
.boss-list .boss-option:focus-visible {
    outline: 2px solid #efc77f;
    outline-offset: 3px;
}

/* 선택된 왕조의 큰 카드 */
.boss-preview {
    background:
        radial-gradient(
            circle at 50% 5%,
            rgba(220, 166, 86, 0.27) 0%,
            transparent 48%
        ),
        radial-gradient(
            circle at 100% 100%,
            rgba(145, 83, 41, 0.2) 0%,
            transparent 52%
        ),
        linear-gradient(
            145deg,
            #5a402c 0%,
            #35261d 52%,
            #241c17 100%
        );

    border-color: #c99b58;
    outline: 1px solid rgba(205, 159, 91, 0.28);
    outline-offset: 3px;

    box-shadow:
        0 0 0 1px rgba(255, 225, 172, 0.08) inset,
        0 14px 32px rgba(0, 0, 0, 0.3),
        0 0 24px rgba(174, 116, 53, 0.1);
}

/* 후보 다시 뽑기 버튼 */
.draft-heading .text-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;

    height: 28px;
    min-height: 0;
    margin-left: 10px;
    padding: 0 10px;

    border: 1px solid #80664b;
    border-radius: 999px;

    background:
        linear-gradient(
            180deg,
            rgba(116, 86, 57, 0.35),
            rgba(63, 47, 37, 0.35)
        );

    color: #d8c3a2;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.2px;
    white-space: nowrap;

    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.05) inset,
        0 2px 5px rgba(0, 0, 0, 0.12);

    transition:
        color 0.15s ease,
        border-color 0.15s ease,
        background 0.15s ease;
}

/* 마우스를 올렸을 때 */
.draft-heading .text-button:not(:disabled):hover {
    color: #f2d9ad;
    border-color: #bd925a;
    background:
        linear-gradient(
            180deg,
            rgba(144, 103, 59, 0.48),
            rgba(72, 51, 37, 0.48)
        );
}

/* 키보드 선택 */
.draft-heading .text-button:focus-visible {
    outline: 2px solid rgba(224, 180, 109, 0.75);
    outline-offset: 2px;
}

/* 패스를 사용한 뒤 */
.draft-heading .text-button:disabled {
    color: #897966;
    border-color: #57493c;
    background: rgba(50, 40, 33, 0.35);
    box-shadow: none;
    cursor: default;
    opacity: 0.75;
}

.draft-heading .text-button {
    transform: translateY(3px);
}

@media (max-width: 760px) {
    .draft-heading .text-button {
        transform: translateY(9px);
    }
}

/* PC에서는 기존 위치 정보를 유지 */
.mobile-card-meta {
    display: none;
}

@media (max-width: 760px) {
    /* 카드 상단: 팀 / 포지션·시즌 / 티어 */
    .player-card .card-top {
        display: grid;
        grid-template-columns: auto 1fr auto;
        align-items: center;
        gap: 6px;
    }

    .player-card .mobile-card-meta {
        display: block;
        color: #bca889;
        font-size: 9px;
        font-weight: 700;
        line-height: 1;
        text-align: center;
        white-space: nowrap;
    }

    /* 모바일에서는 이름 아래 포지션·시즌 제거 */
    .player-card .position-label {
        display: none;
    }

    /* 소환 카드 전체 높이 축소 */
    .draft-screen .player-card {
        padding: 15px 16px;
    }

    .draft-screen .player-card h2 {
        min-height: 44px;
        margin: 14px 0 10px;
        font-size: 24px;
        line-height: 1.2;
    }

    /* 기록 영역 축소 */
    .draft-screen .real-primary {
        padding: 11px 0;
    }

    .draft-screen .real-primary b {
        margin-bottom: 3px;
        font-size: 24px;
        line-height: 1.15;
    }

    /* 역할 설명 영역 */
    .draft-screen .player-role {
        min-height: 34px;
        margin: 11px 0;

        font-size: 11px;
        line-height: 1.5;
    }

    /* 선수 선택 버튼 */
    .draft-screen .player-card .secondary {
        min-height: 42px;
        padding: 0 12px;
        font-size: 12px;
    }

    /* 카드 위아래 여백 */
    .draft-screen [data-carousel] {
        padding-top: 8px;
        padding-bottom: 9px;
    }

    .draft-screen .carousel-position {
        min-height: 18px;
        line-height: 18px;
    }

    /* 포지션 영역은 현재 크기 유지 */
    .draft-screen .roster-panel {
        margin-top: 7px;
        padding-top: 10px;
        padding-bottom: 10px;
    }

}

@media (max-width: 760px) {
    /* 스크롤 도중 등장 애니메이션이 다시 실행되는 현상 방지 */
    .draft-screen [data-carousel] > .candidate-arrive {
        animation: none !important;
    }

    /* 좌우에 있는 선수 카드 */
    .draft-screen [data-carousel] > .player-card {
        opacity: 0.48;
        transform: scale(0.95);

        transition:
            opacity 0.25s ease,
            transform 0.25s ease;

        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
        will-change: opacity, transform;
    }

    /* 현재 가운데 있는 선수 카드 */
    .draft-screen [data-carousel] > .player-card.is-current {
        opacity: 1;
        transform: scale(1);
    }
}

/* 마지막 두 자리 — PC에서 카드 3장 한 줄 */
@media (min-width: 761px) {
    .roles-screen .role-options {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .roles-screen .role-card {
        padding: 16px;
    }

    .roles-screen .role-person {
        gap: 10px;
        padding: 13px 0;
    }

    .roles-screen .role-person h2 {
        font-size: 18px;
        line-height: 1.25;
    }
}

@media (max-width: 760px) {
    /* 화면 제목 아래 여백 */
    .roles-screen > h1 {
        margin-bottom: 9px;
    }

    /* 스크롤할 때 카드 애니메이션이 다시 실행되는 현상 제거 */
    .roles-screen [data-carousel] > .candidate-arrive {
        animation: none !important;
    }

    /* 좌우 조합 카드 */
    .roles-screen [data-carousel] > .role-card {
        opacity: 0.48;
        transform: scale(0.95);

        transition:
            opacity 0.25s ease,
            transform 0.25s ease;

        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
        will-change: opacity, transform;
    }

    /* 가운데 조합 카드 */
    .roles-screen [data-carousel] > .role-card.is-current {
        opacity: 1;
        transform: scale(1);
    }

    /* 카드 전체 여백 */
    .roles-screen .role-card {
        padding: 9px 14px;
    }

    /* 카드 안의 선수 한 명 영역 */
    .roles-screen .role-person {
        display: grid;
        grid-template-columns: 30px minmax(0, 1fr);
        align-items: center;
        gap: 9px;

        padding: 8px 0;
    }

    /* 두 선수 사이 구분선 */
    .roles-screen .role-person + .role-person {
        border-top: 1px solid rgba(216, 174, 112, 0.16);
    }

    /* 포지션 원 */
    .roles-screen .role-position {
        width: 30px;
        height: 30px;
        font-size: 9px;
    }

    /* 선수 이름 */
    .roles-screen .role-person h2 {
        margin: 0 0 4px;
        font-size: 17px;
        line-height: 1.2;
    }

    /* 포지션·시즌 */
    .roles-screen .role-person small {
        font-size: 9px;
        line-height: 1.35;
    }

    /* 선수 기록 */
    .roles-screen .role-person p {
        margin: 3px 0 0;
        font-size: 9px;
        line-height: 1.35;
    }

    /* 조합 선택 버튼 */
    .roles-screen .role-card > .secondary {
        min-height: 39px;
        margin-top: 8px;
        padding: 0 12px;
        font-size: 11px;
    }

    /* 카드 스크롤 영역의 위아래 여백 */
    .roles-screen [data-carousel] {
        padding-top: 6px;
        padding-bottom: 6px;
    }

    .roles-screen .carousel-position {
        min-height: 16px;
        line-height: 16px;
    }

    /* 포지션 5칸 영역을 카드에 가까이 배치 */
    .roles-screen .roster-panel {
        margin-top: 6px;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .roles-screen .roster-row {
        gap: 3px;
    }
}

@media (max-width: 760px) {
    .roles-screen > h1 {
        margin-bottom: 0;
    }

    .roles-screen > .draft-meta {
        margin: 4px 0 8px;
    }
}

@media (max-width: 760px) {
    /* 전략 화면 제목 */
    .strategy-screen > h1 {
        margin-bottom: 10px;
    }

    /* 완성된 포지션 영역 */
    .strategy-screen .roster-panel {
        margin-top: 6px;
        padding-top: 9px;
        padding-bottom: 9px;
    }

    /* 전략 선택 전체 영역 */
    .strategy-screen .strategy-picker {
        margin: 10px 0;
    }

    /* 전략 선택 제목 */
    .strategy-screen .strategy-picker > summary {
        min-height: 42px;
        padding: 11px 14px;
        align-items: center;
        font-size: 13px;
    }

    /* 전략을 2열로 배치 */
    .strategy-screen .strategy-options {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* 전략 버튼 */
    .strategy-screen .strategy-choice {
        align-items: center;
        justify-content: center;

        min-height: 42px;
        padding: 8px 7px;

        text-align: center;
        border-top: 1px solid var(--line);
    }

    /* 오른쪽 열의 세로 구분선 */
    .strategy-screen .strategy-choice:nth-child(even) {
        border-left: 1px solid var(--line);
    }

    /* 마지막 오른쪽 빈칸을 자연스럽게 표시 */
    .strategy-screen .strategy-options::after {
        content: "";
        min-height: 42px;

        border-top: 1px solid var(--line);
        border-left: 1px solid var(--line);

        background: rgba(0, 0, 0, 0.06);
        pointer-events: none;
    }

    /* 모바일에서는 전략 상세 설명 숨김 */
    .strategy-screen .strategy-choice small {
        display: none;
    }

    .strategy-screen .strategy-choice strong {
        font-size: 12px;
        line-height: 1.3;
    }
}

/* 새 경기 결과 카드 등장 */
.game-log.reveal-game {
    animation: game-card-reveal 0.4s ease-out both !important;
}

@keyframes game-card-reveal {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 움직임 줄이기를 설정한 사용자 */
@media (prefers-reduced-motion: reduce) {
    .game-log.reveal-game {
        animation: none !important;
    }
}

/* 마지막 경기 카드도 처음부터 절반 너비로 표시 */
.game-logs .game-log:last-child {
    grid-column: auto;
}

/* 결과 화면의 세 버튼 — PC */
.result-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;

    width: 100%;
    max-width: 850px;
    margin: 20px auto 8px;
}

.result-actions > button {
    width: 100%;
    min-width: 0;
    margin: 0;
}

.result-share-hint {
    margin: 0 auto 20px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.6;
    text-align: center;
}

/* 결과 화면의 세 버튼 — 모바일 */
@media (max-width: 760px) {
    .result-actions {
        grid-template-columns: 1fr;
        gap: 8px;

        margin-top: 14px;
    }

    .result-actions > button {
        width: 100%;
        min-width: 0;
    }

    .result-share-hint {
        margin-bottom: 15px;
        font-size: 9px;
    }
}

/* 경기 카드와 현재 시리즈 스코어 사이 간격 */
.game-logs + .series-progress {
    margin-top: 20px;
}

@media (max-width: 760px) {
    .game-logs + .series-progress {
        margin-top: 14px;
    }
}

@media (max-width: 760px) {
    /* 전략 선택 화면에서는 푸터가 첫 화면 아래에 위치하도록 */
    main.game-main:has(.strategy-screen) {
        min-height: 100svh;
    }
}

@media (max-width: 760px) {
  #share-dialog {
    width: min(96vw, 460px);
    padding: 26px 16px;
  }

  #share-summary {
    white-space: nowrap;
    font-size: 12px;
    line-height: 1.45;
    letter-spacing: -0.25px;
  }
}

@media (max-width: 350px) {
  #share-summary {
    font-size: 10.5px;
  }
}

#share-dialog [data-share="native"].is-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  cursor: wait;
  opacity: 0.85;
}

.share-spinner {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: share-button-spin 0.75s linear infinite;
}

@keyframes share-button-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .share-spinner {
    animation-duration: 1.5s;
  }
}

@media (max-width: 760px) {
  .stream-game strong {
    min-width: 0;
    font-size: 18px;
    white-space: nowrap;
  }

  .stream-game .outcome {
    flex: 0 0 auto;
    min-width: 0;
    padding: 4px 6px;
    font-size: 10px;
    line-height: 1;
    letter-spacing: 0;
    white-space: nowrap;
    box-sizing: border-box;
  }

  .stream-game .outcome:not(.win) {
    padding-inline: 5px;
    font-size: 9px;
    letter-spacing: -0.2px;
  }
}

.series-progress .game-seven {
  display: block;
  margin-top: 12px;
}

@media (max-width: 760px) {
  .series-progress .game-seven {
    margin-top: 16px;
  }
}

button[aria-disabled="true"] {
  opacity: 0.48;
  cursor: not-allowed;
  filter: grayscale(0.3);
}

@media (max-width: 760px) {
  #notice {
    width: max-content;
    min-width: 240px;
    max-width: calc(100vw - 24px);
    padding-left: 18px;
    padding-right: 18px;
    white-space: nowrap;
    text-align: center;
    box-sizing: border-box;
  }
}

/* 건의하기 페이지 */
.feedback-page {
  width: min(100% - 32px, 760px);
}

.feedback-form,
.feedback-complete {
  position: relative;
  margin-top: 28px;
  padding: 26px;
  border: 1px solid rgba(213, 170, 100, 0.32);
  border-radius: 18px;
  background: rgba(18, 13, 10, 0.78);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.24);
}

.feedback-form label {
  display: block;
  margin-bottom: 10px;
  color: var(--accent, #d5aa64);
  font-weight: 800;
}

.feedback-form textarea {
  display: block;
  width: 100%;
  min-height: 220px;
  resize: vertical;
  box-sizing: border-box;
  padding: 16px;
  border: 1px solid rgba(213, 170, 100, 0.35);
  border-radius: 12px;
  outline: none;
  background: rgba(7, 5, 4, 0.72);
  color: #f5ead8;
  font: inherit;
  line-height: 1.7;
}

.feedback-form textarea:focus {
  border-color: var(--accent, #d5aa64);
  box-shadow: 0 0 0 3px rgba(213, 170, 100, 0.13);
}

.feedback-form-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 10px 2px 20px;
  color: rgba(245, 234, 216, 0.66);
}

.feedback-form-meta span {
  flex: 0 0 auto;
  font-size: 12px;
}

.feedback-error {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid rgba(220, 96, 86, 0.45);
  border-radius: 10px;
  background: rgba(117, 27, 22, 0.24);
  color: #ffd4ce;
}

.feedback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.feedback-trap {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
}

@media (max-width: 760px) {
  .feedback-page {
    width: min(100% - 24px, 760px);
  }

  .feedback-form,
  .feedback-complete {
    margin-top: 20px;
    padding: 20px 16px;
    border-radius: 14px;
  }

  .feedback-form textarea {
    min-height: 200px;
  }

  .feedback-form-meta {
    display: block;
  }

  .feedback-form-meta span {
    display: block;
    margin-top: 6px;
    text-align: right;
  }

  .feedback-actions {
    display: grid;
  }
}

body {
  background-color: #241d19;
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent 0 132px,
      rgba(17, 11, 7, 0.28) 133px 135px
    ),
	/* 질감을 더 은은하게 하려면 알파값을 높이기 */
    linear-gradient(
      120deg,
      rgba(51, 39, 31, 0.62),
      rgba(33, 27, 23, 0.70) 70%,
      rgba(48, 35, 27, 0.64)
    ),
    url("/assets/vintage-texture.webp");	/* 배경이미지 */

  background-repeat: repeat, repeat, repeat;
  background-size: auto, auto, 800px 800px;
  background-position: 0 0, 0 0, center top;
}

@media (max-width: 760px) {
  body {
    background-size: auto, auto, 960px 960px;
  }
}

/* 본문 배경 질감 */
.game-main,
.info-page {
  background:
    linear-gradient(
      145deg,
      rgba(52, 39, 31, 0.74),
      rgba(35, 27, 22, 0.68)
    );
  box-shadow:
    0 18px 55px rgba(0, 0, 0, 0.22),
    inset 0 0 0 1px rgba(213, 170, 100, 0.06);
}

/* 소환 카드용 낡은 종이 질감
   기존 카드 그라데이션은 그대로 두고, 이 이미지만 위에 얹습니다. 
   - 질감이 약하면 opacity: 0.18을 0.22 정도로 올립니다.
   - 질감이 강하면 opacity: 0.18을 0.10~0.14로 내립니다.
   - 모바일 값은 @media 안의 opacity: 0.15에서 따로 조절합니다.
*/
.player-card,
.role-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.player-card::before,
.role-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: url("/assets/card-paper-texture.webp") center / cover no-repeat;

  mix-blend-mode: multiply;
  filter: contrast(1.55) brightness(0.90);
  opacity: 0.75;
}

/* 카드마다 같은 얼룩이 반복되어 보이지 않게 위치를 조금씩 바꿉니다. */
.player-card:nth-child(2)::before,
.role-card:nth-child(2)::before {
  background-position: 35% 65%;
  transform: scaleX(-1);
}

.player-card:nth-child(3)::before,
.role-card:nth-child(3)::before {
  background-position: 70% 30%;
  transform: scaleY(-1);
}

/* 카드 안의 글자와 버튼은 질감보다 위에 표시합니다. */
.player-card > *,
.role-card > * {
  position: relative;
  z-index: 1;
}

/* 작은 화면에서는 글자 주변의 질감을 조금 더 얌전하게 표시합니다. */
@media (max-width: 760px) {
  .player-card::before,
  .role-card::before {
    opacity: 0.70;
  }
}

/* 메인페이지 하단 게임 소개 */
.home-intro {
  box-sizing: border-box;

  /* 왕조 선택 영역과 같은 폭 */
  width: 100%;
  max-width: 680px;
  margin: 26px auto 12px;
  padding: 24px 28px;

  color: rgba(245, 230, 204, 0.72);

  background:
    linear-gradient(
      135deg,
      rgba(62, 39, 27, 0.72),
      rgba(35, 23, 17, 0.82)
    );

  border: 1px solid rgba(211, 169, 96, 0.16);
  border-radius: 16px;

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 12px 30px rgba(14, 8, 5, 0.14);
}

/* 왕조 선택 화면이 아닐 때 숨김 */
.home-intro[hidden] {
  display: none !important;
}

/* ABOUT THE GAME */
.home-intro-label {
  margin: 0 0 7px;
  color: rgba(203, 166, 108, 0.65);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

/* 소개 제목 */
.home-intro h2 {
  margin: 5px 0 13px;
  color: rgba(240, 216, 174, 0.60);
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  line-height: 1.35;
}

/* 소개 본문 */
.home-intro p {
  max-width: 720px;
  margin: 8px 0 0;
  color: rgba(241, 225, 200, 0.55);
  font-size: 0.92rem;
  line-height: 1.75;
  word-break: keep-all;
}

/* 게임 이름 강조 */
.home-intro strong {
  color: rgba(242, 214, 164, 0.78);
}

/* 모바일 */
@media (max-width: 760px) {
  .home-intro {
    width: 100%;
    max-width: none;
    margin: 20px auto 8px;
    padding: 19px 17px;
    border-radius: 14px;
  }

  .home-intro h2 {
    font-size: 1.08rem;
  }

  .home-intro p {
    font-size: 0.84rem;
    line-height: 1.65;
  }
}

/* 왕조 기록실  */
.dynasty-page {
  max-width: 950px;
}

.dynasty-hero {
  display: block;
  height: auto;
  padding: 0;
  border: 0;
  max-width: 780px;
  margin: 0 auto 38px;
  text-align: center;
}

.dynasty-hero .intro {
  margin-bottom: 18px;
}

.dynasty-preface {
  margin: 0;
  color: rgba(238, 221, 194, 0.68);
  font-size: 0.9rem;
  line-height: 1.85;
  word-break: keep-all;
}

.dynasty-list {
  display: grid;
  gap: 28px;
}

.dynasty-card {
  position: relative;
  overflow: hidden;
  padding: 34px;
  color: rgba(244, 230, 207, 0.82);
  background:
    linear-gradient(145deg, rgba(67, 43, 30, 0.9), rgba(32, 21, 16, 0.94));
  border: 1px solid rgba(211, 169, 96, 0.2);
  border-radius: 18px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    0 18px 42px rgba(12, 7, 4, 0.18);
}

.dynasty-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: url("/assets/card-paper-texture.webp") center / cover no-repeat;
  mix-blend-mode: multiply;
  filter: contrast(1.25) brightness(0.9);
  opacity: 0.28;
}

.dynasty-card > * {
  position: relative;
  z-index: 1;
}

.dynasty-heading {
  display: flex;
  height: auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 0 0 22px;
  border-bottom: 1px solid rgba(221, 184, 125, 0.18);
}

.dynasty-number {
  margin: 0 0 9px;
  color: rgba(213, 174, 107, 0.7);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.dynasty-heading h2 {
  margin: 0;
  color: rgba(248, 226, 188, 0.94);
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1.25;
  letter-spacing: -0.035em;
}

.dynasty-subtitle {
  margin: 9px 0 0;
  color: rgba(235, 214, 183, 0.62);
  font-size: 0.88rem;
}

.dynasty-record {
  flex: 0 0 auto;
  margin: 2px 0 0;
  text-align: right;
}

.dynasty-record strong {
  display: block;
  color: #d7ad69;
  font-size: 1.7rem;
  line-height: 1;
}

.dynasty-record span {
  display: block;
  margin-top: 8px;
  color: rgba(231, 210, 176, 0.5);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.dynasty-five {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  margin: 24px 0 27px;
  overflow: hidden;
  border: 1px solid rgba(211, 169, 96, 0.16);
  border-radius: 10px;
  background: rgba(211, 169, 96, 0.12);
}

.dynasty-five span {
  min-width: 0;
  padding: 13px 9px;
  background: rgba(25, 16, 12, 0.58);
  color: rgba(244, 228, 202, 0.78);
  font-size: 0.72rem;
  line-height: 1.4;
  text-align: center;
  overflow-wrap: anywhere;
}

.dynasty-five b {
  display: block;
  margin-bottom: 5px;
  color: #d2a760;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
}

.dynasty-story {
  max-width: 790px;
}

.dynasty-story p {
  margin: 0 0 15px;
  color: rgba(241, 225, 201, 0.72);
  font-size: 0.94rem;
  line-height: 1.88;
  word-break: keep-all;
}

.dynasty-tribute {
  margin: 26px 0 20px;
  padding: 19px 21px;
  color: rgba(248, 222, 177, 0.9);
  background: rgba(14, 9, 7, 0.35);
  border: 0;
  border-left: 3px solid rgba(213, 170, 99, 0.7);
  border-radius: 0 10px 10px 0;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.8;
  word-break: keep-all;
}

.dynasty-memory {
  margin: 0;
  padding-top: 18px;
  color: rgba(230, 213, 188, 0.57);
  border-top: 1px dashed rgba(211, 169, 96, 0.18);
  font-size: 0.8rem;
  line-height: 1.75;
  word-break: keep-all;
}

.dynasty-memory span {
  display: inline-block;
  margin-right: 8px;
  color: rgba(213, 170, 99, 0.78);
  font-weight: 800;
}

.dynasty-closing {
  max-width: 780px;
  margin: 38px auto 8px;
  padding: 30px 20px 10px;
  text-align: center;
}

.dynasty-closing h2 {
  color: rgba(245, 222, 184, 0.9);
}

.dynasty-closing p {
  color: rgba(238, 221, 194, 0.65);
  font-size: 0.92rem;
  line-height: 1.85;
  word-break: keep-all;
}

.dynasty-closing .primary {
  margin-top: 14px;
}

@media (max-width: 760px) {
  .dynasty-hero {
    margin-bottom: 25px;
    text-align: left;
  }

  .dynasty-preface {
    font-size: 0.82rem;
    line-height: 1.7;
  }

  .dynasty-list {
    gap: 18px;
  }

  .dynasty-card {
    padding: 21px 17px;
    border-radius: 14px;
  }

  .dynasty-card::before {
    opacity: 0.22;
  }

  .dynasty-heading {
    display: block;
    padding-bottom: 17px;
  }

  .dynasty-heading h2 {
    font-size: 1.32rem;
  }

  .dynasty-subtitle {
    font-size: 0.78rem;
  }

  .dynasty-record {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    text-align: left;
  }

  .dynasty-record strong {
    font-size: 1.3rem;
  }

  .dynasty-record span {
    margin: 0;
  }

  .dynasty-five {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin: 18px 0 21px;
  }

  .dynasty-five span {
    padding: 10px 3px;
    font-size: 0.57rem;
    line-height: 1.35;
  }

  .dynasty-five b {
    font-size: 0.55rem;
  }

  .dynasty-story p {
    margin-bottom: 13px;
    font-size: 0.83rem;
    line-height: 1.75;
  }

  .dynasty-tribute {
    margin: 21px 0 17px;
    padding: 16px 15px;
    font-size: 0.88rem;
    line-height: 1.7;
  }

  .dynasty-memory {
    font-size: 0.72rem;
    line-height: 1.65;
  }

  .dynasty-memory span {
    display: block;
    margin: 0 0 5px;
  }

  .dynasty-closing {
    margin-top: 26px;
    padding-inline: 6px;
  }

  .dynasty-closing p {
    font-size: 0.82rem;
    line-height: 1.72;
  }
}

.dynasty-hero {
  display: block;
  height: auto;
  padding: 0;
  border: 0;
}

.dynasty-heading {
  height: auto;
  padding: 0 0 22px;
}

/* 선택한 왕조의 큰 카드: 대표 주전 5명 */
.boss-lineup {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0 0 17px;
  overflow: hidden;
  background: rgba(20, 13, 9, 0.2);
  border-top: 1px solid rgba(232, 193, 133, 0.22);
  border-bottom: 1px solid rgba(232, 193, 133, 0.22);
}

.boss-lineup > div {
  min-width: 0;
  min-height: 62px;
  padding: 11px 6px;
  text-align: center;
  border-right: 1px solid rgba(232, 193, 133, 0.12);
}

.boss-lineup > div:last-child {
  border-right: 0;
}

.boss-lineup span {
  display: block;
  margin-bottom: 6px;
  color: rgba(224, 177, 105, 0.78);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.boss-lineup strong {
  display: block;
  color: rgba(249, 231, 201, 0.88);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .boss-lineup {
    margin-bottom: 14px;
  }

  .boss-lineup > div {
    min-height: 58px;
    padding: 9px 3px;
  }

  .boss-lineup span {
    margin-bottom: 5px;
    font-size: 8px;
  }

  .boss-lineup strong {
    font-size: 9px;
    line-height: 1.3;
  }
}
