/* KSKだぜGAMES 共通シェルCSS（ksk-game-header.css より前に読み込むこと） */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: #f6f5ef;
  color: #1e2925;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}

.ksk-main {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#game-stage {
  position: relative;
  width: 100%;
  height: calc(100svh - var(--ksk-header-height, 54px));
  min-height: 460px;
  overflow: hidden;
  touch-action: manipulation;
  background: #ffffff;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* 共通オーバーレイ（スタート／リザルト） */
.ksk-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(246, 245, 239, 0.94);
  backdrop-filter: blur(4px);
}

.ksk-overlay[hidden] {
  display: none;
}

.ksk-card {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border: 1px solid #d7d8cd;
  border-radius: 16px;
  padding: 20px 18px;
  box-shadow: 0 10px 28px rgba(30, 41, 37, 0.08);
  text-align: center;
}

.ksk-top-controls {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 10px;
}

.ksk-chip-btn {
  appearance: none;
  border: 1px solid #d0d3c6;
  background: #faf9f5;
  color: #25332f;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.ksk-title {
  margin: 4px 0 8px;
  font-size: clamp(22px, 5.5vw, 28px);
  line-height: 1.25;
}

.ksk-desc {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.5;
  color: #46544f;
}

.ksk-controls-box {
  background: #f6f5ef;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #25332f;
}

.ksk-btn-primary {
  appearance: none;
  width: 100%;
  border: none;
  border-radius: 12px;
  background: #ad3d27;
  color: #ffffff;
  font-size: 17px;
  font-weight: 800;
  padding: 14px 18px;
  cursor: pointer;
  min-height: 50px;
}

.ksk-btn-primary:active {
  transform: translateY(1px);
}

.ksk-result-score {
  font-size: clamp(28px, 7vw, 38px);
  font-weight: 900;
  color: #ad3d27;
  margin: 6px 0;
}

.ksk-rank-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: #f0efe7;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
}

.ksk-result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.ksk-btn-secondary {
  appearance: none;
  border: 1px solid #cfd2c5;
  background: #ffffff;
  color: #25332f;
  border-radius: 10px;
  padding: 11px 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ksk-manual-copy {
  margin-top: 10px;
  text-align: left;
}

.ksk-manual-copy textarea {
  width: 100%;
  min-height: 76px;
  font-size: 12px;
  padding: 8px;
  border: 1px solid #cfd2c5;
  border-radius: 8px;
}

/* 広告スロット：ゲーム領域下端から ins 本体上端まで 150px 以上確保（132px + 18px） */
#ksk-ad-slot {
  width: 100%;
  margin-top: 132px;
  padding: 0 12px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ksk-ad-label {
  height: 18px;
  line-height: 18px;
  font-size: 11px;
  color: #777f7b;
  letter-spacing: 0.06em;
}

.ksk-ad-box {
  width: 100%;
  max-width: 320px;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 359px) {
  .ksk-ad-box {
    max-width: 250px;
  }
}

.ksk-ad-box ins { display: block; width: 320px; height: 100px; }
@media (max-width: 359px) { .ksk-ad-box ins { width: 250px; } }
@media (min-width: 768px) { .ksk-ad-box ins { width: 160px; height: 600px; } }

.ksk-ad-box ins.ksk-ad-wide { width: 320px; height: 100px; flex: none; }
.ksk-ad-box ins.ksk-ad-small { width: 250px; height: 100px; flex: none; }
.ksk-ad-box ins.ksk-ad-tall { width: 160px; height: 600px; flex: none; }

.game-bar .brand { margin-left:auto; }
.entry-language select { max-width:7rem; }
.game-bar .bar-title { display:none; }
#entry-cover { display:block;width:100%;height:clamp(45px,12vh,100px);object-fit:cover; }
#entry-ranking { margin:.4rem 0; }
#entry-ranking ol { max-height:7rem;overflow:auto; }
#ksk-start .ksk-card { max-height:100%;overflow:auto; }
