:root {
  --ink: #3b2a1e; --soft: #7a6654; --cream: #fffaf0; --wood: #9a6434; --orange: #f07a24; --green: #4cb35c; --miss: #e2534a;
  --font: 'M PLUS Rounded 1c', 'Hiragino Maru Gothic ProN', sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0; color: var(--ink); font-family: var(--font); font-weight: 700; line-height: 1.6;
  background: #cfe9f7;
  -webkit-font-smoothing: antialiased;
}
body::before { content: ''; position: fixed; inset: 0; z-index: -1; background: url(../assets/bg.jpg) 30% center / cover no-repeat; }
.hand { font-family: 'Yomogi', sans-serif; font-weight: 400; }
.wrap { max-width: 720px; margin: 0 auto; padding: 16px 16px 48px; }
.hero { position: relative; display: flex; align-items: flex-end; gap: 8px; margin: 8px 0 18px; }
.hero-text { flex: 1; background: rgba(255, 250, 240, .94); border-radius: 20px; padding: 16px 20px; box-shadow: 0 6px 18px rgba(40, 50, 70, .18); position: relative; z-index: 1; }
.hero-text p { margin: 0; }
.hero-text .hand { color: var(--orange); font-size: 16px; }
.hero h1 { margin: 2px 0 6px; font-size: clamp(26px, 6vw, 38px); line-height: 1.25; }
.lead { font-size: 14px; color: var(--soft); }
.hero-lion { width: clamp(90px, 22vw, 150px); flex: none; margin-right: -20px; position: relative; z-index: 2; filter: drop-shadow(0 4px 6px rgba(0,0,0,.2)); }
.hero-penguin { width: clamp(70px, 16vw, 110px); flex: none; margin-left: -24px; position: relative; z-index: 2; filter: drop-shadow(0 4px 6px rgba(0,0,0,.2)); }
.panel {
  background: var(--cream); border: 7px solid var(--wood); border-radius: 20px; padding: 18px 20px 20px; margin-bottom: 18px;
  box-shadow: inset 0 0 0 2px #e8d6b4, 0 8px 18px rgba(60, 40, 20, .25);
}
.panel h2 { margin: 0 0 14px; font-size: 21px; display: flex; align-items: center; gap: 8px; }
label { display: block; margin-bottom: 12px; font-size: 15px; }
label small { font-size: 12px; color: var(--soft); margin-left: 8px; font-weight: 500; }
input, select {
  display: block; width: 100%; margin-top: 4px; font: inherit; font-size: 17px; padding: 10px 12px; border-radius: 12px;
  border: 3px solid #e2cfa9; background: #fff; color: var(--ink); outline: none;
}
input:focus, select:focus { border-color: var(--orange); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.preview { background: #fff; border: 2px dashed #e2cfa9; border-radius: 14px; padding: 10px 14px; margin: 4px 0 12px; text-align: center; }
.preview small { display: block; color: var(--soft); font-size: 12px; text-align: left; }
.pv-text { font-size: 22px; line-height: 2; }
.pv-text rt { font-size: 11px; color: var(--orange); }
.pv-romaji { font-size: 13px; color: #a39c93; letter-spacing: .04em; overflow-wrap: anywhere; }
.err { color: var(--miss); min-height: 1.2em; margin: 0 0 8px; font-size: 14px; }
.btn {
  display: block; width: 100%; border: 0; font: inherit; font-size: 21px; padding: 12px; border-radius: 99px; color: #fff; cursor: pointer;
  background: linear-gradient(#ff9a3c, #f0741f); box-shadow: 0 5px 0 #c55a12;
}
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #c55a12; }
.btn:disabled { opacity: .6; }
.btn.sub { background: #efe6d6; color: var(--ink); box-shadow: 0 4px 0 #d3c3a6; font-size: 17px; margin-top: 12px; }
.note { font-size: 12px; color: var(--soft); font-weight: 500; margin: 12px 0 0; }
.thanks { text-align: center; padding: 10px 0; }
.thanks b { display: block; font-size: 22px; color: var(--green); }
.thanks span { font-size: 14px; color: var(--soft); }
.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.summary div { background: #fff; border-radius: 14px; padding: 8px 4px; text-align: center; box-shadow: 0 2px 0 #eadbbf; }
.summary b { display: block; font-size: 26px; color: var(--orange); line-height: 1.2; }
.summary small { font-size: 12px; color: var(--soft); }
.rank { list-style: none; margin: 0; padding: 0; }
.rank li { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; background: #fff; margin-bottom: 6px; box-shadow: 0 2px 0 #eee2cb; }
.rank li:nth-child(1) { background: #fff6d6; } .rank li:nth-child(2) { background: #f4f6f8; } .rank li:nth-child(3) { background: #fbeee3; }
.rank li.me { outline: 3px solid #ffcf5a; }
.rank .no { width: 32px; text-align: center; font-size: 20px; flex: none; color: var(--soft); }
.rank .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; }
.rank .ct b { font-size: 20px; color: var(--orange); }
.rank .ct small { font-size: 11px; color: var(--soft); margin-left: 2px; }
.rank .empty, .recent .empty { justify-content: center; color: var(--soft); font-weight: 500; background: transparent; box-shadow: none; }
.recent { list-style: none; margin: 0; padding: 0; }
.recent li { padding: 8px 0; border-bottom: 2px dotted #eadbbf; font-size: 16px; }
.recent .tag { display: inline-block; font-size: 11px; background: #ffe9a8; border-radius: 99px; padding: 1px 8px; margin-right: 8px; vertical-align: 2px; }
.recent small { margin-left: 8px; color: var(--soft); font-size: 12px; }
.unofficial-note { text-align: center; font-size: 12px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.5); margin-top: 16px; }
.back {
  display: block; text-align: center; text-decoration: none; color: #fff; font-size: 20px; padding: 14px; border-radius: 99px;
  background: linear-gradient(#57a8ee, #2f86d6); box-shadow: 0 5px 0 #1f65a8;
}
/* 管理画面 */
.adm-item { background: #fff; border-radius: 14px; padding: 12px; margin-bottom: 10px; box-shadow: 0 2px 0 #eee2cb; }
.adm-item .meta { font-size: 12px; color: var(--soft); }
.adm-item .row { display: grid; grid-template-columns: 1fr 1fr 130px; gap: 6px; margin: 6px 0; }
.adm-item input, .adm-item select { font-size: 15px; padding: 6px 8px; border-width: 2px; margin: 0; }
.adm-item .pv-text { font-size: 17px; text-align: left; }
.adm-item .warn { color: var(--miss); font-size: 12px; }
.adm-btns { display: flex; gap: 8px; }
.adm-btns button { border: 0; font: inherit; font-size: 14px; padding: 6px 16px; border-radius: 99px; cursor: pointer; }
.ok { background: var(--green); color: #fff; } .ng { background: #efe6d6; color: var(--ink); }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.tabs button { border: 0; font: inherit; padding: 6px 14px; border-radius: 99px; background: #efe6d6; cursor: pointer; }
.tabs button.on { background: var(--orange); color: #fff; }
@media (max-width: 560px) { .adm-item .row { grid-template-columns: 1fr; } }
