/*!
 * © 2025 パソコンサロンゆうらく (Pasokon Salon Yuuraku). All rights reserved.
 * Project: ゆうらく学習トレーニングポータルYuuraku Leaning station
 * File: kasasu
 * BUILD_ID: YR-2025-0826-K10                 // ← 公開用の可視ビルドID
 * CANARY_ZW
 * SPDX-License-Identifier: LicenseRef-Yuuraku-Proprietary
 * Contact: yuurakunomori@gmail.com  |  URL: https://yuurakus.jp/
 *
 * 重要
 * 
* [日本語 / Japanese]
 * 本スタイルシートおよび関連ファイルの著作権（著作権法上の権利）は、パソコンサロンゆうらくに専属します。
 * 法令で明示的に認められる場合を除き、当社の事前の書面許諾なく、複製・複写・転載・転用・編集・改変・翻案・
 * 逆コンパイル／リバースエンジニアリング・再配布・商用利用・公衆送信（Webへのアップロードを含む）・
 * 自動取得／スクレイピング等の二次利用を固く禁じます。侵害が判明した場合、警告なく直ちに
 * 差止請求・損害賠償請求等の法的措置を厳格に行います。
 * 【重要】本スタイルシートには検証用のBUILD IDおよび不可視の「カナリア文字（ウォーターマーク）」が埋め込まれ、
 * ソースには識別用IDが隠されています。これらの削除・改変は契約違反・不正競争・著作権侵害等として追及します。
 *
 * [English]
 * Copyright in this stylesheet and related files is owned exclusively by
 * Pasokon Salon Yuuraku unless otherwise stated. Except as expressly permitted by law,
 * any reproduction, modification, adaptation, reverse engineering, redistribution,
 * commercial use, public transmission (including posting on the web), or automated
 * collection/scraping without prior written permission is strictly prohibited.
 * Upon detection of infringement, we will immediately pursue legal remedies including
 * injunctive relief and damages. IMPORTANT: This stylesheet embeds a verifiable BUILD ID
 * and invisible “canary” watermark characters, and an identification ID is hidden in the source.
 * Removal or alteration will be treated as a violation and strictly enforced.
 *
 * [中文 / Chinese (Simplified)]
 * 本样式表及相关文件之著作权，除非另有说明，专属于「Pasokon Salon Yuuraku」。
 * 未经事先书面许可，严禁复制、转载、修改、改编、逆向工程、再分发、商业使用、
 * 公开传播（含上传至网络）及自动抓取/爬取等二次利用。一经发现侵权，将立即采取包括
 * 禁令与损害赔偿在内的法律措施。重要：本样式表内已嵌入可验证的BUILD ID与不可见
 * “金丝雀”水印字符，且源代码中隐藏有识别用ID。擅自删除或篡改将被视为违规并依法追究。
 *
 * [한국어 / Korean]
 * 본 스타일시트 및 관련 파일의 저작권은 별도 고지가 없는 한
 * ‘파소콘 살롱 유우라쿠(Pasokon Salon Yuuraku)’에 전속됩니다.
 * 사전 서면 허가 없이 복제, 전재, 전용, 수정, 각색, 리버스 엔지니어링,
 * 재배포, 상업적 이용, 공중송신(웹 게시 포함), 자동 수집·스크래핑 등의 2차 이용을 엄격히 금합니다.
 * 위반 시 예고 없이 즉시 금지청구 및 손해배상 청구 등 법적 조치를 취합니다.
 * 중요: 본 스타일시트에는 검증 가능한 BUILD ID와 보이지 않는 ‘카나리아(워터마크) 문자’가 포함되며,
 * 소스 내부에는 식별용 ID가 숨겨져 있습니다. 이를 삭제·변조하는 행위는 위반으로 간주되어 엄정 대응합니다.
 */

/*==================================================================
 style.css — タイピングかさす劇場用スタイル（サムネイル適正サイズ版）
==================================================================*/

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, 'Noto Sans JP', sans-serif;
}

button {
  cursor: pointer;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #0e7490;
  color: #fff;
  border-bottom: 4px solid #0b5c72;
}

.topbar h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: .2em;
}

.topbar .controls {
  display: flex;
  gap: 8px;
}

.ui {
  background: #134e4a;
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
}

.ui.link {
  text-decoration: none;
}

.mini {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #475569;
  color: #fff;
  border: none;
}

.layout {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 12px;
  padding: 12px;
  max-width: 1280px;
  margin: 0 auto;
}

.left {
  background: #e2f3fb;
  border: 2px solid #0b5c72;
  border-radius: 12px;
  padding: 8px;
  position: relative;
}

.hud {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
  font-weight: 700;
  color: #0b5c72;
}

#game {
  width: 100%;
  height: auto;
  display: block;
  background: #cfeffb;
  border: 2px solid #0b5c72;
  border-radius: 8px;
}

.right {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cards,
.ranking {
  background: #f8fafc;
  border: 2px solid #0b5c72;
  border-radius: 12px;
  padding: 10px;
}

.cards-head,
.rank-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.card {
  position: relative;
  width: 100%;
  padding-top: 140%;
  background: #e2e8f0;
  border: 2px dashed #94a3b8;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.card .badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: #0e7490;
  color: #fff;
  border-radius: 999px;
  font-size: 12px;
  padding: 2px 6px;
  min-width: 24px;
  text-align: center;
}

.rank-list {
  list-style: decimal;
  padding-left: 18px;
  margin: 8px 0;
  max-height: 240px;
  overflow: auto;
}

.rank-bottom {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.sns {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.dialog::backdrop {
  background: rgba(0, 0, 0, .4);
}

.dialog {
  border: none;
  border-radius: 12px;
  padding: 16px;
  width: min(520px, 92vw);
}

.diff-row {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.diff {
  padding: 14px 18px;
  border: none;
  border-radius: 10px;
  background: #0e7490;
  color: #fff;
  font-size: 18px;
}

.countdown {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 120px;
  color: #111;
  font-weight: 900;
  text-shadow: 0 4px 12px rgba(0, 0, 0, .35);
  pointer-events: none;
}

.boss-banner {
  position: fixed;
  top: 20%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #e6b422;
  color: #111;
  border: 4px solid #111;
  padding: 12px 20px;
  font-size: 72px;
  font-weight: 900;
  border-radius: 16px;
  text-align: center;
}

.hidden {
  display: none;
}

.float-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* --- card shuffle overlay --- */
.shuffle {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .35);
  z-index: 999;
}

.shuffle img {
  width: min(40vmin, 320px);
  max-width: 90vw;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, .5));
  transition: transform .12s ease;
}

.shuffle.reveal img {
  transform: scale(1.12);
}

.hidden {
  display: none;
} /* 既存クラスの保険（もし未定義なら） */

/* === howto (あそびかた) === */
.howto {
  background: #f8fafc;
  border: 2px solid #0b5c72;
  border-radius: 12px;
  padding: 10px;
}

.howto-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.howto-list {
  list-style: decimal;
  padding-left: 18px;
  margin: 8px 0;
  line-height: 1.7;
}

.howto-list li {
  margin: 6px 0;
}

.howto .note,
.howto-note {
  font-size: 12px;
  color: #475569;
}
.howto-head .caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: rotate(0deg);
  transition: transform .15s ease;
  min-width: 28px; /* クリックしやすく */
}
.howto-head .caret[aria-expanded="true"] {
  transform: rotate(90deg); /* 開いたら➧をクルッと回す */
}

/* =========================================================
   Card Detail Modal (Cat Cards)
========================================================= */

.card.owned{
  background: #ffffff;
  border-style: solid;
  border-color: #0e7490;
  cursor: pointer;
  transition: transform .08s ease, box-shadow .08s ease;
}

.card.owned:hover{
  transform: translateY(-2px);
  box-shadow: 0 10px 18px rgba(0,0,0,.15);
}

.card.empty{
  opacity: .65;
}

.card-dialog{
  width: min(820px, 94vw);
  padding: 0;
  overflow: hidden;
}

.carddlg-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: #f1f5f9;
  border-bottom: 1px solid #cbd5e1;
}

.carddlg-head h3{
  margin: 0;
  font-size: 18px;
  letter-spacing: .02em;
}

.carddlg-actions{
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lang-toggle{
  display: inline-flex;
  border: 1px solid rgba(148,163,184,.9);
  border-radius: 10px;
  overflow: hidden;
}

.lang-toggle .lang-btn{
  border: none;
  border-radius: 0;
  background: transparent;
  color: #0f172a;
}

.lang-toggle .lang-btn.is-active{
  background: #0e7490;
  color: #fff;
}

.carddlg-body{
  display: grid;
  grid-template-columns: minmax(180px, 260px) 1fr;
  gap: 14px;
  padding: 14px;
  background: #ffffff;
}

.carddlg-img{
  width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

.carddlg-desc{
  line-height: 1.75;
  color: #0f172a;
}

.carddlg-desc p{
  margin: 0 0 10px;
}

.carddlg-desc ul{
  margin: 0;
  padding-left: 18px;
}

.carddlg-desc li{
  margin: 4px 0;
}

@media (max-width: 720px){
  .carddlg-body{
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   Cat Card Detail Modal (Sweet-like UI)
   - glitter frame / pressed buttons / JP-EN toggle
========================================================= */

.card-dialog{
  width: min(860px, 94vw);
  max-width: 860px;
  border: 0;
  padding: 0;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 26px 90px rgba(0,0,0,0.22);
  background:
    radial-gradient(1200px 600px at 18% 0%, rgba(255,255,255,0.98) 0%, rgba(255,255,255,0.86) 60%, rgba(245,250,255,0.78) 100%),
    linear-gradient(180deg, rgba(255,255,255,0.78) 0%, rgba(255,245,250,0.66) 100%);
  position: relative;
}

.card-dialog::before{
  content:"";
  position:absolute;
  inset:-2px;
  pointer-events:none;
  /* グリッター（控えめ） */
  background:
    radial-gradient(circle at 10% 18%, rgba(255,255,255,0.75) 0 1px, transparent 2px),
    radial-gradient(circle at 38% 32%, rgba(255,255,255,0.65) 0 1px, transparent 2px),
    radial-gradient(circle at 72% 22%, rgba(255,255,255,0.55) 0 1px, transparent 2px),
    radial-gradient(circle at 84% 58%, rgba(255,255,255,0.55) 0 1px, transparent 2px),
    radial-gradient(circle at 22% 72%, rgba(255,255,255,0.55) 0 1px, transparent 2px),
    radial-gradient(circle at 60% 82%, rgba(255,255,255,0.55) 0 1px, transparent 2px);
  opacity: .7;
  filter: blur(.2px);
  mix-blend-mode: screen;
}

.card-dialog::after{
  content:"";
  position:absolute;
  inset: 10px;
  pointer-events:none;
  border-radius: 18px;
  border: 2px solid rgba(255,140,200,0.28);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.65),
    inset 0 0 0 6px rgba(255,170,220,0.10);
}

.card-dialog::backdrop{
  background: rgba(10, 12, 18, 0.40);
  backdrop-filter: blur(10px) saturate(1.25);
}

.card-dialog.pop{ animation: cardPop .26s ease-out; }
.card-dialog.shake{ animation: cardShake .30s ease-in-out; }

@keyframes cardPop{
  from{ transform: translateY(10px) scale(.985); opacity: .0; }
  to  { transform: translateY(0)    scale(1);   opacity: 1; }
}
@keyframes cardShake{
  0%{ transform: translateX(0); }
  22%{ transform: translateX(-10px); }
  46%{ transform: translateX(8px); }
  68%{ transform: translateX(-6px); }
  100%{ transform: translateX(0); }
}

/* header */
.carddlg__header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 14px;
  padding: 18px 18px 12px;
  position: relative;
  z-index: 1;
}

.carddlg__title{
  margin: 0;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: .03em;
}

.carddlg__breed{
  margin: 6px 0 0;
  color: rgba(0,0,0,0.62);
  font-size: 14px;
  line-height: 1.35;
}

.carddlg__actions{
  display:flex;
  align-items:center;
  gap: 10px;
}

.carddlg__lang{
  display:flex;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid rgba(255,140,200,0.28);
  background: rgba(255,255,255,0.50);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.65);
}

/* buttons (sweet-like) */
.card-btn{
  appearance:none;
  border: 1px solid rgba(255,140,200,0.32);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.92) 0%, rgba(255,235,246,0.82) 100%);
  color: #222;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 800;
  letter-spacing: .02em;
  cursor: pointer;
  box-shadow:
    0 10px 22px rgba(0,0,0,0.12),
    inset 0 1px 0 rgba(255,255,255,0.80);
  transition: transform .08s ease, filter .12s ease, box-shadow .12s ease;
}

.card-btn:hover{ filter: brightness(1.03); }
.card-btn:active{
  transform: translateY(1px);
  box-shadow:
    0 6px 14px rgba(0,0,0,0.12),
    inset 0 2px 0 rgba(255,255,255,0.65);
}

.card-btn.is-active{
  border-color: rgba(70, 160, 255, 0.35);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.92) 0%, rgba(228,247,255,0.85) 100%);
}

.card-btn--close{
  border-color: rgba(0,0,0,0.18);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.92) 0%, rgba(245,245,245,0.85) 100%);
}

/* body */
.carddlg__body{
  display:grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
  padding: 10px 18px 18px;
  position: relative;
  z-index: 1;
}

@media (max-width: 720px){
  .carddlg__body{ grid-template-columns: 1fr; }
}

.carddlg__art{
  border-radius: 18px;
  border: 1px solid rgba(255,140,200,0.22);
  background:
    radial-gradient(700px 380px at 0% 0%, rgba(255,255,255,0.95) 0%, rgba(255,240,250,0.72) 55%, rgba(245,250,255,0.66) 100%);
  position: relative;
  overflow: hidden;
  min-height: 340px;
  box-shadow: 0 18px 46px rgba(0,0,0,0.10);
}

.carddlg__img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  display:block;
  padding: 16px;
  filter: drop-shadow(0 14px 22px rgba(0,0,0,0.12));
}

.carddlg__lock{
  position:absolute;
  left: 14px;
  top: 14px;
  padding: 10px 12px;
  border-radius: 999px;
  font-weight: 900;
  letter-spacing: .04em;
  background: rgba(255, 80, 140, 0.92);
  color: #fff;
  box-shadow: 0 12px 24px rgba(0,0,0,0.18);
  display:none;
}

.card-dialog.is-locked .carddlg__lock{ display:block; }

.card-dialog.is-locked .carddlg__img{
  opacity: .92;
  filter: grayscale(1) blur(1.4px) contrast(0.90) brightness(0.98);
}

.carddlg__desc{
  border-radius: 18px;
  border: 1px solid rgba(70,160,255,0.18);
  background: rgba(255,255,255,0.58);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.65);
  padding: 14px 14px 12px;
}

.carddlg__text{
  white-space: pre-wrap;
  line-height: 1.7;
  font-size: 15px;
  color: rgba(0,0,0,0.86);
}

.carddlg__hint{
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(0,0,0,0.12);
  color: rgba(0,0,0,0.55);
  font-size: 13px;
  line-height: 1.45;
}

/* Card grid: make empty cards clickable + sweet-like hover frame */
.card.owned, .card.empty{
  transition: transform .08s ease, box-shadow .12s ease, filter .12s ease;
}

.card.empty{
  cursor: pointer;
  outline: none;
}

.card.empty::after{
  content: "未入手";
  position:absolute;
  left: 10px;
  top: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .04em;
  background: rgba(0,0,0,0.40);
  color: #fff;
  opacity: .95;
}

.card.owned{
  cursor: pointer;
}

.card.owned:hover, .card.empty:hover{
  transform: translateY(-1px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.18);
}

.card.owned:active, .card.empty:active{
  transform: translateY(0px);
}

.card:focus-visible{
  outline: 3px solid rgba(70,160,255,0.42);
  outline-offset: 3px;
}

/* === Exit button (optional) === */
/* --- Fix: result modal button overlap / layout --- */
.exit-summary .exit-actions{
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 14px;
  margin-bottom: 6px; /* keep space above the Close button */
}

.exit-summary .exit-actions__note{
  color: #3b4a44;
  font-size: 15px;
  line-height: 1.6;
  max-width: 420px;
}

.exit-summary .exit-actions .ui.is-done{
  opacity: 0.92;
  cursor: default;
}

/* Close button: ensure it never overlaps action row */
#dlgMessage #dlgClose{
  margin-top: 22px;
}


.dlg-actions{
  display:flex;
  justify-content:center;
  gap:10px;
  flex-wrap:wrap;
  margin-top: 14px;
}
.dlg-actions .ui{ min-width: 220px; }

/* =========================================
   BONUS +10000 Overlay
========================================= */
#bonusOverlay{
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s ease;
}

#bonusOverlay.show{
  opacity: 1;
}

#bonusOverlay .bonusOverlay__box {
    /* 背景色・ぼかし・影を取り除き完全透過に */
    background: rgba(0,0,0,0);
    backdrop-filter: none;
    box-shadow: none;
}

#bonusOverlay .bonusOverlay__text{
  font-weight: 900;
  letter-spacing: .04em;
  font-size: clamp(56px, 10vw, 140px);
  background: linear-gradient(180deg, #fff7b1 0%, #f8b500 55%, #ffef8a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 10px 24px rgba(0,0,0,0.55);
}
