/* ぽちぽち堂 デザインシステム — generated from tokens.json */
:root, [data-theme="lcd"] {
  --lcd-bg: #cfe3b0;
  --lcd-bg-center: #dcedc0;
  --lcd-bg-edge: #b7cc98;
  --lcd-ink: #1c2a12;
  --lcd-shade: #8fb26a;
  --select: #f47b20;
  --select-ink: #1c1206;
  --badge: #d4002a;
  --badge-ink: #ffffff;
  --page-bg: #d9d9d6;
  --page-fade-start: rgba(217, 217, 214, 0);
  --page-fade-mid: rgba(217, 217, 214, 0.9);
  --ad-bg: #f3f3f3;
  --ad-line: #777777;
  --ad-ink: #444444;
  --key-press: rgba(0, 0, 0, 0.24);
  --shadow-logo: 2px 2px 0 #8fb26a, 4px 4px 0 rgba(0, 0, 0, 0.28);
  --shadow-logo-small: 2px 2px 0 #8fb26a, 3px 3px 0 rgba(0, 0, 0, 0.28);
  --shadow-notice: 4px 4px 0 rgba(0, 0, 0, 0.35);
  --glow-key: 0 0 0 3px #f47b20, 0 0 18px 8px #f47b20;
}
:root {
  --gap-grid: 4px;
  --pad-bar: 5px;
  --pad-x: 6px;
  --radius-lcd: 3px;
  --radius-dpad: 10px;
  --radius-num: 12px;
  --radius-soft: 14px;
  --lcd-w: 240px;
  --lcd-h: 289px;
  --bar-title: 16px;
  --bar-soft: 20px;
  --row-doc: 16px;
  --row-rank: 18px;
  --row-name: 20px;
  --row-menu: 22px;
  --cell-h: 62px;
  --menu-w: 170px;
  --handset-min: 240px;
  --handset-work: 380px;
  --handset-top: 432px;
  --line-thin: 1px;
  --line-bold: 2px;
  --time-press: 140ms;
  --time-repeat: 120ms;
  --time-repeat-delay: 400ms;
  --time-blink: 500ms;
  --time-result-delay: 700ms;
  --time-result-lock: 1000ms;
  --time-notice: 1400ms;
  --dim-blink: 0.15;
  --dim-locked: 0.45;
  --dim-placeholder: 0.6;
  --font-dot: "DotGothic16", "MS Gothic", monospace;
}
.lcd-badge { font-family: var(--font-dot); font-size: 9px; line-height: 11px; font-weight: 400; }
.lcd-caption { font-family: var(--font-dot); font-size: 10px; line-height: 14px; font-weight: 400; }
.lcd-label { font-family: var(--font-dot); font-size: 11px; line-height: 15px; font-weight: 400; }
.lcd-body { font-family: var(--font-dot); font-size: 12px; line-height: 16px; font-weight: 400; }
.lcd-action { font-family: var(--font-dot); font-size: 13px; line-height: 18px; font-weight: 400; }
.lcd-name { font-family: var(--font-dot); font-size: 18px; line-height: 22px; font-weight: 400; }
.lcd-display { font-family: var(--font-dot); font-size: 26px; line-height: 30px; font-weight: 400; }
.lcd-logo { font-family: var(--font-dot); font-size: 28px; line-height: 30px; font-weight: 400; letter-spacing: 1px; }
.lcd-result { font-family: var(--font-dot); font-size: 34px; line-height: 38px; font-weight: 400; }

/* ぽちぽち堂：液晶の中の型と、端末の外側の型。
   値は tokens.css の変数から取る。文字の大きさは文字の型（.lcd-*）を一緒に付けて決める。
   寸法は液晶の中の論理px（横240×縦289）。端末の画像の液晶に合わせて、全体を拡大・縮小する。 */

/* 液晶 */
.pp-ground { background: radial-gradient(ellipse at 50% 38%, var(--lcd-bg-center) 0%, var(--lcd-bg) 58%, var(--lcd-bg-edge) 100%); color: var(--lcd-ink); }
.pp-glass { background: linear-gradient(125deg, rgba(255, 255, 255, .26) 0%, rgba(255, 255, 255, 0) 28%), repeating-linear-gradient(0deg, rgba(0, 0, 0, .045) 0px, rgba(0, 0, 0, .045) 1px, rgba(0, 0, 0, 0) 1px, rgba(0, 0, 0, 0) 3px); box-shadow: inset 0 0 14px rgba(0, 0, 0, .4), inset 0 3px 6px rgba(0, 0, 0, .25); }
.pp-screen { width: var(--lcd-w); height: var(--lcd-h); display: flex; flex-direction: column; position: relative; font-family: var(--font-dot); color: var(--lcd-ink); }
.pp-fill { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }

/* 帯 */
.pp-title { height: var(--bar-title); display: flex; align-items: center; justify-content: center; padding: 0 var(--pad-bar); line-height: 10px; border-bottom: var(--line-thin) solid var(--lcd-ink); }
.pp-soft { height: var(--bar-soft); display: flex; align-items: center; justify-content: space-between; padding: 0 var(--pad-bar); line-height: 11px; border-top: var(--line-thin) solid var(--lcd-ink); }
.pp-bar-head { height: var(--bar-title); line-height: var(--bar-title); padding: 0 var(--pad-x); }
.pp-head { background: var(--lcd-ink); color: var(--lcd-bg); }

/* ロゴ */
.pp-logo { transform: skewX(-9deg); color: var(--lcd-ink); text-shadow: var(--shadow-logo); }
.pp-logo-small { text-shadow: var(--shadow-logo-small); }

/* メニュー、結果の項目、知らせ */
.pp-menu { position: absolute; left: 0; bottom: var(--bar-soft); width: var(--menu-w); box-sizing: border-box; border: var(--line-bold) solid var(--lcd-ink); background: var(--lcd-bg); display: flex; flex-direction: column; }
.pp-menu-item { line-height: var(--row-menu); padding: 0 var(--pad-x); }
.pp-action { line-height: var(--row-menu); padding: 0 var(--pad-x); border: var(--line-thin) solid var(--lcd-ink); }
.pp-notice { position: absolute; left: 20px; right: 20px; top: 132px; padding: 8px 6px; text-align: center; white-space: pre-line; border: var(--line-bold) solid var(--lcd-ink); background: var(--lcd-bg); box-shadow: var(--shadow-notice); }

/* トップの作品の一覧 */
.pp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap-grid); padding: 0 var(--pad-x); }
.pp-cell { position: relative; height: var(--cell-h); box-sizing: border-box; border: var(--line-thin) solid var(--lcd-ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; }
.pp-cell-title { line-height: 11px; text-align: center; max-width: 70px; white-space: pre-line; }
.pp-cell-blank { width: 26px; height: 30px; box-sizing: border-box; border: var(--line-thin) dashed currentColor; display: flex; align-items: center; justify-content: center; }
.pp-badge { position: absolute; left: -1px; top: -1px; padding: 0 3px; background: var(--badge); color: var(--badge-ink); }
.pp-tag { position: absolute; right: -1px; top: -1px; padding: 0 3px; background: var(--lcd-ink); color: var(--lcd-bg); }

/* 長い文章 */
.pp-doc { height: calc(var(--row-doc) * 14); overflow: hidden; }
.pp-doc-line { height: var(--row-doc); box-sizing: border-box; padding-left: var(--pad-x); white-space: pre; overflow: hidden; }
.pp-doc-link { padding-left: 18px; text-decoration: underline; }
.pp-scroll { position: absolute; right: 2px; top: 4px; width: 6px; height: calc(var(--row-doc) * 14); box-sizing: border-box; border: var(--line-thin) solid var(--lcd-ink); }
.pp-scroll-thumb { position: absolute; left: 0; right: 0; background: var(--lcd-ink); }
.pp-pager { height: 14px; text-align: center; }

/* 全員ランキング、名前えらび */
.pp-rank-row { height: var(--row-rank); box-sizing: border-box; display: flex; align-items: center; gap: 5px; padding: 0 6px 0 3px; line-height: 14px; border-bottom: var(--line-thin) dotted var(--lcd-ink); }
.pp-rank-no { flex: 0 0 34px; text-align: right; }
.pp-rank-name { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; }
.pp-me { margin-top: auto; padding: 3px var(--pad-x); }
.pp-pick-row { height: var(--row-name); box-sizing: border-box; padding: 0 8px; line-height: 18px; white-space: nowrap; overflow: hidden; border: var(--line-thin) solid transparent; }
.pp-pick-row.pp-outlined { border-color: var(--lcd-ink); }

/* 選んでいる項目。ほかの型の後に置いて、地と文字の色を上書きする。
   色だけで伝えないよう、内側に濃い枠を付ける（オレンジと液晶の地の差は 1.98:1 しかない）。
   もともと枠のある型（結果の項目、作品の升、名前えらびの行）では、枠を太くして区別する。 */
.pp-selected { background: var(--select); color: var(--select-ink); outline: var(--line-thin) solid var(--lcd-ink); outline-offset: calc(var(--line-thin) * -1); }
.pp-action.pp-selected, .pp-cell.pp-selected, .pp-pick-row.pp-selected { outline-width: var(--line-bold); outline-offset: calc(var(--line-bold) * -1); }

/* 端末の外側 */
.pp-page { position: relative; overflow: hidden; background: var(--page-bg); font-family: var(--font-dot); }
.pp-ad { box-sizing: border-box; border: var(--line-thin) dashed var(--ad-line); background: var(--ad-bg); display: flex; align-items: center; justify-content: center; text-align: center; color: var(--ad-ink); }
.pp-rotate { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; color: var(--lcd-ink); }
.pp-fade { position: absolute; left: 0; bottom: 0; width: 100%; height: 103px; background: linear-gradient(180deg, var(--page-fade-start) 0px, var(--page-fade-mid) 22px, var(--page-bg) 38px); pointer-events: none; }

/* ぽちぽち堂：ページの外側と、端末の重ね方。
   液晶の中の型（pp-*）と値は、デザインシステムの bundle.css と tokens.css にある（この前に読み込む）。
   ここにあるのは、採用版の共通部品（KeitaiReal.dc.html）とアートボードが、要素に直接書いていた配置。 */

html { background: var(--page-bg); }
body { margin: 0; }

/* 端末を出す所。スクリプトが動いているページでは、外側をスクロールさせない。
   キーを続けて押したときに画面が拡大されないよう、端末の上では拡大も止める。 */
html.pps-js, html.pps-js body { height: 100%; overflow: hidden; overscroll-behavior: none; }
html.pps-js body { position: fixed; left: 0; top: 0; width: 100%; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.pps-root { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: hidden; background: var(--page-bg); font-family: var(--font-dot); }
.pps-stage { position: absolute; overflow: hidden; }
.pps-stage[hidden], .pps-rotate[hidden] { display: none; }

/* ページに持っている文字（検索エンジンと、スクリプトが動かない環境のため）。端末が出たら隠す。 */
html.pps-js .pps-text { display: none; }
.pps-text { max-width: 34em; margin: 0 auto; padding: 16px; font-family: var(--font-dot); font-size: 16px; line-height: 1.8; color: var(--lcd-ink); }
.pps-text h1 { font-size: 22px; font-weight: 400; }
.pps-text h2 { font-size: 16px; font-weight: 400; margin: 1.5em 0 0; padding: 0 6px; background: var(--lcd-ink); color: var(--lcd-bg); }
.pps-text a { color: inherit; }

/* 読み上げの道具にだけ伝える文字 */
.pps-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* 端末：本体の画像 → 液晶 → 傷の層 → キーの押せる領域 */
.pps-handset { position: absolute; font-family: var(--font-dot); }
.pps-layer { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; -webkit-user-drag: none; }
.pps-lcd { position: absolute; left: 16.44%; top: 8.41%; width: 66.99%; height: 33.98%; overflow: hidden; border-radius: var(--radius-lcd); }
.pps-lcd .pp-screen { transform-origin: 0 0; }
.pps-glass { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; }
.pps-lcd-tap { position: absolute; left: 0; top: 0; width: 100%; height: 100%; padding: 0; border: 0; background: transparent; cursor: default; outline: none; }

/* キーの押せる領域。写真の上の透明な領域なので、選択の枠線は出さない。 */
.pps-key { position: absolute; box-sizing: border-box; padding: 0; border: 0; outline: none; background: transparent; cursor: pointer; touch-action: none; -webkit-tap-highlight-color: transparent; }
.pps-key.is-pressed { background: var(--key-press); }
.pps-key[data-key="ok"] { transition: box-shadow .15s; }
.pps-key.is-glow { box-shadow: var(--glow-key); }

/* 広告の場所。審査を申請するまでは空けておく。確認用では、pp-ad の破線の枠で場所を見せる。 */
.pps-ad { position: absolute; }

/* トップの配置で、十字キーの段より下を消すぼかし。端末の位置に合わせて、上端を決める。 */
.pps-fade { bottom: 0; height: auto; }

/* 点滅：暗い側の間、濃さを dim-blink にする */
.pps-blink-off .pps-blink { opacity: var(--dim-blink); }

/* 液晶の中（pp-fill の並べ方）。値は KeitaiReal.dc.html のとおり。 */
.pps-plain { margin: 0; }
.pps-lines { text-align: center; white-space: pre-line; }
.pps-rest { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; }
.pps-top-logo { height: 44px; display: flex; align-items: center; justify-content: center; }
.pps-icon { width: 26px; height: 30px; background: currentColor; -webkit-mask: var(--pps-icon) center / contain no-repeat; mask: var(--pps-icon) center / contain no-repeat; }
.pps-title { align-items: center; justify-content: center; gap: 14px; padding: 0 10px; }
.pps-press-ok { padding: 2px 10px; border: var(--line-thin) solid var(--lcd-ink); }
.pps-result { align-items: center; gap: 6px; padding: 10px 10px 0; }
.pps-result-items { align-self: stretch; display: flex; flex-direction: column; gap: var(--gap-grid); margin-top: 8px; }
.pps-result-items.is-locked { opacity: var(--dim-locked); }
.pps-doc { position: relative; padding-top: 4px; }
.pps-msg { justify-content: center; gap: 12px; padding: 0 var(--pad-x); }
.pps-msg-items { display: flex; flex-direction: column; gap: var(--gap-grid); }
.pps-work { position: relative; overflow: hidden; }
