/* NearFun 小游戏公共样式：明亮、按钮大、适合小朋友点 */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  background: linear-gradient(180deg, #9fe3ff 0%, #d6f5ff 40%, #fff5c9 100%) fixed;
  color: #3b2a5c; font-family: ui-rounded, "SF Pro Rounded", "PingFang SC", "Microsoft YaHei", sans-serif;
  display: flex; flex-direction: column; align-items: center; padding: 10px 10px 24px;
  touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
}
.hidden { display: none !important; }

.nf-top { width: 100%; max-width: 860px; display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.nf-top h1 { font-size: 22px; color: #ff4f8b; margin-right: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-shadow: 2px 2px 0 #fff, -2px -2px 0 #fff, 2px -2px 0 #fff, -2px 2px 0 #fff, 0 4px 0 #ffd23f; }
.nf-back, .nf-mute { width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; border: 3px solid #ffd23f; background: #fff;
  font-size: 18px; font-weight: 900; color: #ff4f8b; display: grid; place-items: center; text-decoration: none; cursor: pointer; }
.nf-pill { background: #fff; border: 3px solid #ffd23f; padding: 3px 10px; border-radius: 20px; font-weight: 800; white-space: nowrap; font-size: 14px; }
.nf-pill b { color: #ff6f00; font-size: 18px; }
.nf-hearts { letter-spacing: -2px; font-size: 16px; }

.nf-stage { position: relative; width: 100%; max-width: 860px; min-height: 480px; border-radius: 24px; border: 4px solid #fff;
  box-shadow: 0 10px 30px rgba(60,80,160,.22); overflow: hidden; background: #fffdf4; }

.nf-panel { position: absolute; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(70, 40, 120, .35); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.nf-card { background: #fff; border-radius: 24px; padding: 22px 22px 18px; width: min(420px, 100%); max-height: 100%; overflow: auto;
  text-align: center; border: 4px solid #ffd23f; box-shadow: 0 10px 30px rgba(0,0,0,.2); animation: nf-pop .35s cubic-bezier(.3,1.6,.6,1); }
@keyframes nf-pop { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.nf-card h2 { font-size: 26px; color: #ff4f8b; margin-bottom: 6px; }
.nf-card .big-emoji { font-size: 54px; line-height: 1.1; }
.nf-card p { color: #5a4a80; line-height: 1.6; margin: 6px 0; font-size: 15px; }
.nf-card input { width: 100%; padding: 10px; font-size: 18px; border: 3px solid #b3e5fc; border-radius: 14px; margin: 10px 0 4px;
  text-align: center; outline: none; font-family: inherit; color: #3b2a5c; }
.nf-card input:focus { border-color: #2b9cff; }
.nf-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; }
.nf-btn { border: none; cursor: pointer; font-family: inherit; font-size: 20px; font-weight: 900; color: #fff; padding: 11px 26px; border-radius: 40px;
  background: linear-gradient(#ffa21f, #ff4f8b); box-shadow: 0 5px 0 #c2185b; text-shadow: 0 2px 0 rgba(0,0,0,.15); }
.nf-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #c2185b; }
.nf-btn.sec { background: linear-gradient(#7fd3ff, #2b9cff); box-shadow: 0 5px 0 #1769aa; font-size: 17px; }
.nf-btn.sec:active { box-shadow: 0 1px 0 #1769aa; }

.nf-stars { font-size: 40px; letter-spacing: 4px; margin: 6px 0; }
.nf-stars .off { filter: grayscale(1); opacity: .3; }
.nf-stars span { display: inline-block; animation: nf-star .5s cubic-bezier(.3,1.8,.5,1) both; }
.nf-stars span:nth-child(2) { animation-delay: .15s; } .nf-stars span:nth-child(3) { animation-delay: .3s; }
@keyframes nf-star { from { transform: scale(0) rotate(-90deg); } to { transform: scale(1) rotate(0); } }
.nf-score { font-size: 44px; font-weight: 900; color: #2b9cff; line-height: 1.1; }
.nf-rankmsg { font-weight: 800; color: #ff6f00; }

.nf-table { width: 100%; border-collapse: collapse; margin: 10px 0 4px; font-size: 15px; }
.nf-table th { color: #9b8fc0; font-weight: normal; padding: 4px; font-size: 13px; }
.nf-table td { padding: 6px 4px; border-top: 1px solid #f2ecff; }
.nf-table tr.me td { background: #fff3c4; font-weight: 900; }
.nf-table td:first-child { font-size: 18px; width: 44px; }
.nf-empty { color: #a99fc6; padding: 14px 0; }

.nf-toast { position: absolute; left: 50%; top: 40%; z-index: 25; transform: translate(-50%, -50%) scale(.6); opacity: 0; pointer-events: none;
  font-size: 34px; font-weight: 900; white-space: nowrap; -webkit-text-stroke: 7px #fff; paint-order: stroke fill;
  transition: opacity .2s, transform .25s cubic-bezier(.3,1.6,.6,1); }
.nf-toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.nf-float { position: absolute; z-index: 20; pointer-events: none; font-weight: 900; font-size: 24px; -webkit-text-stroke: 5px #fff; paint-order: stroke fill;
  animation: nf-float .9s ease-out forwards; }
@keyframes nf-float { from { transform: translate(-50%, 0) scale(.8); opacity: 1; } to { transform: translate(-50%, -60px) scale(1.15); opacity: 0; } }
.nf-progress { position: absolute; left: 12px; right: 12px; top: 10px; height: 14px; border-radius: 10px; background: rgba(255,255,255,.8); z-index: 10; overflow: hidden; border: 2px solid #fff; }
.nf-progress i { display: block; height: 100%; width: 0; border-radius: 10px; background: linear-gradient(90deg, #22c55e, #ffd23f); transition: width .2s linear; }
.nf-tip { color: #6a5a94; font-size: 13px; text-align: center; margin-top: 8px; }

@media (max-width: 520px) {
  .nf-top h1 { font-size: 18px; }
  .nf-pill { font-size: 12px; padding: 2px 8px; }
  .nf-pill b { font-size: 15px; }
  .nf-card h2 { font-size: 22px; }
}
@media (max-width: 440px) {
  .nf-top h1 span { display: none; }   /* 窄屏只留图标，给分数和爱心腾地方 */
  .nf-top { gap: 6px; }
}

/* 排行榜：总榜 / 速度榜 两个标签 */
.nf-tabs { caption-side: top; padding-bottom: 6px; }
.nf-tabs button { font: inherit; font-weight: 900; font-size: 14px; border: 2px solid #e6dcff; background: #fff; color: #6a5a94; border-radius: 999px; padding: 5px 14px; margin: 0 3px; cursor: pointer; }
.nf-tabs button.on { background: #ffd23f; border-color: #ffd23f; color: #3b2a5c; }
.nf-table td.nf-note { color: #9b8fc0; font-size: 12px; width: auto; padding: 2px 0 6px; border-top: 0; }
.nf-table td.st { font-size: 11px; letter-spacing: -2px; white-space: nowrap; }
.nf-time { margin: 0; font-weight: 800; color: #6a5a94; }
