/* ごはんくじ：ドット絵のレトロゲーム風。クリーム地・茶色の文字・赤いおみくじ箱 */
.gk {
	--gk-bg: #fff6e0;
	--gk-panel: #fffdf6;
	--gk-text: #5a3a1e;
	--gk-sub: #8a6a4a;
	--gk-line: #5a3a1e;
	--gk-red: #d8423a;
	--gk-red-dark: #a82e28;
	--gk-gold: #e8b04a;
	--gk-soft: #fbe7c2;
	box-sizing: border-box;
	max-width: 480px;
	margin: 1.5em auto;
	padding: 20px 16px 14px;
	background: var(--gk-bg);
	color: var(--gk-text);
	border: 4px solid var(--gk-line);
	box-shadow: 0 0 0 4px var(--gk-bg), 0 0 0 8px var(--gk-line);
	font-family: "DotGothic16", ui-monospace, "Osaka-Mono", "MS Gothic", monospace;
	line-height: 1.6;
	text-align: center;
	-webkit-font-smoothing: none;
}
.gk *, .gk *::before, .gk *::after { box-sizing: border-box; }
.gk [hidden] { display: none !important; }
/* テーマの本文の見出し・図などの飾りを打ち消す */
div.gk h1, div.gk h2, div.gk p, div.gk figure, div.gk dl { position: static; background: none; border: 0; border-radius: 0; padding: 0; }
div.gk h1::before, div.gk h1::after, div.gk h2::before, div.gk h2::after { content: none; display: none; }
div.gk h2 { color: var(--gk-text); }

.gk .gk-demo { margin: -8px 0 14px; padding: 4px 8px; background: var(--gk-gold); color: var(--gk-text); font-size: 13px; }

.gk-screen { display: grid; gap: 14px; justify-items: stretch; }
.gk-screen > .gk-box { justify-self: center; }
.gk .gk-title { margin: 0; padding: 0; background: none; border: 0; font-family: inherit; font-size: 34px; font-weight: 400; letter-spacing: .12em; color: var(--gk-red); text-shadow: 3px 3px 0 var(--gk-soft); line-height: 1.3; }
.gk .gk-heading { margin: 0; font-family: inherit; font-size: 18px; font-weight: 400; line-height: 1.6; }
.gk .gk-small { margin: 0; font-size: 12px; color: var(--gk-sub); line-height: 1.6; }

/* おみくじ箱 */
.gk-box { width: 128px; }
.gk-box svg { display: block; width: 100%; height: auto; overflow: visible; }
.gk-stick { transition: transform .45s cubic-bezier(.2, 1.6, .4, 1); }
.gk-box.is-out .gk-stick { transform: translateY(-6px); }
.gk-box.is-shaking svg { animation: gk-shake .35s steps(2) infinite; transform-origin: 50% 90%; }
@keyframes gk-shake {
	0% { transform: rotate(-8deg); }
	50% { transform: rotate(8deg); }
	100% { transform: rotate(-8deg); }
}
@media (prefers-reduced-motion: reduce) {
	.gk-box.is-shaking svg { animation-duration: 1.2s; }
	.gk-stick { transition: none; }
}

/* ボタン */
.gk .gk-btn {
	display: inline-flex; align-items: center; justify-content: center;
	width: 100%; min-height: 52px; margin: 0; padding: 10px 16px;
	font: inherit; font-size: 17px; color: #fff; text-decoration: none; line-height: 1.4;
	background: var(--gk-red); border: 3px solid var(--gk-line); border-radius: 0;
	box-shadow: 0 4px 0 var(--gk-line); cursor: pointer;
	transition: transform .08s, box-shadow .08s;
}
.gk .gk-btn:hover { color: #fff; background: #e4524a; }
.gk .gk-btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--gk-line); }
.gk .gk-btn:focus-visible, .gk select:focus-visible, .gk .gk-link:focus-visible { outline: 3px dashed var(--gk-red); outline-offset: 3px; }
.gk .gk-btn:disabled { background: #cbb89a; color: #fff; box-shadow: 0 4px 0 #9c876a; border-color: #9c876a; cursor: default; transform: none; }
.gk .gk-btn--big { min-height: 64px; font-size: 22px; }
.gk [data-gk-draw] { font-size: 26px; letter-spacing: .3em; padding-left: calc(16px + .3em); }
.gk .gk-btn--sub { background: var(--gk-panel); color: var(--gk-text); font-size: 15px; }
.gk .gk-btn--sub:hover { background: var(--gk-soft); color: var(--gk-text); }
.gk .gk-btn--shop { background: var(--gk-gold); color: var(--gk-text); }
.gk .gk-btn--shop:hover { background: #f0c063; color: var(--gk-text); }
.gk .gk-link { margin: 0; padding: 8px; font: inherit; font-size: 14px; color: var(--gk-sub); background: none; border: 0; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }

/* 選ぶ欄（くじの種類・エリア） */
.gk-field { display: grid; gap: 4px; width: 100%; text-align: left; font-size: 14px; }
.gk-select { position: relative; display: block; }
.gk-select::after { content: "▼"; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--gk-red); pointer-events: none; }
.gk select {
	-webkit-appearance: none; appearance: none;
	width: 100%; min-height: 52px; margin: 0; padding: 8px 40px 8px 12px; font: inherit; font-size: 16px;
	color: var(--gk-text); background: var(--gk-panel); border: 3px solid var(--gk-line); border-radius: 0;
}
.gk select:disabled { color: var(--gk-sub); background: #f3e6cc; }

/* 結果 */
.gk-result { gap: 10px; }
.gk .gk-mood { margin: 0; font-size: 19px; color: var(--gk-red-dark); }
/* 写真：API の写真は最大 238px 四方なので、引き伸ばしすぎないよう小さめのフチ付きカードで中央に置く */
.gk .gk-photo { justify-self: center; width: auto; margin: 4px 0 0; }
.gk-photo > div { display: grid; place-items: center; width: 188px; height: 188px; padding: 6px; overflow: hidden; background: #fff; border: 3px solid var(--gk-line); box-shadow: 4px 4px 0 var(--gk-soft); }
.gk-photo img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; margin: 0; border-radius: 0; }
.gk-photo svg { width: 72%; height: auto; }
.gk-photo figcaption { margin-top: 6px; font-size: 11px; color: var(--gk-sub); text-align: center; }
.gk .gk-name { margin: 4px 0 0; padding: 0; color: var(--gk-text); background: none; border: 0; font-family: inherit; font-size: 24px; font-weight: 400; line-height: 1.4; overflow-wrap: anywhere; }
.gk .gk-catch { margin: 0; font-size: 14px; color: var(--gk-sub); overflow-wrap: anywhere; }
.gk .gk-info { width: 100%; margin: 0; padding: 10px 12px; border-radius: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; background: var(--gk-panel); border: 2px solid var(--gk-line); text-align: left; font-size: 14px; }
.gk-info dt { margin: 0; color: var(--gk-sub); white-space: nowrap; font-weight: 400; }
.gk-info dd { margin: 0; overflow-wrap: anywhere; }
/* ボタンの下の影（4px）の分を足して、見た目のすき間をどこも 12px にそろえる */
.gk-actions { display: grid; gap: 16px; width: 100%; margin-top: 6px; }
/* 結果画面の下の2つ（ひきなおす・場所を変える）は、小さめに横並び */
.gk-actions__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gk .gk-btn--small { min-height: 46px; padding: 6px 8px; font-size: 13px; border-width: 2px; box-shadow: 0 3px 0 var(--gk-line); }
.gk .gk-btn--small:active { transform: translateY(3px); }
.gk .gk-btn--small:disabled { box-shadow: 0 3px 0 #9c876a; }

.gk .gk-credit { margin: 18px 0 0; padding: 10px 0 0; border: 0; border-top: 2px dotted var(--gk-sub); font-size: 11px; color: var(--gk-sub); }
.gk .gk-credit a { color: var(--gk-text); text-decoration: underline; }

@media (max-width: 380px) {
	.gk { padding: 16px 12px 12px; }
	.gk .gk-title { font-size: 28px; }
	.gk .gk-name { font-size: 20px; }
	.gk .gk-info { grid-template-columns: 1fr; gap: 0; }
	.gk-info dd { margin-bottom: 6px; }
}

/* ───────── 全画面（screen.php） ───────── */
.gk-html { background: #3a2414; }
.gk-body {
	margin: 0;
	min-height: 100vh;
	min-height: 100dvh;
	/* 画面のまわりは、こげ茶にドットの模様（ちょうちんの夜道のイメージ） */
	background:
		radial-gradient(circle at 50% -10%, rgba(232, 176, 74, .28), transparent 55%),
		radial-gradient(rgba(255, 246, 224, .07) 1.5px, transparent 1.6px) 0 0 / 16px 16px,
		#3a2414;
	color: #fff6e0;
	font-family: "DotGothic16", ui-monospace, "Osaka-Mono", "MS Gothic", monospace;
	-webkit-tap-highlight-color: transparent;
	padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.gk-body *, .gk-body *::before, .gk-body *::after { box-sizing: border-box; }
.gk-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 520px; height: 48px; margin: 0 auto; padding: 0 16px; font-size: 13px; }
.gk-back { flex: none; padding: 4px 12px 4px 8px; border: 1px solid rgba(255, 246, 224, .4); border-radius: 999px; color: #fff6e0; text-decoration: none; }
.gk-back:hover { background: rgba(255, 246, 224, .12); }
.gk-back:focus-visible { outline: 2px dashed #e8b04a; outline-offset: 3px; }
.gk-bar__site { color: rgba(255, 246, 224, .6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gk-stage { padding: 4px 16px 32px; }
.gk-body .gk { margin: 8px auto 0; box-shadow: 0 0 0 4px var(--gk-bg), 0 0 0 8px var(--gk-line), 0 18px 40px rgba(0, 0, 0, .45); }
@media (min-height: 760px) {
	.gk-stage { padding-top: 16px; }
}
