/* Apiary frontend — modern clean theme.
   Keeps legacy IDs (game.js depends on them) while refreshing the look. */

:root {
  --bg-grad-a: #1b1b2e;
  --bg-grad-b: #2a1a3a;
  --card: #ffffff;
  --card-soft: #fafafa;
  --accent: #ffb703;
  --accent-2: #fb8500;
  --accent-ink: #1a1a1a;
  --ink: #1f2430;
  --ink-soft: #4a4f5c;
  --muted: #7a7f8c;
  --border: rgba(0, 0, 0, 0.08);
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
  --shadow-sm: 0 3px 10px rgba(0, 0, 0, 0.12);
  --radius: 14px;
  --radius-sm: 10px;
  --font: "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  color: var(--ink);
}

body {
  background: url("front_img/main_background3.jpg") center center / cover no-repeat fixed,
              linear-gradient(135deg, var(--bg-grad-a), var(--bg-grad-b));
  min-height: 100vh;
  display: flex;
  align-items: safe center;
  justify-content: center;
  padding: 24px 16px;
}

/* In-game: hide home UI but keep the main honey background everywhere
   around the canvas so the page looks consistent during gameplay. */
body.in-game {
  padding: 0;
}
body.in-game #mainblock,
body.in-game #mainblock2 { display: none !important; }

a {
  color: var(--accent-2);
  text-decoration: none;
  font-weight: 600;
}
a:hover { text-decoration: underline; }

/* ---- Scrollbars ---- */
* { scrollbar-width: thin; scrollbar-color: #cfd3dc transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background-color: #cfd3dc;
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: content-box;
}

/* ---- Layout ---- */
#main { width: 100%; display: flex; justify-content: center; }

#mainblock,
#mainblock2 {
  display: flex;
  flex-flow: row nowrap;
  align-items: flex-start;
  gap: 16px;
  padding: 18px;
  background: linear-gradient(160deg, #d9af14 0%, #bf0c0c 100%);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 20px;
  box-shadow: 0 18px 60px rgba(90, 15, 0, 0.55);
  max-width: 100%;
}
#mainblock2 { display: none; width: 100%; max-width: 1200px; }

#leftblock,
#centerblock,
#rightblock {
  width: 360px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
#centerblock { width: 360px; }

/* ---- Cards & panels ---- */
#left_info,
#left_info2,
#right_info,
#right_info2 {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  color: var(--ink);
}

.info-title {
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 12px;
  color: var(--ink);
}
.info-lead {
  font-size: 17px;
  color: var(--ink-soft);
  margin-bottom: 10px;
  line-height: 1.45;
}

/* "Как играть?" */
.info-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.info-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 18px;
  color: var(--ink-soft);
  line-height: 1.35;
}
.info-list li img { width: 48px; height: 48px; object-fit: contain; flex-shrink: 0; }
.info-list .info-icons { display: flex; gap: 6px; }
.info-list .info-icons img { width: 42px; height: 42px; }

/* "Что даёт регистрация?" */
.info-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}
.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 183, 3, 0.10);
  border-radius: 8px;
  font-size: 17px;
  color: var(--ink-soft);
  line-height: 1.4;
}
.info-row .info-text { flex: 1; }
.info-row img { width: 45px; height: 45px; object-fit: contain; flex-shrink: 0; }

/* ---- Logo & tabs ---- */
#center_logo {
  margin-top: 4px;
  display: flex;
  justify-content: center;
}
#center_logo img { max-width: 330px; max-height: 165px; height: auto; filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3)); }

#topMenu {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  padding: 4px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 12px;
}
.tab {
  flex: 1;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 600;
  color: #f4f4f4;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, color 0.15s;
}
.tab:hover { background: rgba(255, 255, 255, 0.08); }
.tab-active {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
}

/* ---- Auth cards ---- */
#centerContainer { margin-top: 14px; }

.auth-card,
#center_play,
#center_reg,
#center_login {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  color: var(--ink);
}

.auth-title {
  font-size: 30px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 16px;
}
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink-soft);
}
.auth-form input {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  font-size: 18px;
  color: var(--ink);
  background: #f7f7f9;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-form input:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(251, 133, 0, 0.18);
}
.auth-form button,
#playButton, #reg2Button, #login2Button, #regButton {
  height: 50px;
  width: 100%;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  font-size: 19px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.05s, filter 0.15s;
}
.auth-form button:hover,
#playButton:hover, #reg2Button:hover, #login2Button:hover, #regButton:hover {
  filter: brightness(1.05);
}
.auth-form button:active { transform: translateY(1px); }

.auth-link {
  text-align: center;
  font-size: 16px;
  color: var(--muted);
  margin-top: 4px;
}
.auth-msg {
  margin-top: 10px;
  padding: 8px 10px;
  min-height: 20px;
  font-size: 14px;
  color: #b42318;
  background: rgba(180, 35, 24, 0.08);
  border-radius: 8px;
  line-height: 1.3;
}
.auth-msg:empty { display: none; }

/* Legacy quick-play layout uses #nickname directly; keep compatible */
#nickname, #loginInputReg, #passInputReg, #loginInputLogin, #passInputLogin,
#oldPasswordSettings, #newPasswordSettings, #new2PasswordSettings,
#payTypeSelect, #walletNumberPay, #passwordForPay {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  font-size: 17px;
  color: var(--ink);
  background: #f7f7f9;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  margin-left: 0;
}
#nickname:focus, #loginInputReg:focus, #passInputReg:focus,
#loginInputLogin:focus, #passInputLogin:focus,
#oldPasswordSettings:focus, #newPasswordSettings:focus, #new2PasswordSettings:focus,
#payTypeSelect:focus, #walletNumberPay:focus, #passwordForPay:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(251, 133, 0, 0.18);
}

/* Right column blocks (header rows only — skip #topBlock). */
#right_info > div:not(#topBlock),
#right_info2 > div:not(#topBlock) {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  padding: 6px 0;
}
#right_info > div:not(#topBlock) span,
#right_info2 > div:not(#topBlock) span {
  position: static !important;
  top: auto !important;
  bottom: auto !important;
  font-size: 20px !important;
  font-weight: 600 !important;
  border: none !important;
  line-height: 1.25 !important;
  white-space: normal;
}
#right_info img, #right_info2 img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  flex-shrink: 0;
}

#topBlock, #topBlock1 {
  margin-top: 10px;
  padding: 10px 12px;
  background: #fafafa;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
  text-align: left;
}
/* Home: fixed 10 + self row, never scrolls. */
#topBlock { max-height: none; overflow: visible; }
/* LK sidebar: stays scrollable if the top grows. */
#topBlock1 { max-height: 480px; overflow: auto; }
#topBlock > div, #topBlock1 > div {
  padding: 4px 2px;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.06);
}
#topBlock > div:last-child, #topBlock1 > div:last-child { border-bottom: 0; }

.footer-links,
#rightblock .footer-links { font-size: 16px; }
.footer-links {
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  text-align: center;
}
.footer-links a {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.footer-links a:hover { color: #fff2c4; }

/* ---- Authorized (mainblock2) panel ---- */
#leftcenterblock {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

#lcb_toppanel {
  width: 100%;
  padding: 14px 18px;
  background: linear-gradient(90deg, #fff3d6, #ffd089);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
}
#lcb_toppanel .lcb-cell {
  display: flex !important;
  align-items: center;
  gap: 10px;
  float: none !important;
  width: auto !important;
}
#lcb_toppanel .lcb-amount {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  cursor: default;
}
#lcb_toppanel img { width: 26px; height: 26px; object-fit: contain; }
#lcb_toppanel .lcb-amount img { width: 22px; height: 22px; }

#loginDataNickname { font-size: 20px; font-weight: 700; color: var(--ink); }

#rubinsCount, #sapfiresCount, #loginDataTop {
  font-size: 18px !important;
  font-weight: 700;
  position: static !important;
  top: auto !important;
  color: var(--ink);
}

#logOutButton, #rubinsButton, #rubinsButton2, #sapfireButton {
  height: 34px;
  padding: 0 14px;
  border: none;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.06);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
#logOutButton:hover, #rubinsButton:hover, #rubinsButton2:hover, #sapfireButton:hover {
  background: rgba(0, 0, 0, 0.12);
}
#rubinsButton, #sapfireButton, #rubinsButton2 {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
}
#rubinsButton:hover, #sapfireButton:hover, #rubinsButton2:hover {
  background: var(--accent-2); color: #fff;
}

/* LK body: 2x2 banners on the left, top sidebar on the right. */
#lcb_body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  padding: 22px;
  background: linear-gradient(180deg, #fffbf2, #fff5e0);
}

#centerActions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 1fr;
  gap: 18px;
}
.lcb-action {
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: stretch;
}
.lcb-action:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.lcb-action img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* LK side panel: Top players list */
#lcb_side {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}
.side-title {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 4px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}
.side-title img { width: 24px; height: 24px; }

.top-list {
  max-height: 480px;
  overflow: auto;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
}
.top-empty { color: var(--muted); padding: 18px; text-align: center; }

/* Ordered-list TOP rendering. */
#topBlock ol, #topBlock1 ol {
  display: block;
  margin: 0;
  padding: 0;
  counter-reset: toprank;
  list-style: none;
}
#topBlock li, #topBlock1 li {
  display: list-item;
  counter-increment: toprank;
  padding: 6px 10px 6px 2.4em;
  line-height: 1.4;
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  position: relative;
}
#topBlock li + li, #topBlock1 li + li { margin-top: 2px; }
#topBlock li::before, #topBlock1 li::before {
  content: counter(toprank) ".";
  position: absolute;
  left: 6px;
  top: 6px;
  font-weight: 700;
  color: var(--accent-2);
  white-space: nowrap;
  min-width: 1.8em;
  text-align: right;
}
#topBlock li:nth-child(even), #topBlock1 li:nth-child(even) {
  background: rgba(255, 183, 3, 0.08);
}
#topBlock li:first-child, #topBlock1 li:first-child {
  background: linear-gradient(90deg, #fff3d0 0%, #ffd98a 100%);
  box-shadow: inset 0 0 0 1px rgba(184, 134, 11, 0.35);
}
#topBlock li:first-child::before, #topBlock1 li:first-child::before {
  content: "★";
  color: #b8860b;
  font-size: 1.1em;
}
#topBlock li:nth-child(2), #topBlock1 li:nth-child(2) {
  background: linear-gradient(90deg, #f0f0f0 0%, #d9d9d9 100%);
}
#topBlock li:nth-child(3), #topBlock1 li:nth-child(3) {
  background: linear-gradient(90deg, #f6e0c6 0%, #e0b080 100%);
}
#topBlock li b, #topBlock1 li b { font-weight: 700; color: var(--ink); }
#topBlock li > span, #topBlock1 li > span {
  font-weight: 700; color: var(--accent-2); margin-left: 6px;
}
#topBlock li small, #topBlock1 li small {
  color: var(--muted); font-size: 0.85em; margin-left: 6px; font-weight: 500;
}
#topBlock .top-empty, #topBlock1 .top-empty {
  padding: 16px 6px;
  text-align: center;
  color: var(--muted);
}

/* Guest self-row (home only). */
#topBlock .top-self {
  display: block;
  margin-top: 12px;
  padding: 8px 10px 8px 10px;
  border-top: 1px dashed rgba(0, 0, 0, 0.25);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  background: #eef4ff;
  border-radius: 0 0 6px 6px;
}
#topBlock .top-self > * { vertical-align: middle; }
#topBlock .top-self > span:first-child {
  font-weight: 700; color: #2a5aa0; margin-right: 4px;
}
#topBlock .top-self b { font-weight: 700; color: var(--ink); }
#topBlock .top-self > span { font-weight: 700; color: var(--accent-2); margin-left: 6px; }
#topBlock .top-self small { color: var(--muted); font-size: 0.85em; margin-left: 6px; }
#topBlock .top-self em {
  font-style: normal;
  font-size: 0.78em;
  margin-left: 8px;
  padding: 2px 8px;
  background: #4a90e2;
  color: #fff;
  border-radius: 999px;
  font-weight: 700;
}

/* Generic panel wrapper for sub-screens (shop, settings, etc.) */
.panel { padding: 22px; background: #fffaf0; }
.panel-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.panel-title { font-size: 24px; font-weight: 700; color: var(--ink); }
.back-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  height: 38px;
  padding: 0 18px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  line-height: 1;
}
.back-button:hover { background: var(--accent-2); color: #fff; }
.panel-error {
  margin-left: 12px;
  padding: 6px 12px;
  background: #fde2e1;
  color: #b32a23;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
}
.panel-body {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-soft);
}
.panel-lead { margin-bottom: 12px; color: var(--ink-soft); }
.panel-note { margin-top: 12px; font-size: 14px; color: var(--muted); }
.inline-icon {
  width: 18px; height: 18px;
  vertical-align: middle;
  margin: 0 2px;
}

/* Balance bar (rubins / sapfires balance + button) */
.balance-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 14px 0;
  padding: 14px 16px;
  background: linear-gradient(90deg, #fff3d6, #ffd089);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  font-size: 17px;
  color: var(--ink);
}
.balance-bar b { font-size: 20px; }
.primary-button {
  margin-left: auto;
  height: 38px;
  padding: 0 18px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.primary-button:hover { background: var(--accent-2); color: #fff; }

/* Rubins shop: list of packages */
.rubins-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.rubin-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background: #fff8e1;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 16px;
  color: var(--ink);
}
.rubin-row .rubin-amount { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.rubin-row .rubin-amount img { width: 20px; height: 20px; }
.rubin-row .rubin-old {
  margin-right: 6px;
  text-decoration: line-through;
  color: var(--muted);
  font-weight: 500;
}
.rubin-row .rubin-price { font-weight: 600; color: var(--ink-soft); }
.rubin-row .rubin-buy {
  height: 36px;
  padding: 0 18px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.rubin-row .rubin-buy:hover { background: var(--accent-2); color: #fff; }
.rubins-note { margin-top: 4px; font-size: 13px; color: var(--muted); }

/* Game shop grid — compact single-row cards so 6 fit without scrolling */
.shop-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 460px;
  overflow: auto;
  padding: 4px;
  background: transparent;
  border-radius: var(--radius-sm);
}
.shop-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  min-height: 48px;
}
.shop-item-max { border-left-color: #4caf50; background: #f3faf2; }
.shop-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shop-current {
  font-size: 13px;
  color: var(--ink-soft);
  white-space: nowrap;
}
.shop-level {
  padding: 3px 10px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.shop-item-max .shop-level { background: #4caf50; color: #fff; }
.shop-price {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: var(--ink-soft);
  white-space: nowrap;
}
.shop-price img { width: 16px; height: 16px; }
.upgrade-button {
  height: 32px;
  padding: 0 14px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.upgrade-button:hover:not(:disabled) { background: var(--accent-2); color: #fff; }
.upgrade-button:disabled {
  background: #d6d6d6;
  color: #888;
  cursor: not-allowed;
  padding: 0 10px;
  font-size: 12px;
}
.shop-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  color: var(--accent-2);
  font-weight: 700;
  font-size: 14px;
  cursor: help;
  user-select: none;
  flex-shrink: 0;
}
.shop-help:hover { background: var(--accent); color: var(--accent-ink); }

/* Cursor-follow tooltip */
.cursor-tooltip {
  position: absolute;
  z-index: 9999;
  max-width: 320px;
  min-width: 180px;
  padding: 8px 12px;
  background: rgba(20, 20, 24, 0.94);
  color: #fff;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.45;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

/* Settings */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.settings-card {
  padding: 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}
.settings-title { font-size: 18px; font-weight: 700; margin-bottom: 12px; color: var(--ink); }
.settings-form { display: flex; flex-direction: column; gap: 10px; }
.settings-form label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--ink-soft); font-weight: 600; }
.settings-form input {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  background: #fff;
}
.settings-form button {
  margin-top: 4px;
  height: 40px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
}
.settings-form button:hover { background: var(--accent-2); color: #fff; }

/* History list */
.history-list {
  max-height: 360px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.history-row {
  display: grid;
  grid-template-columns: 50px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #fffaf0;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
}
.history-num { font-weight: 700; color: var(--accent-2); }
.history-score { color: var(--ink); font-weight: 600; }
.history-level { color: var(--muted); font-size: 14px; }
.history-empty { color: var(--muted); padding: 18px; text-align: center; }

/* ---- Rules page ---- */
#rulesPage {
  width: 100%;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px 0;
}
.rules-toolbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  color: #fff;
}
.rules-toolbar .back-button { justify-self: start; }
.rules-toolbar-spacer { justify-self: end; }
.rules-h1 {
  margin: 0;
  justify-self: center;
  text-align: center;
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}
.rules-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 32px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
}
.rules-card h2 {
  font-size: 20px;
  margin: 24px 0 10px;
  color: var(--accent-2);
}
.rules-card ul { padding-left: 22px; margin: 8px 0; }
.rules-card li { margin-bottom: 6px; }
.rules-lead { color: var(--ink-soft); }
.rules-footer { margin-top: 28px; display: flex; justify-content: center; }

/* ---- Game canvas ---- */
#tululoogame {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  cursor: none;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

/* ---- News block (if re-enabled) ---- */
#newsDiv {
  margin: 10px;
  padding: 12px;
  background: rgba(255, 183, 3, 0.15);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  color: var(--ink);
}
