/* Antolini Games — おしらせのページ（黒板）
   ゲームのまわりは「白い手帖」（maeza/chokin/skin-w.css）
   字は Zen Kaku Gothic New（Googleフォントから読みこむ。index.html の head） */

:root {
  --board: #1f2c25;                        /* 黒っぽい緑の黒板 */
  --chalk: #f2efe6;                        /* 白いチョーク */
  --chalk-dim: rgba(242, 239, 230, 0.78);
  --chalk-line: rgba(242, 239, 230, 0.42);
  --chalk-yellow: #f3d77e;                 /* 黄色いチョーク */
  --f: 'Zen Kaku Gothic New', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Yu Gothic', Meiryo, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background-color: var(--board); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  color: var(--chalk);
  font-family: var(--f);
  font-weight: 500;
  line-height: 1.7;
  /* チョークの粉・消し跡のムラ・黒板の地 */
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0.09 0 0 0 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(38% 22% at 18% 30%, rgba(242, 239, 230, 0.075), transparent 70%),
    radial-gradient(30% 18% at 72% 78%, rgba(242, 239, 230, 0.06), transparent 70%),
    radial-gradient(26% 12% at 60% 12%, rgba(242, 239, 230, 0.045), transparent 70%),
    linear-gradient(172deg, transparent 0 44%, rgba(242, 239, 230, 0.04) 50%, transparent 58%),
    radial-gradient(120% 90% at 50% 40%, #24332b 0%, #1b261f 100%);
  background-color: var(--board);
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
a:focus-visible { outline: 3px solid var(--chalk-yellow); outline-offset: 3px; }

/* ---------- 並び（スマホ：上から順に／PC：左に文、右にゲーム） ---------- */
.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 18px 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "intro" "maeza" "stage" "foot";
  gap: 22px;
}
.intro { grid-area: intro; text-align: center; }
.maeza { grid-area: maeza; }
.stage { grid-area: stage; }
.foot  { grid-area: foot; }

/* ---------- ロゴ・おしらせ・日付 ---------- */
.badge { margin: 0 auto 14px; width: 150px; }
.badge img { width: 100%; image-rendering: pixelated; }
.notice-head { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-bottom: 12px; }
.oshirase { margin: 0; width: 112px; opacity: 0.9; }
.kicker {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--chalk-dim);
}

/* ---------- 見出しの文 ---------- */
.copy {
  margin: 0;
  font-weight: 700;
  font-size: clamp(21px, 6vw, 30px);
  line-height: 1.65;
  letter-spacing: 0.03em;
}
.copy span { display: block; }
.copy .lead { word-break: keep-all; overflow-wrap: anywhere; }   /* <wbr> のところでだけ折り返す */
.copy .sub { margin-top: 6px; font-size: 0.62em; letter-spacing: 0.06em; color: var(--chalk-yellow); }

/* チョークのかすれ：見出しの字に、黒板色の細かい点をまぜる */
.copy .lead,
.maeza h2 {
  color: var(--chalk);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.4' numOctaves='1' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.12 0 0 0 0 0.17 0 0 0 0 0.15 0 0 0 -2.2 1.35'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    var(--chalk);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---------- 本日のミニゲーム（チョークで描いた枠） ---------- */
.maeza {
  position: relative;
  margin-top: 52px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "tag" "title" "desc";
  row-gap: 4px;
  padding: 16px 18px 18px;
  border-radius: 6px;
  background: rgba(242, 239, 230, 0.025);
  border: 2px solid var(--chalk-line);
}
.maeza .tag {
  grid-area: tag;
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  white-space: nowrap;
  color: var(--chalk-yellow);
}
.maeza h2 { grid-area: title; margin: 0 0 0 -0.5em; font-weight: 700; font-size: 22px; line-height: 1.4; }
.maeza .desc { grid-area: desc; margin: 0; font-size: 15px; line-height: 1.85; color: var(--chalk-dim); line-break: strict; word-break: auto-phrase; }

/* 枠の上の線を棚にして、来るたびに変わる落書きをひとつ（index.html のおわりの script で選ぶ） */
.shelf-doodle {
  position: absolute;
  right: 22px;
  bottom: calc(100% + 1px);
  height: 62px;
  width: auto;
  opacity: 0.86;
  pointer-events: none;
  user-select: none;
}
.shelf-doodle:not([src]) { display: none; }
.shelf-doodle.d-kinoko-coffee { height: 56px; }
.shelf-doodle.d-acorn { height: 50px; right: 30px; transform: rotate(-8deg); transform-origin: 50% 100%; }
.shelf-doodle.d-branch-lying { height: 30px; bottom: calc(100% - 1px); }
.shelf-doodle.d-basil { height: 60px; }
/* チョークで描かれていくように、左から右へ一度だけ現れる（絵が読みこまれてから） */
@media (prefers-reduced-motion: no-preference) {
  .shelf-doodle.is-waiting,
  .shelf-doodle.is-drawing {
    -webkit-mask-image: linear-gradient(90deg, #000 0 45%, transparent 55% 100%);
    mask-image: linear-gradient(90deg, #000 0 45%, transparent 55% 100%);
    -webkit-mask-size: 250% 100%;
    mask-size: 250% 100%;
    -webkit-mask-position: 100% 0;
    mask-position: 100% 0;
  }
  .shelf-doodle.is-drawing { animation: chalk-draw 1.4s 0.4s ease-out forwards; }
}
@keyframes chalk-draw { to { -webkit-mask-position: 0 0; mask-position: 0 0; } }

/* ---------- ゲームの枠（白い手帖） ---------- */
.stage {
  justify-self: center;
  width: 100%;
  max-width: 460px;
  height: 86svh;
  min-height: 560px;
  max-height: 860px;
  border-radius: 18px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 2px 0 rgba(255, 255, 255, 0.06), 0 22px 50px rgba(0, 0, 0, 0.5);
}
.stage iframe { display: block; width: 100%; height: 100%; border: 0; }

/* ---------- おしまいの行 ---------- */
.foot { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 14px; }
.foot .x {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  text-decoration: none;
  border: 2px solid var(--chalk-line);
  color: var(--chalk);
}
.foot .x:hover { background: var(--chalk-yellow); color: var(--board); border-color: var(--chalk-yellow); }
.foot small { color: rgba(242, 239, 230, 0.55); font-size: 12px; letter-spacing: 0.06em; }

/* ---------- PC ---------- */
@media (min-width: 920px) {
  .page {
    min-height: 100svh;
    align-content: center;
    padding: 48px 40px;
    grid-template-columns: minmax(0, 1fr) 440px;
    grid-template-areas: "intro stage" "maeza stage" "foot stage";
    grid-template-rows: auto auto 1fr;
    column-gap: 72px;
    row-gap: 28px;
  }
  .intro { text-align: left; align-self: end; }
  .badge { margin: 0 0 18px; width: 196px; }
  .notice-head { flex-direction: row; align-items: center; gap: 16px; margin-bottom: 14px; }
  .oshirase { width: 118px; margin-left: -3px; }
  .copy { font-size: 32px; }
  .maeza { align-self: start; max-width: 460px; margin-top: 30px; }
  .shelf-doodle { height: 70px; right: 26px; }
  .shelf-doodle.d-kinoko-coffee { height: 62px; }
  .shelf-doodle.d-acorn { height: 56px; }
  .shelf-doodle.d-branch-lying { height: 34px; }
  .shelf-doodle.d-basil { height: 68px; }
  .foot { align-items: flex-start; align-self: start; }
  .stage { height: min(860px, calc(100svh - 96px)); min-height: 620px; }
}
