/* ==========================
   ルールブック全体
========================== */
.rulebook {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* スマホ2列 */
    gap: 12px; 
    padding: 12px;
    max-width: calc(2 * 170px + 1 * 12px);
    margin: 0 auto;
    justify-items: center;
}

@media (min-width: 900px) {
    .rulebook {
        grid-template-columns: repeat(3, 1fr); 
        max-width: calc(3 * 170px + 2 * 12px);
    }
}

/* タイトル */
.rulebook p {
    font-family: Inter, sans-serif;
    font-weight: 400;
    font-size: 20px;
    color: rgba(38, 46, 55, 1);
    grid-column: 1 / -1;
    margin: 0 0 8px 0;
    width: 100%;
    text-align: left;
}

/* ==========================
   ボタン共通
========================== */
.rulebook-button {
    background-color: rgba(228, 233, 251, 1);
    border-radius: 15px;
    border: 1.5px solid rgba(52, 71, 210, 1);
    width: 100%;
    max-width: 170px;
    height: 128px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s;
}

.rulebook-button:hover {
    transform: scale(1.05);
}

.rulebook-button svg {
    width: 48px;
    height: 48px;
}

.rulebook-button div {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 100%;
    text-align: center;
}

.rulebook-button h1 {
    font-size: 12px;
    font-weight: 400;
    color: rgba(38, 46, 55, 1);
    line-height: 1;
    margin: 0;
}

/* ==========================
   ポップアップ全体
========================== */
.popup {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 999;
}

/* PDF表示領域 */
.popup-content {
    position: relative;
    background: white;
    width: 80%;
    height: 80%;
    border-radius: 10px;
    overflow: visible; /* ×ボタンを枠外にはみ出させる */
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
}

.popup-content iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ==========================
   ×ボタン
========================== */
.close-btn {
    position: absolute;
    bottom: -25px; /* ポップアップ枠外にはみ出す */
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
}

.circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #3447D2; /* 外側濃い青 */
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: transform 0.2s ease;
}

/* 内側の薄い青 */
.circle::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 6px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #A7B6FF;
    z-index: 0; /* 常にボタンの前面ではなく、中央に表示 */
}

.circle span {
    position: relative;
    z-index: 1;
    color: white;
    font-size: 28px;
}

/* ボタンを押したときだけ少し拡大 */
.circle:active {
    transform: scale(1.1);
}

/* hoverでも色は変えない */
.circle:hover {
    transform: scale(1.1); /* ホバーでも拡大はOK */
}