/* ===== 『禅ゴルフ』 スタイル ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 30%, #35543f 0%, #24402f 55%, #182c20 100%);
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", "Meiryo", "Noto Sans JP", system-ui, sans-serif;
  color: #ecf5ea;
  -webkit-user-select: none; user-select: none;
  touch-action: none;
}

#game-wrap {
  position: absolute;
  left: 50%; top: 50%;
  width: 1120px; height: 630px;
  transform: translate(-50%, -50%);
  transform-origin: center center;
}

#game-canvas {
  position: absolute; inset: 0;
  width: 1120px; height: 630px;
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0,0,0,.45), 0 4px 16px rgba(0,0,0,.3);
  cursor: crosshair;
  touch-action: none;
}

.ui-hidden { display: none !important; }
.hidden { display: none !important; }

/* ===== HUD ===== */
#hud {
  position: absolute; top: 10px; left: 14px; right: 14px;
  height: 46px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  background: rgba(16, 34, 24, .55);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  font-size: 15px;
  pointer-events: none;
  z-index: 10;
}
#hud .hud-left, #hud .hud-center, #hud .hud-right {
  display: flex; align-items: center; gap: 8px;
}
.hud-sep { opacity: .4; }
#hud-hole { font-weight: 700; color: #ffe9a8; }
#hud-name { color: #bfe6c3; }
#hud-strokes { font-weight: 600; }
#hud-total { color: #cfe8d2; }
.hud-btn {
  pointer-events: auto;
  width: 34px; height: 34px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 10px;
  background: rgba(255,255,255,.08);
  color: #ecf5ea;
  font-size: 16px; line-height: 1;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.hud-btn:hover { background: rgba(255,255,255,.2); transform: translateY(-1px); }
.hud-btn:active { transform: scale(.94); }

#hint-bar {
  position: absolute; bottom: 12px; left: 50%;
  transform: translateX(-50%);
  max-width: 88%;
  padding: 7px 20px;
  background: rgba(16, 34, 24, .55);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 999px;
  font-size: 14px;
  color: #dff0dd;
  pointer-events: none;
  z-index: 10;
  white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}

/* ===== オーバーレイ共通 ===== */
.screen {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10, 22, 15, .62);
  backdrop-filter: blur(5px);
  border-radius: 18px;
  z-index: 20;
  animation: screenIn .3s ease-out;
}
@keyframes screenIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.panel {
  background: linear-gradient(160deg, rgba(38, 66, 48, .96), rgba(24, 46, 33, .96));
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 22px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.12);
  padding: 30px 44px;
  text-align: center;
  max-width: 92%;
  max-height: 92%;
  overflow-y: auto;
  animation: panelIn .35s cubic-bezier(.2, 1.4, .4, 1);
}
@keyframes panelIn {
  from { opacity: 0; transform: translateY(22px) scale(.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.panel-wide { width: 880px; }
.panel h2 {
  font-size: 26px; margin-bottom: 18px;
  color: #ffe9a8; letter-spacing: 4px;
}

/* ===== タイトル ===== */
.panel-title { width: 640px; padding: 26px 48px; }
.title-deco { font-size: 44px; margin-bottom: 2px; }
.game-title {
  font-size: 52px; font-weight: 800; letter-spacing: 10px;
  background: linear-gradient(180deg, #fdf6d8, #ffd977 60%, #e8a94e);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 4px 24px rgba(255, 214, 120, .18);
  margin-bottom: 4px;
}
.game-sub { color: #b9dcc0; letter-spacing: 6px; margin-bottom: 20px; font-size: 15px; }
.title-foot { margin-top: 14px; font-size: 13px; color: #9cc4a4; }

.howto {
  margin-top: 20px;
  text-align: left;
  background: rgba(0,0,0,.2);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  padding: 14px 20px;
}
.howto h3 { font-size: 15px; color: #ffe9a8; margin-bottom: 8px; letter-spacing: 2px; }
.howto ul { list-style: none; }
.howto li { font-size: 13px; line-height: 1.9; color: #d5ead6; }
.howto b { color: #ffe9a8; }

/* ===== ボタン ===== */
.btn {
  display: inline-block;
  min-width: 180px;
  padding: 12px 30px;
  font-size: 17px; font-weight: 600;
  font-family: inherit;
  letter-spacing: 3px;
  color: #ecf5ea;
  background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 14px;
  cursor: pointer;
  transition: transform .12s, background .15s, box-shadow .15s;
}
.btn:hover { background: rgba(255,255,255,.18); transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.3); }
.btn:active { transform: scale(.96); }
.btn-primary {
  background: linear-gradient(180deg, #ffd977, #eda94b);
  color: #3c2a10;
  border-color: rgba(255, 235, 180, .7);
  box-shadow: 0 6px 18px rgba(237, 169, 75, .35);
}
.btn-primary:hover { background: linear-gradient(180deg, #ffe49a, #f5b55c); }
.btn-col { display: flex; flex-direction: column; gap: 12px; align-items: center; margin-top: 6px; }
.btn-row { display: flex; gap: 14px; justify-content: center; margin-top: 18px; }
.btn-toggle { min-width: 220px; }

/* ===== ホール選択グリッド ===== */
#levels-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin: 6px 0 4px;
}
.level-cell {
  position: relative;
  padding: 12px 6px 10px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  cursor: pointer;
  transition: transform .12s, background .15s;
  font-family: inherit;
  color: #ecf5ea;
}
.level-cell:hover { background: rgba(255,255,255,.16); transform: translateY(-3px); }
.level-cell.locked {
  opacity: .38; cursor: not-allowed; filter: grayscale(.6);
}
.level-cell.locked:hover { transform: none; background: rgba(255,255,255,.07); }
.lv-num { font-size: 21px; font-weight: 800; color: #ffe9a8; }
.lv-name { font-size: 12px; color: #bfe6c3; margin: 2px 0; }
.lv-par { font-size: 11px; color: #93b89b; }
.lv-stars { font-size: 13px; color: #ffd35e; letter-spacing: 1px; margin-top: 3px; min-height: 17px; }
.lv-best { font-size: 11px; color: #9cc4a4; }

/* ===== 実績 ===== */
#ach-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  text-align: left;
  margin-bottom: 4px;
}
.ach-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
}
.ach-item.locked { opacity: .42; filter: grayscale(.8); }
.ach-icon { font-size: 26px; }
.ach-name { font-size: 15px; font-weight: 700; color: #ffe9a8; }
.ach-desc { font-size: 12px; color: #c4dfc8; margin-top: 2px; }

/* ===== ホール結果 ===== */
#screen-holedone .panel { width: 440px; }
#hd-badge { font-size: 54px; margin-bottom: 4px; animation: badgePop .5s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes badgePop {
  from { transform: scale(0) rotate(-30deg); }
  to { transform: scale(1) rotate(0); }
}
#hd-title { font-size: 34px; letter-spacing: 6px; margin-bottom: 6px; }
#hd-stars { font-size: 30px; color: #ffd35e; letter-spacing: 8px; margin-bottom: 8px; text-shadow: 0 2px 12px rgba(255, 211, 94, .5); }
#hd-info { font-size: 15px; color: #cfe8d2; margin-bottom: 20px; }

/* ===== スコアカード ===== */
#sc-table-wrap { overflow-x: auto; margin-bottom: 10px; }
#sc-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
#sc-table-wrap th, #sc-table-wrap td {
  padding: 6px 4px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
#sc-table-wrap th { color: #9cc4a4; font-weight: 600; }
#sc-table-wrap td.sc-under { color: #7ee2a0; font-weight: 700; }
#sc-table-wrap td.sc-over { color: #f0a48a; }
#sc-table-wrap td.sc-even { color: #ecf5ea; }
.sc-retry {
  font-family: inherit;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.08);
  color: #dff0dd;
  cursor: pointer;
}
.sc-retry:hover { background: rgba(255,255,255,.2); }
#sc-summary { font-size: 17px; color: #ffe9a8; letter-spacing: 1px; }

/* ===== トランジション ===== */
#transition {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #1d3527, #14271b);
  border-radius: 18px;
  z-index: 40;
  opacity: 1;
  transition: opacity .45s ease;
  pointer-events: none;
}
#transition.tr-out { opacity: 0; }
#tr-inner { text-align: center; animation: trIn .5s ease-out; }
@keyframes trIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
#tr-hole { font-size: 46px; font-weight: 800; color: #ffe9a8; letter-spacing: 8px; }
#tr-name { font-size: 20px; color: #bfe6c3; letter-spacing: 10px; margin: 10px 0 6px; }
#tr-par { font-size: 16px; color: #93b89b; letter-spacing: 4px; }

/* ===== Toast ===== */
#toast {
  position: absolute; top: 68px; left: 50%;
  transform: translateX(-50%);
  padding: 9px 24px;
  background: rgba(20, 40, 27, .92);
  border: 1px solid rgba(255, 217, 119, .5);
  border-radius: 999px;
  font-size: 14px;
  color: #ffe9a8;
  z-index: 50;
  pointer-events: none;
  animation: toastIn .3s ease-out;
  white-space: nowrap;
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, -8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* スクロールバー */
.panel::-webkit-scrollbar { width: 8px; }
.panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 4px; }

/* ---------- KanaWorks_AI クレジット ---------- */
.kw-credit {
  display: inline-flex; align-items: center; gap: 9px;
  margin-top: 14px; padding: 6px 16px 6px 8px;
  background: rgba(24, 46, 33, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  text-decoration: none;
  color: #9cc4a4; font-size: 12.5px;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.kw-credit img { width: 28px; height: 28px; display: block; }
.kw-credit b { color: #ffd977; }
.kw-credit:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 217, 119, 0.5);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
