.game-story-nav { position: relative; }
.game-story-nav > summary {
  display: flex; align-items: center; gap: 5px; padding: 27px 10px 24px;
  color: #556b78; font-size: 14px; font-weight: 700; white-space: nowrap;
  list-style: none; cursor: pointer; user-select: none;
}
.game-story-nav > summary::-webkit-details-marker { display: none; }
.game-story-nav > summary::after { content: ""; width: 6px; height: 6px; margin-top: -3px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform .2s ease; }
.game-story-nav[open] > summary { color: #102a3d; }
.game-story-nav[open] > summary::after { margin-top: 3px; transform: rotate(225deg); }
.game-story-menu {
  position: absolute; z-index: 120; top: calc(100% - 8px); left: 50%; width: 310px;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px;
  padding: 12px; border: 1px solid rgba(107,151,164,.22); border-radius: 20px;
  background: rgba(255,255,255,.96); box-shadow: 0 22px 55px rgba(20,58,78,.18);
  backdrop-filter: blur(18px); transform: translateX(-50%);
}
.game-story-menu a { display: flex !important; align-items: center; gap: 9px; min-width: 0; padding: 11px 12px !important; border-radius: 13px; color: #3d5f70 !important; font-size: 12px !important; font-weight: 800; }
.game-story-menu a::after { display: none !important; }
.game-story-menu a:hover { background: #eef9f7; color: #143d52 !important; }
.game-story-menu i { display: grid; place-items: center; width: 28px; height: 28px; flex: 0 0 auto; border-radius: 10px; background: linear-gradient(145deg,#fff1f5,#e7f8fb); font-style: normal; font-size: 15px; }

.game-download-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px;
  padding: 0 15px; border: 0; border-radius: 14px; color: #fff; background: linear-gradient(135deg,#ef769d,#67c9cf);
  box-shadow: 0 10px 24px rgba(81,164,174,.24); font: 800 12px/1 sans-serif; cursor: pointer; white-space: nowrap;
  transition: transform .2s ease, box-shadow .2s ease;
}
.game-download-button:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(81,164,174,.32); }
.game-download-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.download-modal[hidden] { display: none; }
.download-modal { position: fixed; z-index: 500; inset: 0; display: grid; place-items: center; padding: 20px; }
.download-modal__backdrop { position: absolute; inset: 0; border: 0; background: rgba(8,33,48,.55); backdrop-filter: blur(7px); cursor: pointer; }
.download-modal__panel {
  position: relative; width: min(100%, 520px); padding: 34px; overflow: hidden;
  border: 1px solid rgba(255,255,255,.8); border-radius: 30px;
  background: linear-gradient(150deg,rgba(255,255,255,.98),rgba(239,250,250,.96));
  box-shadow: 0 30px 100px rgba(7,37,54,.3); text-align: center;
}
.download-modal__panel::before { content: ""; position: absolute; width: 240px; height: 240px; left: -100px; top: -130px; border-radius: 50%; background: rgba(242,161,187,.16); }
.download-modal__close { position: absolute; z-index: 2; top: 16px; right: 16px; width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid #dae8eb; border-radius: 50%; background: #fff; color: #496776; cursor: pointer; font-size: 20px; }
.download-modal__logo { width: 64px; height: 64px; object-fit: contain; }
.download-modal h2 { margin: 15px 0 8px; color: #14384d; font-size: 28px; }
.download-modal__lead { margin: 0 auto 22px; max-width: 390px; color: #6b808a; font-size: 13px; line-height: 1.65; }
.store-links { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.store-link { display: grid; grid-template-columns: 42px 1fr; align-items: center; min-height: 72px; padding: 12px 14px; border: 1px solid #d7e7ea; border-radius: 18px; background: #fff; color: #153d52; text-align: left; box-shadow: 0 10px 28px rgba(20,61,82,.08); }
.store-link:hover { border-color: #7dced0; transform: translateY(-2px); }
.store-link__icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: #fff; background: #173d52; font-size: 19px; font-weight: 900; }
.store-link small, .store-link strong { display: block; }
.store-link small { margin-bottom: 3px; color: #82949c; font-size: 9px; letter-spacing: .06em; }
.store-link strong { font-size: 13px; }
.download-modal__note { margin: 17px 0 0; color: #8a9da5; font-size: 10px; line-height: 1.6; }
body.is-download-open { overflow: hidden; }

@media (max-width: 1320px) {
  .desktop-nav.is-mobile-open .game-story-nav { width: 100%; }
  .desktop-nav.is-mobile-open .game-story-nav > summary { padding: 12px 14px; border-radius: 14px; }
  .desktop-nav.is-mobile-open .game-story-menu { position: static; width: 100%; margin-top: 4px; transform: none; box-shadow: none; background: #f5fbfa; }
  .desktop-nav.is-mobile-open .game-story-menu a { padding: 10px !important; }
}
@media (max-width: 860px) {
  .site-header .game-download-button { width: 40px; height: 38px; padding: 0; border-radius: 12px; }
  .site-header .game-download-button span { display: none; }
}
@media (max-width: 680px) {
  .community-home .site-header__inner { padding-right: 130px; }
  .community-home .site-header .header-actions { width: 123px; }
  .crew-header .game-download-button { width: 40px; height: 40px; padding: 0; border-radius: 13px; }
  .crew-header .game-download-button span { display: none; }
  .store-links { grid-template-columns: 1fr; }
  .download-modal__panel { padding: 30px 20px 24px; border-radius: 24px; }
}


/* Rules Menu Item & Modal */
.game-story-menu__rules {
  grid-column: span 2;
  background: linear-gradient(135deg, rgba(239,250,250,0.92), rgba(255,243,248,0.96)) !important;
  border: 1px solid rgba(103,201,207,0.4) !important;
}
.game-story-menu__rules:hover {
  background: linear-gradient(135deg, #e4f7f8, #fde9f1) !important;
  border-color: #67c9cf !important;
}
.game-story-menu__rules i {
  background: linear-gradient(145deg, #ffd700, #ff8fa3) !important;
  color: #1b3d4f !important;
  font-size: 16px !important;
}
.game-story-menu__badge {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 6px;
  background: #173d52;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
}

.rules-modal[hidden] { display: none; }
.rules-modal {
  position: fixed; z-index: 500; inset: 0;
  display: grid; place-items: center; padding: 20px;
  overflow-y: auto;
}
.rules-modal__backdrop {
  position: fixed; inset: 0; border: 0;
  background: rgba(8,33,48,.65); backdrop-filter: blur(8px);
  cursor: pointer;
}
.rules-modal__panel {
  position: relative; width: min(100%, 720px); max-height: calc(100vh - 40px);
  margin: auto; padding: 32px 30px; overflow-y: auto;
  border: 1px solid rgba(255,255,255,.9); border-radius: 30px;
  background: linear-gradient(155deg, rgba(255,255,255,0.98), rgba(244,251,252,0.96));
  box-shadow: 0 32px 100px rgba(7,37,54,.35);
  display: flex; flex-direction: column; gap: 18px;
}
.rules-modal__panel::before {
  content: ""; position: absolute; width: 280px; height: 280px; left: -120px; top: -140px;
  border-radius: 50%; background: radial-gradient(circle, rgba(103,201,207,.25), transparent 70%);
  pointer-events: none;
}
.rules-modal__close {
  position: absolute; z-index: 2; top: 16px; right: 16px; width: 38px; height: 38px;
  display: grid; place-items: center; border: 1px solid #dae8eb; border-radius: 50%;
  background: #fff; color: #496776; cursor: pointer; font-size: 20px; font-weight: bold;
  transition: .15s ease;
}
.rules-modal__close:hover { background: #f0f8f9; color: #14384d; border-color: #67c9cf; }
.rules-modal__header { text-align: center; }
.rules-modal__kicker {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  background: rgba(103,201,207,0.18); color: #145963;
  font-size: 11px; font-weight: 800; letter-spacing: .06em;
}
.rules-modal__title { margin: 8px 0 6px; color: #14384d; font-size: clamp(24px, 3.5vw, 30px); font-weight: 900; }
.rules-modal__lead { margin: 0 auto; max-width: 500px; color: #617c88; font-size: 13px; line-height: 1.6; }

.rules-modal__nav {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; border-radius: 18px;
  background: rgba(255,255,255,0.85); border: 1px solid rgba(103,201,207,0.22);
}
.rules-modal__counter { font-weight: 900; color: #154559; font-size: 15px; }
.rules-modal__dots { display: flex; gap: 6px; }
.rules-dot {
  width: 26px; height: 10px; border: 0; border-radius: 999px;
  background: #d4e8ec; cursor: pointer; transition: all .2s ease;
}
.rules-dot.is-active { width: 36px; background: linear-gradient(135deg, #173d52, #42aeb0); }
.rules-modal__toggle-btn {
  padding: 6px 13px; border: 1px solid #c9e3e7; border-radius: 10px;
  background: #fff; color: #2a566a; font-size: 11px; font-weight: 800; cursor: pointer;
}
.rules-modal__toggle-btn:hover { background: #eef9fa; border-color: #67c9cf; }

.rules-modal__card-host.is-slide-view { display: flex; flex-direction: column; }
.rules-modal__card-host.is-all-view {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px;
}

.rules-item-card {
  padding: 22px; border-radius: 20px;
  background: #ffffff; border: 1px solid rgba(107,151,164,0.18);
  box-shadow: 0 10px 30px rgba(18,52,70,0.06);
  display: flex; flex-direction: column; gap: 12px;
}
.rules-item-card__head { display: flex; align-items: center; gap: 14px; }
.rules-item-card__num {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 14px;
  display: grid; place-items: center; font-size: 18px; font-weight: 900;
  color: #fff; background: linear-gradient(135deg, #173d52, #3eb4b8);
  box-shadow: 0 6px 16px rgba(23,61,82,0.22);
}
.rules-item-card__tag {
  display: inline-block; font-size: 10px; font-weight: 800; color: #35a5ab;
  letter-spacing: .06em; text-transform: uppercase;
}
.rules-item-card__title { margin: 2px 0 0; font-size: 17px; font-weight: 800; color: #133547; }
.rules-item-card__body {
  color: #3b5866; font-size: 14px; line-height: 1.7; font-weight: 500;
}
.rules-item-card__tips { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.rules-tip {
  display: flex; gap: 8px; align-items: baseline;
  padding: 10px 14px; border-radius: 12px;
  background: rgba(255, 248, 225, 0.7); border: 1px solid rgba(255, 213, 79, 0.4);
  color: #5c4308; font-size: 12px; line-height: 1.6;
}
.rules-tip b { color: #b78103; font-size: 11px; white-space: nowrap; flex-shrink: 0; }

.rules-modal__pagers {
  display: flex; gap: 10px; justify-content: space-between;
}
.rules-modal__page-btn {
  flex: 1; height: 42px; border: 1px solid #d2e4e8; border-radius: 13px;
  background: #fff; color: #19465b; font-size: 13px; font-weight: 800; cursor: pointer;
  transition: .15s ease;
}
.rules-modal__page-btn:hover { background: #eef8f9; border-color: #67c9cf; }

.rules-modal__actions {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center;
  padding-top: 8px; border-top: 1px solid rgba(103,201,207,0.18);
}
.rules-modal__actions a, .rules-modal__actions button {
  padding: 10px 18px; border-radius: 12px; font-size: 12px; font-weight: 800; cursor: pointer; text-decoration: none;
}
.rules-modal__ai-link {
  background: linear-gradient(135deg, #ff708f, #e55375); color: #fff !important;
  box-shadow: 0 6px 18px rgba(229,83,117,0.3); border: 0;
}
.rules-modal__ai-link:hover { transform: translateY(-1px); box-shadow: 0 9px 24px rgba(229,83,117,0.4); }
.rules-modal__library-link {
  background: #fff; color: #1f4f64 !important; border: 1px solid #cfdfe4;
}
.rules-modal__library-link:hover { background: #f2fafb; border-color: #67c9cf; }
.rules-modal__close-btn {
  background: transparent; border: 1px solid #dae5e8; color: #607986;
}
.rules-modal__close-btn:hover { background: #f0f4f6; color: #1c3d4f; }

body.is-rules-open { overflow: hidden; }
