:root {
  --ink: #303744;
  --muted: #7a8494;
  --line: #e7ebf2;
  --soft-blue: #dfeeff;
  --soft-pink: #ffe7ee;
  --soft-mint: #dff8ef;
  --soft-lavender: #ebe6ff;
  --accent: #7aa8e8;
  --accent-strong: #557fc7;
  --surface: #ffffff;
  --page: #f7f9fc;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: "Malgun Gothic", "Segoe UI", Arial, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

code {
  padding: 2px 6px;
  border-radius: 4px;
  background: #eef2f7;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  min-height: 72px;
  padding: 14px clamp(18px, 3vw, 52px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--soft-blue), var(--soft-lavender));
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.main-nav {
  display: flex;
  justify-content: flex-start;
  gap: 10px;
}

.main-nav a,
.btn,
.text-link,
.account-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 8px;
  font-weight: 700;
}

.header-left {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
}

.account-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.account-btn {
  border: 0;
  font: inherit;
  cursor: pointer;
}

.account-btn.join {
  background: var(--soft-lavender);
  color: #6a5aa3;
}

.account-btn.login {
  background: var(--soft-blue);
  color: #426a9f;
}

.account-btn.logout {
  border: 1px solid #ffd5dc;
  background: #fff5f7;
  color: #a35b72;
}

.member-menu {
  position: relative;
}

.member-name {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: var(--soft-mint);
  color: #417a65;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.member-name::after {
  content: "";
  width: 0;
  height: 0;
  margin-left: 8px;
  border-top: 5px solid currentColor;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
}

.member-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  display: grid;
  min-width: 170px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 35px rgba(82, 98, 124, .16);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity .14s ease, transform .14s ease;
}

.member-menu:hover .member-dropdown,
.member-menu:focus-within .member-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.member-dropdown a {
  padding: 13px 14px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.member-dropdown a:hover {
  background: #f6f9fd;
}

.main-nav a:nth-child(1) {
  background: var(--soft-blue);
  color: #426a9f;
}

.main-nav a:nth-child(2) {
  background: var(--soft-mint);
  color: #417a65;
}

.main-nav a:nth-child(3) {
  background: var(--soft-pink);
  color: #a35b72;
}

.btn.primary {
  border: 1px solid #bfd5f7;
  background: var(--soft-blue);
  color: var(--accent-strong);
}

.text-link {
  color: var(--accent-strong);
}

.page-shell {
  width: calc(100% - clamp(36px, 6vw, 104px));
  max-width: none;
  margin: 26px auto 48px;
}

.page-shell.narrow {
  width: calc(100% - clamp(36px, 6vw, 104px));
  max-width: none;
}

.hero-board {
  position: relative;
  display: grid;
  place-items: center;
  margin-bottom: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.hero-board img {
  display: block;
  width: 100%;
  height: clamp(350px, 26vw, 430px);
  object-fit: cover;
  object-position: center 18%;
}

.hero-title {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: start center;
  align-content: start;
  gap: 6px;
  padding: clamp(24px, 3.2vw, 48px) clamp(24px, 8vw, 120px) 0;
  text-align: center;
  pointer-events: none;
}

.hero-title h1 {
  margin: 0;
  color: #41427f;
  font-family: Georgia, "Times New Roman", "Malgun Gothic", serif;
  font-size: clamp(42px, 5vw, 72px);
  font-weight: 800;
  line-height: .95;
  letter-spacing: 0;
  text-shadow: 0 3px 18px rgba(255, 255, 255, .9);
}

.hero-title p {
  margin: 0;
  color: #8b765f;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(14px, 1.7vw, 24px);
  letter-spacing: .16em;
  text-shadow: 0 2px 14px rgba(255, 255, 255, .95);
}

.board-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
}

.main-column,
.side-column {
  display: grid;
  gap: 18px;
  align-content: start;
}

.section-head,
.board-title,
.side-box,
.post-view,
.alert-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(82, 98, 124, .06);
}

.section-head,
.board-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 24px;
}

.section-head h1,
.board-title h1,
.post-view h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: 0;
}

.section-head h2,
.side-box h2 {
  margin: 0;
}

.section-head p,
.board-title p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.board-card {
  min-height: 128px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(82, 98, 124, .06);
  transition: transform .16s ease, border-color .16s ease;
}

.board-card:nth-child(1) {
  background: linear-gradient(180deg, #fff, var(--soft-blue));
}

.board-card:nth-child(2) {
  background: linear-gradient(180deg, #fff, var(--soft-mint));
}

.board-card:nth-child(3) {
  background: linear-gradient(180deg, #fff, var(--soft-pink));
}

.board-card:hover {
  transform: translateY(-2px);
  border-color: #cfd8e8;
}

.board-card strong,
.board-card span {
  display: block;
}

.board-card strong {
  font-size: 21px;
}

.board-card span {
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.55;
}

.post-section {
  display: grid;
  gap: 12px;
}

.section-head.compact {
  padding: 20px 24px;
}

.section-head.compact h2,
.side-box h2 {
  font-size: 22px;
}

.post-table {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.post-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 100px 70px 100px;
  gap: 12px;
  align-items: center;
  min-height: 52px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.post-row:last-child {
  border-bottom: 0;
}

.post-row.head {
  min-height: 44px;
  background: #f1f5fb;
  color: #647086;
  font-weight: 800;
}

.post-row strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

a.post-row:hover {
  background: #fbfdff;
}

.side-box {
  padding: 22px;
}

.notice-list {
  display: grid;
  gap: 14px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.notice-list li {
  display: grid;
  gap: 5px;
}

.notice-list a {
  font-weight: 800;
}

.notice-list small,
.post-meta,
.server-box dd,
.server-box dt {
  color: var(--muted);
}

.server-box dl {
  display: grid;
  gap: 12px;
  margin: 16px 0 0;
}

.server-box div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.server-box div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.server-box dt,
.server-box dd {
  margin: 0;
}

.server-box dd {
  color: var(--ink);
  font-weight: 800;
}

.post-view {
  padding: 30px;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 14px 0 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.post-content {
  min-height: 260px;
  line-height: 1.8;
}

.alert-panel {
  margin-bottom: 18px;
  padding: 18px;
  border-color: #ffd5dc;
  background: #fff5f7;
}

.auth-shell {
  display: grid;
  place-items: start center;
  width: min(520px, calc(100% - 32px));
  margin: 46px auto;
}

.auth-card {
  display: grid;
  gap: 16px;
  width: 100%;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(82, 98, 124, .06);
}

.auth-card h1 {
  margin: 0 0 4px;
  font-size: 32px;
}

.auth-card label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-weight: 800;
}

.auth-card input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid #d8deea;
  border-radius: 8px;
  background: #fbfdff;
  color: var(--ink);
  font: inherit;
}

.auth-card input:focus {
  outline: 3px solid rgba(122, 168, 232, .22);
  border-color: var(--accent);
}

.auth-submit {
  width: 100%;
  margin-top: 4px;
  border: 0;
  font: inherit;
  cursor: pointer;
}

.form-error {
  padding: 12px 14px;
  border: 1px solid #ffd5dc;
  border-radius: 8px;
  background: #fff5f7;
  color: #a35b72;
  font-weight: 700;
}

.member-summary {
  display: grid;
  gap: 12px;
  max-width: 420px;
  margin-top: 24px;
}

.member-summary div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.member-summary span,
.muted-copy {
  color: var(--muted);
}

.empty-row {
  padding: 22px 18px;
  color: var(--muted);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 24px clamp(18px, 3vw, 52px);
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 900px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-left,
  .account-actions {
    width: 100%;
  }

  .main-nav {
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 2px;
  }

  .account-actions {
    margin-left: 0;
    flex-wrap: wrap;
  }

  .board-layout,
  .board-grid {
    grid-template-columns: 1fr;
  }

  .post-row {
    grid-template-columns: 80px minmax(0, 1fr) 70px;
  }

  .post-row span:nth-child(3),
  .post-row span:nth-child(4),
  .post-row time {
    display: none;
  }

  .section-head,
  .board-title,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

.form-success {
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid #c9efdf;
  border-radius: 8px;
  background: #f1fff8;
  color: #417a65;
  font-weight: 700;
}

.admin-alert {
  margin-bottom: 18px;
}

.member-summary.compact {
  margin-top: 0;
}

.admin-title {
  align-items: center;
}

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.admin-stat-grid div {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(82, 98, 124, .05);
}

.admin-stat-grid span,
.role-badge {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  flex: 0 0 auto;
}

.admin-stat-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
}

.admin-panel {
  margin-bottom: 26px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.section-head.simple {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.section-head.simple h2 {
  margin: 4px 0 0;
}

.admin-table {
  display: grid;
  gap: 8px;
}

.admin-row {
  display: grid;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  font-size: 14px;
}

.users-table .admin-row {
  grid-template-columns: 70px 1fr 1fr 100px 110px 130px;
}

.posts-table .admin-row {
  grid-template-columns: 70px 100px minmax(220px, 1fr) 120px 70px 190px;
}

.admin-row.head {
  min-height: 42px;
  background: #f3f6fb;
  color: var(--muted);
  font-weight: 900;
}

.role-badge {
  display: inline-flex;
  justify-content: center;
  width: fit-content;
  min-width: 70px;
  padding: 6px 10px;
  border-radius: 999px;
}

.role-badge.admin {
  background: var(--soft-blue);
  color: #426a9f;
}

.role-badge.member {
  background: #eef2f7;
}

.inline-form {
  margin: 0;
}

.admin-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mini-btn {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #d8deea;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.mini-btn:hover:not(:disabled) {
  background: #f6f9fd;
}

.mini-btn.danger {
  border-color: #ffd5dc;
  color: #a35b72;
}

.mini-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

@media (max-width: 900px) {
  .admin-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .users-table .admin-row,
  .posts-table .admin-row {
    grid-template-columns: 1fr;
  }

  .admin-row.head {
    display: none;
  }
}

.member-status-card {
  position: relative;
  display: grid;
  gap: 12px;
  min-width: 272px;
  padding: 16px;
  overflow: hidden;
  border-bottom: 1px solid #e9edf5;
  background:
    radial-gradient(circle at 92% 8%, rgba(122, 168, 232, .24), transparent 30%),
    linear-gradient(135deg, #ffffff 0%, #f7fbff 54%, #f9f6ff 100%);
}

.member-status-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, #7aa8e8, #bda7ff, #7fd9bd);
}

.member-status-top {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.member-status-top strong {
  display: block;
  margin-top: 4px;
  color: #26344a;
  font-size: 24px;
  line-height: 1;
  letter-spacing: -.03em;
}

.member-status-top em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(85, 127, 199, .16);
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  color: var(--accent-strong);
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 6px 16px rgba(85, 127, 199, .10);
}

.member-status-label {
  display: block;
  color: #8c96a8;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
}

.member-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 11px;
  border: 1px solid rgba(231, 235, 242, .92);
  border-radius: 12px;
  background: rgba(255, 255, 255, .72);
}

.member-status-row span,
.member-level-card span,
.shop-stock {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.member-status-row strong {
  color: #303744;
  font-size: 13px;
  font-weight: 900;
}

.member-status-row.point strong {
  color: #557fc7;
}

.member-exp-bar,
.profile-exp-bar {
  overflow: hidden;
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: #e9eef6;
  box-shadow: inset 0 1px 3px rgba(48, 55, 68, .08);
}

.member-exp-bar span,
.profile-exp-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #bda7ff, #7fd9bd);
}

.member-level-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0;
}

.member-level-card div {
  min-height: 76px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(82, 98, 124, .05);
}

.profile-exp-bar {
  margin: 0 0 18px;
  height: 12px;
}

.point-shop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 22px 0;
}

.point-shop-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(82, 98, 124, .05);
}

.point-shop-card h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.point-shop-card p {
  min-height: 46px;
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.65;
}

.shop-price {
  margin-bottom: 8px;
  color: var(--accent-strong);
  font-size: 24px;
  font-weight: 900;
}

.point-shop-card form {
  margin-top: 16px;
}

.purchases-table .admin-row {
  grid-template-columns: minmax(160px, 1fr) 100px 100px 170px;
}

@media (max-width: 900px) {
  .member-level-card,
  .point-shop-grid {
    grid-template-columns: 1fr;
  }

  .purchases-table .admin-row {
    grid-template-columns: 1fr 90px;
  }

  .purchases-table .admin-row span:nth-child(3),
  .purchases-table .admin-row span:nth-child(4) {
    display: none;
  }
}

/* refined member dropdown visual */
.member-dropdown {
  min-width: 292px;
  border: 1px solid rgba(222, 229, 240, .88);
  border-radius: 18px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 22px 55px rgba(38, 52, 74, .18);
  backdrop-filter: blur(14px);
}

.member-dropdown::before {
  content: "";
  position: absolute;
  top: -7px;
  right: 34px;
  width: 14px;
  height: 14px;
  border-top: 1px solid rgba(222, 229, 240, .88);
  border-left: 1px solid rgba(222, 229, 240, .88);
  background: rgba(255, 255, 255, .96);
  transform: rotate(45deg);
}

.member-dropdown a {
  position: relative;
  margin: 0 10px;
  padding: 12px 13px;
  border-radius: 12px;
  color: #303744;
  font-size: 14px;
  font-weight: 800;
}

.member-dropdown a:first-of-type {
  margin-top: 8px;
}

.member-dropdown a:last-child {
  margin-bottom: 10px;
}

.member-dropdown a:hover {
  background: linear-gradient(135deg, #f3f8ff, #f8f5ff);
  color: #456fb3;
  transform: translateX(2px);
}

.member-status-card {
  min-width: 292px;
  padding: 18px;
  gap: 14px;
  border-bottom: 1px solid rgba(232, 237, 247, .86);
  background:
    radial-gradient(circle at 12% 0%, rgba(127, 217, 189, .25), transparent 34%),
    radial-gradient(circle at 98% 18%, rgba(189, 167, 255, .30), transparent 36%),
    linear-gradient(145deg, #ffffff 0%, #f6fbff 50%, #fbf8ff 100%);
}

.member-status-card::before {
  height: 4px;
  background: linear-gradient(90deg, #7fd9bd 0%, #7aa8e8 48%, #bda7ff 100%);
}

.member-status-hero {
  position: relative;
  display: grid;
  grid-template-columns: 58px 1fr auto;
  align-items: center;
  gap: 12px;
}

.member-level-orb {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(255, 255, 255, .70);
  border-radius: 20px;
  background: linear-gradient(145deg, #6fb8ff, #8a7cff 58%, #76dac0);
  color: #fff;
  box-shadow: 0 14px 28px rgba(92, 112, 210, .24);
}

.member-level-orb span {
  margin-bottom: -8px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  opacity: .88;
}

.member-level-orb strong {
  font-size: 25px;
  line-height: 1;
  letter-spacing: -.04em;
}

.member-status-copy {
  min-width: 0;
}

.member-status-copy strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: #26344a;
  font-size: 18px;
  line-height: 1.15;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-status-copy small {
  display: block;
  margin-top: 5px;
  color: #7e8899;
  font-size: 12px;
  font-weight: 800;
}

.member-percent-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(85, 127, 199, .14);
  border-radius: 999px;
  background: rgba(255, 255, 255, .78);
  color: #557fc7;
  font-style: normal;
  font-size: 12px;
  font-weight: 950;
  box-shadow: 0 8px 18px rgba(85, 127, 199, .12);
}

.member-exp-wrap {
  position: relative;
  padding: 13px;
  border: 1px solid rgba(226, 232, 242, .9);
  border-radius: 16px;
  background: rgba(255, 255, 255, .68);
}

.member-exp-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.member-exp-title span,
.member-mini-stat span {
  color: #7f8a9d;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.member-exp-title strong {
  color: #303744;
  font-size: 12px;
  font-weight: 900;
}

.member-exp-bar {
  height: 11px;
  background: #e8eef8;
}

.member-exp-bar span {
  position: relative;
  background: linear-gradient(90deg, #6fb8ff, #8d7cff 52%, #76dac0);
  box-shadow: 0 5px 14px rgba(111, 184, 255, .32);
}

.member-exp-bar span::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
  opacity: .62;
}

.member-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.member-mini-stat {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid rgba(226, 232, 242, .88);
  border-radius: 15px;
  background: rgba(255, 255, 255, .70);
}

.member-mini-stat strong {
  color: #26344a;
  font-size: 16px;
  line-height: 1;
  font-weight: 950;
}

.member-mini-stat.point strong {
  color: #557fc7;
}

/* member dropdown premium card - 2026-06-08 */
.member-menu {
  position: relative;
}

.member-name {
  min-height: 40px;
  padding: 0 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, #dff8ee 0%, #d7f2ea 100%);
  color: #2f735f;
  box-shadow: 0 10px 24px rgba(88, 173, 142, .12);
}

.member-name::after {
  border-top-width: 0;
  border-right-width: 0;
  border-left-width: 0;
  width: 7px;
  height: 7px;
  margin-left: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform .16s ease;
}

.member-menu:hover .member-name::after,
.member-menu:focus-within .member-name::after {
  transform: rotate(225deg) translate(-2px, -1px);
}

.member-dropdown {
  right: 50%;
  top: calc(100% + 16px);
  display: block;
  width: min(520px, calc(100vw - 28px));
  min-width: 0;
  overflow: visible;
  border: 1px solid rgba(220, 226, 238, .92);
  border-radius: 18px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 26px 70px rgba(30, 42, 68, .20);
  backdrop-filter: blur(16px);
  transform: translate(50%, -8px) scale(.985);
  transform-origin: top center;
}

.member-menu:hover .member-dropdown,
.member-menu:focus-within .member-dropdown {
  transform: translate(50%, 0) scale(1);
}

.member-dropdown::before {
  content: "";
  position: absolute;
  top: -8px;
  right: calc(50% - 8px);
  width: 16px;
  height: 16px;
  border-top: 1px solid rgba(220, 226, 238, .92);
  border-left: 1px solid rgba(220, 226, 238, .92);
  background: rgba(255, 255, 255, .98);
  transform: rotate(45deg);
}

.member-status-card {
  position: relative;
  display: block;
  min-width: 0;
  padding: 28px 28px 24px;
  overflow: hidden;
  border-bottom: 1px solid #edf1f7;
  border-radius: 18px 18px 0 0;
  background:
    radial-gradient(circle at 0% 0%, rgba(112, 218, 187, .20), transparent 34%),
    radial-gradient(circle at 100% 10%, rgba(132, 102, 235, .17), transparent 32%),
    linear-gradient(145deg, #ffffff 0%, #fbfdff 50%, #fbfaff 100%);
}

.member-status-card::before {
  display: none;
}

.member-profile-head {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 18px;
  align-items: center;
}

.member-avatar {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  border: 5px solid #fff;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 230, 158, .24), transparent 27%),
    linear-gradient(145deg, #1f2937, #0f172a 68%, #111827);
  box-shadow: 0 12px 28px rgba(15, 23, 42, .18), 0 0 0 1px rgba(217, 223, 235, .95);
  color: #e7c46c;
  font-size: 42px;
  line-height: 1;
}

.member-profile-name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.member-profile-name strong {
  overflow: hidden;
  color: #1f2937;
  font-size: 24px;
  line-height: 1.15;
  font-weight: 950;
  letter-spacing: -.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-profile-name em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  background: linear-gradient(135deg, #8b6df6, #6f55e8);
  color: #fff;
  font-style: normal;
  font-size: 14px;
  font-weight: 950;
  box-shadow: 0 8px 16px rgba(111, 85, 232, .23);
}

.member-level-line {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
  color: #7a61ea;
}

.member-level-icon {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8068f2, #6d5be8);
  color: #fff;
  font-size: 13px;
  box-shadow: 0 8px 16px rgba(109, 91, 232, .18);
}

.member-level-line b {
  font-size: 21px;
  font-weight: 950;
}

.member-profile-text small {
  display: block;
  margin-top: 8px;
  color: #566174;
  font-size: 15px;
  font-weight: 700;
}

.member-progress-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  margin-top: 28px;
}

.member-progress-row .member-exp-bar {
  height: 13px;
  border-radius: 999px;
  background: #e9edf4;
  box-shadow: inset 0 1px 3px rgba(31, 41, 55, .08);
}

.member-progress-row .member-exp-bar span {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8068f2 0%, #7357e6 100%);
  box-shadow: 0 7px 15px rgba(115, 87, 230, .25);
}

.member-progress-row strong {
  color: #8068f2;
  font-size: 22px;
  font-weight: 950;
}

.member-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 28px -28px -24px;
  padding: 24px 20px;
  border-top: 1px solid #edf1f7;
  background: rgba(255, 255, 255, .55);
}

.member-mini-stat {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 0 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: center;
}

.member-mini-stat + .member-mini-stat {
  border-left: 1px solid #e3e8f1;
}

.member-mini-stat i {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 3px solid currentColor;
  border-radius: 50%;
  background: #fff;
  font-style: normal;
  font-size: 14px;
  font-weight: 950;
}

.member-mini-stat.exp i { color: #5c96e8; }
.member-mini-stat.point i { color: #efb842; }
.member-mini-stat.level i { color: #5ec58a; }
.member-mini-stat.level i {
  font-size: 13px;
  letter-spacing: -.04em;
}


.member-mini-stat span {
  color: #303744;
  font-size: 15px;
  font-weight: 850;
  letter-spacing: -.02em;
  text-transform: none;
}

.member-mini-stat strong,
.member-mini-stat.point strong {
  color: #1f2937;
  font-size: 18px;
  line-height: 1;
  font-weight: 950;
}

.member-mini-stat small {
  color: #6f7b8d;
  font-size: 13px;
  font-weight: 700;
}

.member-menu-links {
  padding: 16px 22px 18px;
}

.member-dropdown .member-link {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 14px;
  align-items: center;
  min-height: 56px;
  margin: 0;
  padding: 7px 4px 7px 0;
  border-radius: 14px;
  color: #1f2937;
  font-size: 17px;
  font-weight: 850;
  transition: background .14s ease, transform .14s ease;
}

.member-dropdown .member-link:hover {
  background: #f8fbff;
  color: #1f2937;
  transform: translateX(2px);
}

.member-link span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-left: 6px;
  border-radius: 11px;
  font-size: 19px;
  font-weight: 900;
}

.member-link.profile span { background: #f0eaff; color: #8068f2; }
.member-link.posts span { background: #eaf4ff; color: #4c8fdf; }
.member-link.shop span { background: #fff0f3; color: #e36179; }
.member-link.attendance span { background: #fff7e6; color: #d58a1d; }
.member-link.admin span { background: #eef2f6; color: #627181; }

.member-link.profile span::before { content: "♡"; }
.member-link.posts span::before { content: "✎"; }
.member-link.shop span::before { content: "▢"; }
.member-link.attendance span::before { content: "☀"; }
.member-link.admin span::before { content: "⚙"; }

.member-link b {
  font-weight: 850;
}

.member-link em {
  color: #7b8494;
  font-style: normal;
  font-size: 30px;
  line-height: 1;
}

@media (max-width: 640px) {
  .member-dropdown {
    right: 0;
    width: calc(100vw - 24px);
    transform: translate(0, -8px) scale(.985);
  }

  .member-menu:hover .member-dropdown,
  .member-menu:focus-within .member-dropdown {
    transform: translate(0, 0) scale(1);
  }

  .member-dropdown::before {
    right: 34px;
  }

  .member-status-card {
    padding: 22px 18px 18px;
  }

  .member-profile-head {
    grid-template-columns: 68px 1fr;
    gap: 14px;
  }

  .member-avatar {
    width: 68px;
    height: 68px;
    font-size: 34px;
  }

  .member-profile-name strong {
    font-size: 20px;
  }

  .member-status-grid {
    margin: 22px -18px -18px;
    padding: 18px 10px;
  }

  .member-mini-stat {
    padding: 0 8px;
  }

  .member-mini-stat strong,
  .member-mini-stat.point strong {
    font-size: 15px;
  }
}

/* dropdown viewport fix - 2026-06-08
   Keeps premium member card inside the browser width and removes horizontal scroll. */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

.site-header,
.header-left,
.account-actions,
.member-menu {
  overflow: visible;
}

.member-dropdown {
  left: auto !important;
  right: 0 !important;
  width: min(430px, calc(100vw - 24px)) !important;
  max-width: calc(100vw - 24px) !important;
  transform: translateY(-8px) scale(.985) !important;
  transform-origin: top right !important;
}

.member-menu:hover .member-dropdown,
.member-menu:focus-within .member-dropdown {
  transform: translateY(0) scale(1) !important;
}

.member-dropdown::before {
  right: 34px !important;
}

.member-status-card {
  padding: 26px 24px 22px;
}

.member-status-grid {
  margin: 26px -24px -22px;
  padding: 22px 16px;
}

.member-mini-stat {
  padding: 0 12px;
}

.member-menu-links {
  padding: 14px 20px 16px;
}

@media (max-width: 640px) {
  .member-dropdown {
    right: 0 !important;
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
  }

  .member-dropdown::before {
    right: 34px !important;
  }
}

/* mobile hero image fit fix - 2026-06-08
   On narrow screens, show the full banner instead of cropping the server title. */
@media (max-width: 768px) {
  .hero-board {
    border-radius: 10px;
    background: #fff;
  }

  .hero-board img {
    width: 100%;
    height: auto !important;
    max-height: none !important;
    object-fit: contain !important;
    object-position: center center !important;
  }
}


@media (max-width: 768px) {
  .hero-board img {
    height: auto !important;
    min-height: 0 !important;
    object-fit: contain !important;
    object-position: center center !important;
  }

  .hero-board {
    height: auto;
  }
}


/* final hero responsive fix - 2026-06-08 */
.hero-board {
  height: 350px !important;
  min-height: 350px !important;
  padding: 0 !important;
  overflow: hidden !important;
}

.hero-board img {
  width: 100% !important;
  height: 350px !important;
  display: block !important;
  object-fit: cover !important;
  object-position: center center !important;
}

@media (max-width: 768px) {
  .hero-board {
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  .hero-board img {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    display: block !important;
    object-fit: contain !important;
    object-position: center center !important;
  }
}

/* admin left navigation + point management */
.admin-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.admin-sidebar {
  position: sticky;
  top: 96px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 18px 42px rgba(82, 98, 124, .08);
}

.admin-sidebar .eyebrow {
  margin: 0 0 12px;
}

.admin-side-nav {
  display: grid;
  gap: 10px;
}

.admin-side-nav a {
  display: grid;
  gap: 4px;
  padding: 14px 15px;
  border: 1px solid #e6ebf4;
  border-radius: 14px;
  background: #f9fbff;
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease;
}

.admin-side-nav a:hover,
.admin-side-nav a.active {
  background: linear-gradient(135deg, #eef6ff, #fff4f8);
  box-shadow: 0 14px 30px rgba(82, 98, 124, .11);
  transform: translateY(-1px);
}

.admin-side-nav strong {
  font-size: 16px;
}

.admin-side-nav span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-content {
  min-width: 0;
}

.point-rules-table .admin-row {
  grid-template-columns: minmax(130px, 1.2fr) 92px 92px 92px 76px minmax(220px, 2fr);
}

.point-ranking-table .admin-row {
  grid-template-columns: 70px minmax(180px, 1fr) 100px 150px 150px;
}

.point-rules-table input[type="number"] {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid #d8deea;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
}

.switch-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.switch-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-strong);
}

.form-actions.right {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.point-ranking-table small {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 980px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
  }

  .admin-side-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .point-rules-table .admin-row,
  .point-ranking-table .admin-row {
    grid-template-columns: 1fr 1fr;
  }

  .point-rules-table .admin-row.head,
  .point-ranking-table .admin-row.head {
    display: none;
  }
}

/* security/admin hardening additions */
.security-users-table .admin-row {
  grid-template-columns: 64px minmax(150px, 1fr) 150px 90px 96px minmax(280px, 1.9fr);
}

.security-users-table strong small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.role-badge.banned {
  background: #fff1f1;
  color: #c24141;
  border-color: #ffd6d6;
}

.admin-action-stack {
  display: grid;
  gap: 7px;
}

.member-ban-form,
.point-adjust-form {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) auto;
  gap: 6px;
}

.point-adjust-form {
  grid-template-columns: 92px minmax(90px, 1fr) auto;
}

.member-ban-form input,
.point-adjust-form input {
  min-height: 34px;
  padding: 0 9px;
  border: 1px solid #d8deea;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
}

.mini-btn.danger {
  background: #fff1f1;
  color: #c24141;
  border-color: #ffd6d6;
}

.log-table .admin-row {
  grid-template-columns: 150px minmax(120px, 1fr) 110px 90px 110px minmax(150px, 1.6fr);
}

.admin-side-nav a[href*="logs"] strong::before,
.admin-side-nav a[href*="backup"] strong::before {
  margin-right: 6px;
}

.admin-side-nav a[href*="logs"] strong::before { content: "🧾"; }
.admin-side-nav a[href*="backup"] strong::before { content: "💾"; }

@media (max-width: 980px) {
  .security-users-table .admin-row,
  .log-table .admin-row {
    grid-template-columns: 1fr 1fr;
  }

  .security-users-table .admin-row.head,
  .log-table .admin-row.head {
    display: none;
  }

  .admin-action-stack,
  .member-ban-form,
  .point-adjust-form {
    grid-column: 1 / -1;
  }
}


/* STEP 2: server status, comments, level-up popup */
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 950;
}

.status-pill.pending {
  background: #fff7e6;
  color: #a36b00;
}

.status-pill.neutral {
  background: #eef4ff;
  color: #557fc7;
}

.status-pill.online {
  background: #ecfff6;
  color: #2f8b66;
}

.status-pill.offline {
  background: #fff1f1;
  color: #c24141;
}

.compact-list {
  gap: 12px;
}

.comment-list a {
  line-height: 1.45;
}

.comments-section {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.comment-list-box,
.comment-form,
.comment-login-box {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(82, 98, 124, .05);
}

.comment-list-box {
  overflow: hidden;
}

.comment-item {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.comment-item:last-child {
  border-bottom: 0;
}

.comment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.comment-meta strong {
  color: #26344a;
}

.comment-meta time {
  color: var(--muted);
  font-size: 13px;
}

.comment-item p {
  margin: 0;
  color: #303744;
  line-height: 1.7;
}

.comment-form {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.comment-form label {
  display: grid;
  gap: 9px;
  font-weight: 900;
}

.comment-form textarea {
  width: 100%;
  min-height: 110px;
  padding: 14px;
  resize: vertical;
  border: 1px solid #d8deea;
  border-radius: 10px;
  background: #fbfdff;
  color: var(--ink);
  font: inherit;
  line-height: 1.6;
}

.comment-form textarea:focus {
  outline: 3px solid rgba(122, 168, 232, .22);
  border-color: var(--accent);
}

.comment-login-box {
  padding: 18px 20px;
  color: var(--muted);
  font-weight: 800;
}

.levelup-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, .42);
  backdrop-filter: blur(8px);
  animation: levelupFadeIn .2s ease both;
}

.levelup-popup {
  position: relative;
  width: min(420px, calc(100vw - 40px));
  overflow: hidden;
  padding: 32px 28px 28px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 28px;
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 225, 145, .42), transparent 34%),
    radial-gradient(circle at 96% 18%, rgba(140, 105, 255, .28), transparent 36%),
    linear-gradient(145deg, #ffffff 0%, #fbfdff 54%, #fff8fb 100%);
  box-shadow: 0 28px 90px rgba(15, 23, 42, .28);
  text-align: center;
  animation: levelupPop .32s cubic-bezier(.2, 1.25, .35, 1) both;
}

.levelup-sparkles {
  font-size: 38px;
  letter-spacing: 8px;
  animation: levelupFloat 1.2s ease-in-out infinite alternate;
}

.levelup-badge {
  display: inline-flex;
  margin: 14px auto 10px;
  padding: 7px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #8068f2, #6fb8ff);
  color: #fff;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .12em;
}

.levelup-popup h2 {
  margin: 0;
  color: #1f2937;
  font-size: 34px;
  line-height: 1.1;
  font-weight: 950;
}

.levelup-popup p {
  margin: 12px 0 0;
  color: #566174;
  font-size: 17px;
  font-weight: 800;
}

.levelup-reward {
  margin: 22px 0 20px;
  padding: 16px;
  border: 1px solid #edf1f7;
  border-radius: 18px;
  background: rgba(255, 255, 255, .78);
  color: #7a8494;
  font-weight: 900;
}

.levelup-reward strong {
  display: block;
  margin-top: 6px;
  color: #ef9f2f;
  font-size: 28px;
}

.levelup-close {
  min-width: 140px;
  min-height: 46px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #8068f2, #6fb8ff);
  color: #fff;
  font: inherit;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 14px 26px rgba(111, 132, 240, .24);
}

@keyframes levelupFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes levelupPop {
  from { opacity: 0; transform: translateY(16px) scale(.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes levelupFloat {
  from { transform: translateY(0); }
  to { transform: translateY(-7px); }
}

/* STEP 3: attendance, post writing, recommendation */
.main-nav a:nth-child(4) {
  background: var(--soft-lavender);
  color: #6a5aa3;
}

.member-link.attendance span {
  background: #fff6d9;
}

.post-write-card,
.attendance-card {
  display: grid;
  gap: 18px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 16px 36px rgba(82, 98, 124, .07);
}

.post-write-card label,
.attendance-card label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

.post-write-card input,
.post-write-card select,
.post-write-card textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 14px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

.post-write-card textarea {
  min-height: 320px;
  resize: vertical;
  line-height: 1.7;
}

.check-line {
  display: inline-flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px !important;
  color: var(--ink) !important;
}

.check-line input {
  width: auto;
}

.comment-count {
  color: #7b61e8;
  font-size: 13px;
}

.post-action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: -8px 0 22px;
}

.recommend-btn,
.attendance-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid #ffd5dc;
  border-radius: 999px;
  padding: 0 18px;
  background: linear-gradient(135deg, #fff5f7, #ffe7ee);
  color: #a35b72;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(163, 91, 114, .1);
}

.recommend-btn:hover,
.attendance-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.recommend-btn.small {
  min-height: 34px;
  padding: 0 13px;
  font-size: 13px;
}

.comment-recommend-form {
  margin-top: 10px;
}

.attendance-card {
  place-items: center;
  text-align: center;
  background:
    radial-gradient(circle at top left, rgba(223, 238, 255, .85), transparent 32%),
    radial-gradient(circle at bottom right, rgba(235, 230, 255, .75), transparent 35%),
    #fff;
}

.attendance-card h1 {
  margin: 0;
  font-size: clamp(32px, 4vw, 48px);
}

.attendance-card p {
  margin: 0;
  color: var(--muted);
}

.attendance-reward {
  display: inline-grid;
  gap: 5px;
  min-width: min(100%, 340px);
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.85);
}

.attendance-reward span {
  color: var(--muted);
  font-weight: 800;
}

.attendance-reward strong {
  color: #7b61e8;
  font-size: 24px;
}

.attendance-button {
  min-width: 220px;
  min-height: 54px;
  border-color: #cbdcf8;
  background: linear-gradient(135deg, var(--soft-blue), var(--soft-lavender));
  color: #557fc7;
  font-size: 18px;
}

.attendance-button:disabled {
  opacity: .65;
  cursor: not-allowed;
}

.attendance-history {
  margin-top: 18px;
}

@media (max-width: 760px) {
  .post-write-card,
  .attendance-card {
    padding: 22px;
  }

  .post-write-card textarea {
    min-height: 240px;
  }

  .post-action-row {
    align-items: stretch;
  }

  .post-action-row > * {
    width: 100%;
  }

  .recommend-btn,
  .post-action-row .btn {
    width: 100%;
  }
}

/* STEP4 admin dashboard */
.admin-title-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.admin-stat-grid small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.admin-dashboard-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  padding: 24px;
  border: 1px solid #e6ebf4;
  border-radius: 22px;
  background:
    radial-gradient(circle at 12% 0%, rgba(115, 169, 255, .18), transparent 34%),
    linear-gradient(135deg, #ffffff 0%, #f7fbff 50%, #fff6fa 100%);
  box-shadow: 0 22px 52px rgba(82, 98, 124, .09);
}

.admin-dashboard-hero h2 {
  margin: 4px 0 8px;
  font-size: 28px;
}

.admin-dashboard-hero p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.admin-dashboard-mini {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-dashboard-mini span {
  padding: 10px 13px;
  border: 1px solid #e5ebf5;
  border-radius: 999px;
  background: rgba(255, 255, 255, .82);
  color: #56627a;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(82, 98, 124, .06);
}

.admin-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.dashboard-card .section-head.simple {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-list {
  display: grid;
  gap: 10px;
}

.dashboard-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 12px 13px;
  border: 1px solid #eef2f8;
  border-radius: 14px;
  background: #fbfdff;
}

.dashboard-list span {
  min-width: 0;
  color: #2f3a51;
  font-weight: 900;
}

.dashboard-list a {
  color: inherit;
}

.dashboard-list small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-list b {
  flex: 0 0 auto;
  color: #4f6ea8;
  font-size: 13px;
  font-weight: 1000;
  white-space: nowrap;
}

.rank-list > div strong {
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: linear-gradient(135deg, #eef6ff, #fff1f7);
  color: #55709d;
}

.point-flow-list b.plus { color: #2a9d68; }
.point-flow-list b.minus { color: #db5a6b; }

.admin-log-preview b {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 920px) {
  .admin-dashboard-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-dashboard-mini {
    justify-content: flex-start;
  }

  .admin-dashboard-grid {
    grid-template-columns: 1fr;
  }
}


/* STEP 4.1: common right sidebar + dashboard readability polish */
.page-with-sidebar {
  align-items: start;
}

.common-side-column {
  position: relative;
}

.rich-list li {
  padding: 12px 0;
  border-bottom: 1px solid rgba(221, 228, 238, .72);
}

.rich-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.rich-list a {
  display: block;
  overflow: hidden;
  color: #26344a;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rich-list small {
  display: block;
  margin-top: 6px;
  color: #7a879a;
  font-size: 12px;
  line-height: 1.45;
}

.main-nav a:nth-child(4),
.attendance-button {
  background: linear-gradient(135deg, #6f8cff, #8b6ff6) !important;
  color: #fff !important;
  border-color: rgba(111, 140, 255, .28) !important;
  box-shadow: 0 12px 26px rgba(111, 140, 255, .18);
}

.admin-stat-grid {
  gap: 18px;
  margin-bottom: 30px;
}

.admin-stat-grid div {
  position: relative;
  overflow: hidden;
  min-height: 148px;
  padding: 22px 22px 20px;
  border: 0;
  border-radius: 22px;
  box-shadow: 0 18px 44px rgba(82, 98, 124, .10);
}

.admin-stat-grid div::after {
  content: "";
  position: absolute;
  right: -26px;
  bottom: -34px;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .48);
}

.admin-stat-grid div:nth-child(1) {
  background: linear-gradient(135deg, #eef7ff, #ffffff);
}

.admin-stat-grid div:nth-child(2) {
  background: linear-gradient(135deg, #f1fff8, #ffffff);
}

.admin-stat-grid div:nth-child(3) {
  background: linear-gradient(135deg, #fff7ea, #ffffff);
}

.admin-stat-grid div:nth-child(4) {
  background: linear-gradient(135deg, #f6f0ff, #ffffff);
}

.admin-stat-grid span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .7);
  color: #536174;
}

.admin-stat-grid strong {
  margin-top: 16px;
  color: #253149;
  font-size: clamp(30px, 3vw, 42px);
  line-height: 1;
}

.admin-stat-grid small {
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid rgba(124, 139, 164, .16);
  color: #6b778d;
  font-size: 13px;
}

.admin-dashboard-hero {
  margin-bottom: 28px;
  padding: 30px;
  border-radius: 28px;
}

.admin-dashboard-mini {
  gap: 12px;
}

.admin-dashboard-mini span {
  padding: 12px 16px;
  border-radius: 16px;
}

.admin-dashboard-grid {
  gap: 22px;
  margin-bottom: 22px;
}

.admin-dashboard-grid + .admin-dashboard-grid {
  margin-top: 6px;
}

.dashboard-card {
  padding: 24px;
  border-radius: 22px;
  box-shadow: 0 16px 42px rgba(82, 98, 124, .08);
}

.dashboard-card .section-head.simple {
  margin-bottom: 18px;
  padding-bottom: 16px;
}

.dashboard-list {
  gap: 12px;
}

.dashboard-list > div {
  min-height: 58px;
  padding: 14px 16px;
  border-color: #edf2f9;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
}

.dashboard-list > div:nth-child(even) {
  background: #f8fbff;
}

.rank-list > div strong {
  background: linear-gradient(135deg, #7aa8e8, #9a84ff);
  color: #fff;
  box-shadow: 0 10px 18px rgba(122, 132, 255, .18);
}

.dashboard-list small {
  margin-top: 5px;
  line-height: 1.45;
}

.point-flow-list b.plus {
  padding: 6px 10px;
  border-radius: 999px;
  background: #ecfff6;
}

.point-flow-list b.minus {
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff1f3;
}

.admin-log-preview > div {
  align-items: flex-start;
}

@media (max-width: 980px) {
  .page-with-sidebar,
  .board-layout {
    grid-template-columns: 1fr;
  }

  .common-side-column {
    order: 2;
  }
}


/* STEP 4.2: sidebar compact polish + dropdown icon tone */
.common-side-column {
  gap: 14px;
}

.common-side-column .side-box {
  padding: 16px;
  border-radius: 16px;
}

.side-box-title {
  margin: -2px 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(218, 226, 240, .95);
  border-radius: 14px;
  background: linear-gradient(135deg, #f8fbff, #fff7fb);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
}

.side-box-title .eyebrow {
  margin: 0 0 3px;
  color: #7384a2;
  font-size: 10px;
  line-height: 1.1;
  letter-spacing: .04em;
}

.side-box-title h2 {
  margin: 0;
  color: #25324a;
  font-size: 17px;
  line-height: 1.18;
  font-weight: 950;
}

.common-side-column .notice-list {
  gap: 0;
  margin-top: 10px;
}

.common-side-column .rich-list li {
  gap: 3px;
  padding: 8px 0;
}

.common-side-column .rich-list a {
  font-size: 13px;
  line-height: 1.32;
  font-weight: 850;
}

.common-side-column .rich-list small {
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.25;
}

.common-side-column .server-box dl {
  gap: 8px;
  margin-top: 10px;
}

.common-side-column .server-box div {
  min-height: 30px;
  padding: 7px 9px;
  border-radius: 12px;
  background: #fbfdff;
}

.common-side-column .status-pill {
  min-width: auto;
  padding: 5px 9px;
  font-size: 11px;
}

.member-link.attendance span {
  background: linear-gradient(135deg, #fff7e6, #fff0f4) !important;
  color: #d98a1c !important;
  border: 1px solid rgba(239, 181, 81, .28);
  box-shadow: 0 10px 20px rgba(217, 138, 28, .08);
}

.member-link.attendance span::before {
  content: "☀";
  color: #d98a1c !important;
}

@media (max-width: 980px) {
  .common-side-column .side-box {
    padding: 15px;
  }

  .common-side-column .rich-list li {
    padding: 7px 0;
  }
}


/* STEP 5.1: ranking widgets + sidebar/admin compact refinements */
.common-side-column .server-status-box {
  padding-bottom: 14px;
}

.common-side-column .server-box dl {
  gap: 5px;
  margin-top: 8px;
}

.common-side-column .server-box div {
  min-height: 25px;
  padding: 5px 8px;
  border-radius: 10px;
  line-height: 1.15;
}

.common-side-column .server-box dt,
.common-side-column .server-box dd {
  font-size: 13px;
  line-height: 1.15;
}

.common-side-column .status-pill {
  padding: 4px 8px;
  font-size: 10px;
  line-height: 1;
}

.common-side-column .rich-list {
  padding-left: 10px;
}

.common-side-column .rich-list li {
  padding: 7px 0 7px 2px;
}

.common-side-column .rich-list a,
.common-side-column .rich-list small {
  padding-left: 2px;
}

.ranking-list {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.ranking-list li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 5px 7px;
  border: 1px solid rgba(226, 232, 242, .84);
  border-radius: 11px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
}

.ranking-list li:nth-child(1) {
  background: linear-gradient(135deg, #fff8e9, #ffffff);
}

.ranking-list li:nth-child(2) {
  background: linear-gradient(135deg, #f4f7ff, #ffffff);
}

.ranking-list li:nth-child(3) {
  background: linear-gradient(135deg, #fff2ec, #ffffff);
}

.ranking-list .rank-medal {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 9px;
  background: #f2f6fb;
  color: #53647e;
  font-size: 11px;
  font-weight: 950;
}

.ranking-list strong {
  min-width: 0;
  overflow: hidden;
  color: #26344a;
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-list em {
  color: #5a6c89;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.empty-rank {
  grid-template-columns: 1fr !important;
}

/* Admin dashboard compact mode */
.admin-dashboard-hero {
  margin-bottom: 18px;
  padding: 22px;
  border-radius: 22px;
}

.admin-dashboard-hero h2 {
  margin: 2px 0 5px;
  font-size: 24px;
  line-height: 1.15;
}

.admin-dashboard-hero p {
  line-height: 1.35;
}

.admin-dashboard-mini {
  gap: 8px;
}

.admin-dashboard-mini span {
  padding: 8px 11px;
  border-radius: 13px;
  font-size: 12px;
}

.admin-stat-grid {
  gap: 12px;
  margin-bottom: 18px;
}

.admin-stat-grid div {
  min-height: 112px;
  padding: 17px 18px 15px;
  border-radius: 18px;
}

.admin-stat-grid span {
  padding: 5px 9px;
  font-size: 12px;
}

.admin-stat-grid strong {
  margin-top: 10px;
  font-size: clamp(25px, 2.4vw, 34px);
}

.admin-stat-grid small {
  display: block;
  margin-top: 8px;
  padding-top: 8px;
  line-height: 1.25;
}

.admin-dashboard-grid {
  gap: 14px;
  margin-bottom: 14px;
}

.admin-dashboard-grid + .admin-dashboard-grid {
  margin-top: 0;
}

.dashboard-card {
  padding: 17px;
  border-radius: 18px;
}

.dashboard-card .section-head.simple {
  margin-bottom: 11px;
  padding-bottom: 10px;
}

.dashboard-card .section-head.simple h2 {
  font-size: 19px;
  line-height: 1.18;
}

.dashboard-list {
  gap: 7px;
}

.dashboard-list > div {
  min-height: 40px;
  padding: 9px 11px;
  border-radius: 12px;
}

.dashboard-list span {
  font-size: 13px;
  line-height: 1.2;
}

.dashboard-list small {
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.25;
}

.dashboard-list b {
  font-size: 12px;
}

.rank-list > div strong {
  flex-basis: 25px;
  width: 25px;
  height: 25px;
  border-radius: 8px;
}

.point-flow-list b.plus,
.point-flow-list b.minus {
  padding: 4px 8px;
}

.admin-panel {
  margin-bottom: 18px;
  padding: 18px;
}

.admin-row {
  min-height: 44px;
  padding: 8px 10px;
}

@media (max-width: 980px) {
  .common-side-column .rich-list {
    padding-left: 8px;
  }

  .ranking-list li {
    min-height: 29px;
  }
}

/* STEP 5.3: sticky header, compact member dropdown, sidebar title + truncation fixes */
.site-header {
  position: -webkit-sticky !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 99999 !important;
  background: rgba(255, 255, 255, .96) !important;
  box-shadow: 0 8px 24px rgba(31, 41, 55, .06);
}

.side-box-title {
  display: block !important;
  text-align: left !important;
}
.side-box-title .eyebrow,
.side-box-title h2 {
  display: block !important;
  width: 100% !important;
}
.side-box-title .eyebrow {
  margin: 0 0 3px !important;
  text-transform: uppercase;
}
.side-box-title h2 {
  margin: 0 !important;
}

.common-side-column .rich-list a,
.common-side-column .rich-list small,
.ranking-list strong,
.ranking-list em {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.common-side-column .rich-list li {
  min-width: 0;
}

/* Keep the premium dropdown content, but make the whole card about 30% lighter/shorter. */
.member-dropdown {
  width: min(360px, calc(100vw - 24px)) !important;
  border-radius: 16px !important;
}
.member-status-card {
  padding: 18px 18px 16px !important;
  border-radius: 16px 16px 0 0 !important;
}
.member-profile-head {
  grid-template-columns: 58px 1fr !important;
  gap: 12px !important;
}
.member-avatar {
  width: 58px !important;
  height: 58px !important;
  border-width: 4px !important;
  font-size: 28px !important;
}
.member-profile-name strong {
  font-size: 18px !important;
}
.member-profile-name em {
  height: 22px !important;
  padding: 0 8px !important;
  border-radius: 7px !important;
  font-size: 11px !important;
}
.member-level-line {
  gap: 7px !important;
  margin-top: 7px !important;
}
.member-level-icon {
  width: 22px !important;
  height: 22px !important;
  font-size: 11px !important;
}
.member-level-line b {
  font-size: 16px !important;
}
.member-profile-text small {
  margin-top: 5px !important;
  font-size: 12px !important;
}
.member-progress-row {
  gap: 10px !important;
  margin-top: 16px !important;
}
.member-progress-row .member-exp-bar {
  height: 9px !important;
}
.member-progress-row strong {
  font-size: 16px !important;
}
.member-status-grid {
  margin: 17px -18px -16px !important;
  padding: 15px 8px !important;
}
.member-mini-stat {
  gap: 5px !important;
  padding: 0 7px !important;
}
.member-mini-stat i {
  width: 31px !important;
  height: 31px !important;
  border-width: 2px !important;
  font-size: 10px !important;
}
.member-mini-stat span {
  font-size: 12px !important;
}
.member-mini-stat strong,
.member-mini-stat.point strong {
  font-size: 13px !important;
}
.member-mini-stat small {
  font-size: 10px !important;
}
.member-menu-links {
  padding: 10px 14px 12px !important;
}
.member-dropdown .member-link {
  grid-template-columns: 32px 1fr auto !important;
  gap: 10px !important;
  min-height: 42px !important;
  padding: 4px 3px 4px 0 !important;
  border-radius: 11px !important;
  font-size: 13px !important;
}
.member-link span {
  width: 28px !important;
  height: 28px !important;
  margin-left: 4px !important;
  border-radius: 9px !important;
  font-size: 14px !important;
}
.member-link em {
  font-size: 22px !important;
}

@media (max-width: 640px) {
  .member-dropdown {
    width: min(340px, calc(100vw - 24px)) !important;
  }
}

/* STEP 6: main live chat replacement */
.live-chat-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,251,255,.96));
  box-shadow: 0 14px 34px rgba(82, 98, 124, .07);
  padding: 18px;
}

.live-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.live-chat-head.compact {
  padding-bottom: 4px;
}

.live-chat-head h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(22px, 2.7vw, 30px);
  line-height: 1.16;
  letter-spacing: -.02em;
}

.live-chat-head p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 14px;
}

.live-chat-state {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 7px;
  padding: 7px 11px;
  border-radius: 999px;
  background: #eef8f0;
  color: #168542;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .04em;
}

.live-chat-state.frozen {
  background: #fff3e4;
  color: #c76a13;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #23c55e;
  box-shadow: 0 0 0 5px rgba(35, 197, 94, .12);
}

.live-chat-state.frozen .live-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 5px rgba(245, 158, 11, .14);
}

.live-chat-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 218px;
  gap: 12px;
  align-items: stretch;
}

.live-chat-main {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.live-chat-body {
  display: block;
  min-height: 220px;
  max-height: 310px;
  overflow-y: auto;
  padding: 12px 14px;
  border: 1px solid #e4eaf4;
  border-radius: 12px;
  background: rgba(255, 255, 255, .78);
}

.live-chat-message {
  display: flex;
  align-items: baseline;
  gap: 5px;
  padding: 3px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #2a354b;
  font-size: 14px;
  line-height: 1.55;
}

.live-chat-message .chat-name {
  flex: 0 0 auto;
  max-width: 140px;
  overflow: hidden;
  color: #132038;
  font-size: 14px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-chat-message .chat-separator {
  flex: 0 0 auto;
  color: #6f7e95;
  font-weight: 900;
}

.live-chat-message p {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  color: #2a354b;
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
}

.live-chat-message time {
  flex: 0 0 auto;
  margin-left: 8px;
  color: #9aa6b8;
  font-size: 11px;
  font-weight: 800;
}

.live-chat-empty {
  display: grid;
  place-items: center;
  min-height: 170px;
  color: #7d8aa1;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.live-chat-empty.error {
  color: #d83933;
}

.live-chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
}

.live-chat-form input[type="text"] {
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid #dbe4f2;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  outline: none;
}

.live-chat-form input[type="text"]:focus {
  border-color: #b7c8e9;
  box-shadow: 0 0 0 4px rgba(92, 123, 190, .1);
}

.live-chat-form button,
.live-chat-login .btn {
  min-height: 42px;
  padding: 0 17px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #315caa, #5378c8);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

.live-chat-form button:disabled {
  cursor: not-allowed;
  opacity: .58;
}

.live-chat-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
}

.live-chat-controls small {
  color: #7c8798;
  font-size: 12px;
  font-weight: 700;
}

.chat-toggle-btn {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid #cfe8d9;
  border-radius: 999px;
  background: #f0fbf4;
  color: #168542;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.chat-toggle-btn.off {
  border-color: #ead4d4;
  background: #fff5f5;
  color: #b64a4a;
}

.live-chat-side {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 100%;
  padding: 12px;
  border: 1px solid #e4eaf4;
  border-radius: 12px;
  background: rgba(255, 255, 255, .72);
}

.live-chat-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.live-chat-side-head strong {
  color: #1d2940;
  font-size: 14px;
  font-weight: 900;
}

.live-chat-side-head span {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: #edf4ff;
  color: #3367c7;
  font-size: 12px;
  font-weight: 900;
}

.live-chat-users {
  display: grid;
  align-content: start;
  gap: 7px;
  min-height: 130px;
  max-height: 255px;
  overflow-y: auto;
  padding-right: 2px;
}

.live-chat-user {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid #edf1f8;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.live-chat-user span {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #23c55e;
  box-shadow: 0 0 0 4px rgba(35, 197, 94, .11);
}

.live-chat-user strong {
  overflow: hidden;
  color: #25324a;
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-chat-user-empty {
  display: grid;
  place-items: center;
  min-height: 100px;
  color: #8995a9;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.live-chat-admin {
  display: grid;
  gap: 7px;
  padding-top: 10px;
  border-top: 1px dashed #dfe6f1;
}

.live-chat-admin strong {
  color: #9b4d63;
  font-size: 12px;
  font-weight: 900;
}

.live-chat-admin button {
  min-height: 32px;
  border: 1px solid #ffd6df;
  border-radius: 9px;
  background: #fff5f7;
  color: #a34862;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.live-chat-admin button:hover {
  background: #ffeef3;
}

.live-chat-login {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 13px;
  border: 1px solid #e4eaf4;
  border-radius: 12px;
  background: #fbfdff;
  color: #64728b;
  font-size: 14px;
  font-weight: 800;
}

@media (max-width: 900px) {
  .live-chat-grid {
    grid-template-columns: 1fr;
  }

  .live-chat-side {
    grid-template-rows: auto auto auto;
  }

  .live-chat-users {
    max-height: 160px;
  }
}

@media (max-width: 720px) {
  .live-chat-panel {
    padding: 16px;
  }

  .live-chat-head {
    align-items: flex-start;
  }

  .live-chat-state {
    padding: 7px 10px;
  }

  .live-chat-body {
    min-height: 240px;
    max-height: 360px;
    padding: 10px;
  }

  .live-chat-form {
    grid-template-columns: 1fr;
  }

  .live-chat-controls {
    align-items: flex-start;
    flex-direction: column;
  }

  .live-chat-login {
    align-items: stretch;
    flex-direction: column;
  }
}

.common-side-column .server-box dt,
.common-side-column .server-box dd {
  color: #25324a;
  font-weight: 900;
}

@media (max-width: 720px) {
  .live-chat-panel {
    padding: 18px;
  }

  .live-chat-head {
    align-items: flex-start;
  }

  .live-chat-state {
    padding: 7px 10px;
  }

  .live-chat-body {
    min-height: 260px;
    max-height: 380px;
    padding: 10px;
  }

  .live-chat-form {
    grid-template-columns: 1fr;
  }

  .live-chat-login {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Global member level labels */
.member-name-with-level {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  vertical-align: middle;
}

.member-name-text,
.member-name.plain {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 40px;
  height: 20px;
  padding: 0 7px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: -.02em;
  box-shadow: inset 0 -1px 0 rgba(255,255,255,.45);
}

.level-badge.lv-green { background: #e6f8e9; color: #168a37; }
.level-badge.lv-mint { background: #dff8f0; color: #00886a; }
.level-badge.lv-blue { background: #e4f0ff; color: #1665c7; }
.level-badge.lv-purple { background: #f0e8ff; color: #6a35cf; }
.level-badge.lv-orange { background: #fff0df; color: #d46411; }
.level-badge.lv-rose { background: #ffe8ef; color: #c72d62; }
.level-badge.lv-red { background: #ffe3e3; color: #d32121; }

.post-row .member-name-with-level,
.rich-list .member-name-with-level,
.ranking-list .member-name-with-level,
.comment-meta .member-name-with-level,
.post-meta .member-name-with-level {
  max-width: 100%;
}

.rich-list small {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.rich-list small .meta-dot {
  color: #a3adbd;
  font-weight: 800;
}

.ranking-list strong .member-name-with-level {
  justify-content: flex-start;
}

/* Live chat refined tone + line format */
.live-chat-panel {
  border-color: #dfe7f3;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.99), rgba(250,252,255,.97));
  box-shadow: 0 18px 48px rgba(45, 69, 110, .08);
}

.live-chat-head h1 {
  font-size: clamp(20px, 2.2vw, 28px);
}

.live-chat-body {
  border-color: #dce6f5;
  border-radius: 16px;
  background: rgba(255,255,255,.86);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.88);
}

.live-chat-message {
  gap: 7px;
  padding: 6px 4px;
  color: #243249;
}

.live-chat-message time {
  order: 0;
  width: 42px;
  margin-left: 0;
  color: #56657c;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
}

.live-chat-message .level-badge {
  order: 1;
}

.live-chat-message .chat-name {
  order: 2;
  max-width: 120px;
  color: #17243c;
}

.live-chat-message .chat-separator {
  order: 3;
}

.live-chat-message p {
  order: 4;
}

.live-chat-side {
  border-color: #dce6f5;
  border-radius: 16px;
  background: rgba(255,255,255,.82);
  box-shadow: 0 10px 32px rgba(45, 69, 110, .06);
}

.live-chat-user {
  gap: 6px;
  border-color: #e6edf8;
  border-radius: 11px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.live-chat-user .online-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, .13);
}

.live-chat-user strong {
  min-width: 0;
}


/* Global level badge compact + new content badge */
.level-badge {
  min-width: 34px;
  height: 17px;
  padding: 0 5px;
  border-radius: 6px;
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: -.03em;
}

.member-name-with-level {
  gap: 4px;
}

.new-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-right: 5px;
  border-radius: 5px;
  background: linear-gradient(135deg, #ff4b58, #ff7b39);
  color: #fff;
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: -.02em;
  box-shadow: 0 3px 8px rgba(237, 70, 67, .24);
  vertical-align: middle;
}

.main-nav a {
  position: relative;
}

.main-nav .new-badge {
  width: 15px;
  height: 15px;
  margin-left: 4px;
  margin-right: 0;
  border-radius: 999px;
  font-size: 9px;
  transform: translateY(-1px);
}

.post-row {
  grid-template-columns: 110px minmax(0, 1fr) 145px 80px 105px;
}

.post-row > span:nth-child(3) {
  min-width: 0;
  overflow: hidden;
}

.post-row > span:nth-child(3) .member-name-with-level {
  max-width: 100%;
}

.post-row strong .new-badge,
.notice-list a .new-badge,
.post-view h1 .new-badge {
  transform: translateY(-1px);
}

.post-view h1 {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.comment-meta strong {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.comment-meta strong .new-badge {
  margin-right: 0;
}

@media (max-width: 760px) {
  .post-row {
    grid-template-columns: 80px minmax(0, 1fr) 70px;
  }
}

/* Admin post management + message box polish */
.level-badge {
  min-width: 34px;
  height: 17px;
  padding: 0 5px;
  border-radius: 6px;
  font-size: 9px;
  line-height: 1;
}

.live-chat-message .level-badge,
.member-menu .level-badge,
.post-row .level-badge,
.ranking-list .level-badge,
.rich-list .level-badge {
  min-width: 32px;
  height: 16px;
  font-size: 9px;
  padding: 0 5px;
}

.post-row {
  grid-template-columns: 90px minmax(0, 1fr) 185px 88px 105px;
}

.post-row > span:nth-child(3) {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.blind-badge {
  display: inline-flex;
  align-items: center;
  height: 17px;
  margin-right: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: #fff1f1;
  color: #c24141;
  font-size: 10px;
  font-weight: 900;
}

.admin-side-nav a {
  background: linear-gradient(135deg, rgba(255,255,255,.97), rgba(246,249,255,.94));
  border-color: #dfe7f5;
  box-shadow: 0 10px 24px rgba(76, 91, 120, .06);
}

.admin-side-nav a:hover,
.admin-side-nav a.active {
  background: linear-gradient(135deg, #edf6ff, #fff3f8);
  border-color: #cfdcf2;
}

.admin-side-nav a[href*="posts"] strong::before {
  content: "📝";
  margin-right: 6px;
}

.admin-posts-table .admin-row {
  grid-template-columns: 64px minmax(220px, 1.4fr) minmax(155px, .8fr) 82px 120px minmax(260px, 1.2fr);
}

.admin-posts-table .admin-row.is-blinded {
  background: rgba(255, 243, 243, .72);
}

.admin-posts-table strong a {
  color: var(--ink);
}

.admin-posts-table strong small,
.admin-posts-table span small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.post-admin-actions,
.move-post-form {
  gap: 6px;
}

.move-post-form select {
  min-width: 110px;
  height: 30px;
  border: 1px solid #dfe7f5;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.message-list {
  display: grid;
  gap: 8px;
}

.message-list-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 180px 100px;
  gap: 12px;
  align-items: center;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid #e4ebf6;
  border-radius: 12px;
  background: #fff;
  color: var(--muted);
}

.message-list-row.unread {
  background: linear-gradient(135deg, #f6fbff, #fff7fb);
  border-color: #cfdcf2;
}

.message-list-row strong {
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-view-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.message-view-content {
  margin-top: 16px;
  padding: 18px;
  border-radius: 14px;
  background: #f8fbff;
  border: 1px solid #e4ebf6;
  color: var(--ink);
  line-height: 1.75;
}

.member-link.messages span::before {
  content: "✉";
}

@media (max-width: 760px) {
  .post-row {
    grid-template-columns: 70px minmax(0, 1fr) 95px;
  }
  .message-list-row {
    grid-template-columns: 24px minmax(0, 1fr);
  }
  .message-list-row span:nth-child(3),
  .message-list-row time {
    display: none;
  }
}

/* 2026-06-09 admin compact post manager + smaller level labels */
.level-badge {
  min-width: 32px !important;
  height: 16px !important;
  padding: 0 5px !important;
  border-radius: 6px !important;
  font-size: 9px !important;
  line-height: 1 !important;
  letter-spacing: -.03em !important;
}

.member-name-with-level {
  gap: 4px;
}

.post-row {
  grid-template-columns: 82px minmax(0, 1fr) minmax(210px, 250px) 88px 105px !important;
}

.admin-nav-icon {
  display: inline-flex;
  width: 20px;
  margin-right: 7px;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  filter: saturate(1.05);
}

.admin-side-nav a[href*="posts"] strong::before,
.admin-side-nav a[href*="logs"] strong::before,
.admin-side-nav a[href*="backup"] strong::before {
  content: none !important;
}

.compact-admin-posts-panel .muted-copy {
  margin-bottom: 12px;
}

.admin-bulk-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 10px;
  padding: 10px 12px;
  border: 1px solid #dde7f5;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(248,251,255,.98), rgba(255,247,250,.92));
}

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

.admin-check-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 900;
  color: #26344d;
  cursor: pointer;
}

.bulk-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.bulk-actions select {
  min-width: 122px;
  height: 34px;
  border: 1px solid #d8e3f4;
  border-radius: 9px;
  background: #fff;
  color: #24324b;
  font-weight: 800;
}

.admin-posts-table.compact .admin-row {
  grid-template-columns: 34px 58px minmax(260px, 1.6fr) minmax(180px, .8fr) 78px 118px !important;
  min-height: 0;
  padding: 8px 10px;
  gap: 10px;
  align-items: center;
  border-radius: 12px;
}

.admin-posts-table.compact .admin-row.head {
  padding-top: 9px;
  padding-bottom: 9px;
}

.admin-posts-table.compact label.admin-row {
  cursor: pointer;
}

.admin-posts-table.compact label.admin-row:hover {
  background: rgba(241, 247, 255, .8);
}

.admin-posts-table.compact input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #2f62c7;
}

.admin-posts-table.compact strong {
  min-width: 0;
}

.admin-posts-table.compact strong a {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  line-height: 1.25;
}

.admin-posts-table.compact strong small,
.admin-posts-table.compact span small {
  margin-top: 1px;
  font-size: 10px;
  line-height: 1.2;
}

.admin-posts-table.compact .role-badge {
  height: 24px;
  padding: 0 11px;
  justify-self: start;
}

.admin-posts-table.compact time {
  font-size: 12px;
  color: #33415c;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .admin-bulk-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .admin-posts-table.compact .admin-row {
    grid-template-columns: 28px 54px minmax(180px, 1fr);
  }
  .admin-posts-table.compact .admin-row > span:nth-child(4),
  .admin-posts-table.compact .admin-row > span:nth-child(5),
  .admin-posts-table.compact .admin-row > time {
    grid-column: 3;
  }
}

/* Post view action buttons and nested comments */
.post-toolbar {
  flex-wrap: nowrap;
  gap: 8px;
}

.post-toolbar form,
.admin-inline-panel form,
.comment-actions form {
  margin: 0;
}

.btn.danger,
button.btn.danger {
  border-color: #fecaca;
  background: #fff1f2;
  color: #dc2626;
}

.blind-notice {
  margin: 10px 0 12px;
  padding: 10px 12px;
  border: 1px solid #fecaca;
  border-radius: 12px;
  background: #fff1f2;
  color: #b91c1c;
  font-weight: 800;
  font-size: 13px;
}

.admin-inline-panel {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 18px;
  padding: 10px 12px;
  border: 1px solid #dbe5f5;
  border-radius: 14px;
  background: linear-gradient(135deg, #fbfdff, #f7fbff);
}

.admin-inline-panel strong {
  margin-right: 4px;
  color: #334155;
  font-size: 13px;
}

.inline-move-form {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.inline-move-form select {
  min-height: 34px;
  border: 1px solid #d6e0f0;
  border-radius: 9px;
  padding: 0 8px;
  background: #fff;
  font-weight: 700;
}

.nested-comments .comment-item {
  padding: 13px 16px;
}

.nested-comments .comment-item.reply {
  margin-left: 28px;
  padding-left: 14px;
  border-left: 3px solid #dbeafe;
  background: #fbfdff;
}

.comment-item.is-deleted {
  background: #f8fafc;
}

.comment-item.is-deleted p,
.comment-item.is-deleted .comment-meta {
  color: #94a3b8;
}

.reply-mark {
  color: #6b8fd6;
  font-weight: 900;
}

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

.text-button {
  border: 0;
  background: transparent;
  padding: 0;
  color: #3b66b8;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.text-button:hover {
  text-decoration: underline;
}

.danger-text {
  color: #dc2626;
}

.comment-form.mini {
  margin-top: 10px;
  padding: 10px;
  box-shadow: none;
  background: #fbfdff;
}

.comment-form.mini textarea {
  min-height: 72px;
}

.comment-form.mini .btn.small,
.btn.small {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
}

.hidden {
  display: none !important;
}

@media (max-width: 760px) {
  .nested-comments .comment-item.reply {
    margin-left: 12px;
  }
  .admin-inline-panel {
    align-items: stretch;
  }
  .inline-move-form {
    width: 100%;
  }
  .inline-move-form select {
    flex: 1;
  }
}


/* Compact comments and aligned widget meta (2026-06 patch) */
.nested-comments .comment-item,
.comment-item {
  padding-top: 9px;
  padding-bottom: 9px;
}

.nested-comments .comment-item.reply {
  padding-top: 8px;
  padding-bottom: 8px;
}

.comment-meta {
  gap: 7px;
  margin-bottom: 5px;
  line-height: 1.25;
}

.comment-meta strong,
.comment-meta time,
.comment-meta span {
  display: inline-flex;
  align-items: center;
  line-height: 1.25;
}

.comment-meta time {
  font-size: 12px;
}

.comment-item p {
  line-height: 1.45;
  margin: 0 0 4px;
}

.comment-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
  line-height: 1;
}

.comment-actions form,
.comment-recommend-form {
  display: inline-flex;
  align-items: center;
  margin: 0;
}

.comment-actions .text-button,
.comment-actions button.text-button,
.comment-actions a.text-button {
  display: inline-flex;
  align-items: center;
  height: 18px;
  line-height: 18px;
  padding: 0;
  vertical-align: middle;
}

.reply-mark {
  display: inline-flex;
  align-items: center;
  height: 18px;
  line-height: 18px;
}

.rich-list small {
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.25;
  flex-wrap: nowrap;
}

.rich-list small > span,
.rich-list small .member-name-with-level,
.rich-list small .meta-sep {
  display: inline-flex;
  align-items: center;
  line-height: 1.25;
}

.rich-list small .meta-dot,
.rich-list small .meta-sep {
  color: #a3adbd;
  font-weight: 800;
}

/* Post button policy layout and reactions (2026-06 patch) */
.post-control-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  margin: 6px 0 14px;
  padding-top: 0;
}

.post-control-bar form {
  margin: 0;
}


.post-control-bar > a.btn {
  border: 1px solid #c7d7ff;
  background: linear-gradient(135deg, #f3f7ff, #e9f1ff);
  color: #2451a6;
  box-shadow: 0 4px 12px rgba(37, 81, 166, .08);
}

.post-control-bar > a.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(37, 81, 166, .12);
}

.post-control-bar .btn,
.post-control-bar button.btn {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  flex: 0 0 auto;
}

.post-control-bar .inline-move-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.post-control-bar .inline-move-form select {
  min-height: 34px;
  max-width: 150px;
  border-radius: 10px;
}

.post-reaction-center {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 18px 0 12px;
  padding-top: 14px;
  border-top: 1px solid #edf2fb;
}

.post-reaction-center form {
  margin: 0;
}

.reaction-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}

.reaction-pill.up {
  border: 1px solid #c7d7ff;
  background: #eff5ff;
  color: #2857b8;
}

.reaction-pill.down {
  border: 1px solid #ffd2d2;
  background: #fff1f2;
  color: #c43b3b;
}

.reaction-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(58, 79, 130, .10);
}

.comment-actions .text-button {
  white-space: nowrap;
}

.comment-actions .text-button[ type="submit"],
.comment-actions button.text-button {
  font-size: 12px;
}

@media (max-width: 760px) {
  .post-control-bar {
    justify-content: stretch;
    flex-wrap: wrap;
  }
  .post-control-bar .btn,
  .post-control-bar button.btn,
  .post-control-bar form,
  .post-control-bar .inline-move-form {
    width: 100%;
  }
  .post-control-bar .inline-move-form select {
    flex: 1;
    max-width: none;
  }
  .post-reaction-center {
    flex-direction: column;
    align-items: stretch;
  }
  .reaction-pill {
    width: 100%;
  }
}

/* UI polish: post management buttons + sidebar meta spacing (2026-06 patch) */
.post-control-bar .btn:not(.danger),
.post-control-bar button.btn:not(.danger),
.post-control-bar > a.btn:not(.danger),
.post-control-bar .inline-move-form button.btn:not(.danger) {
  border: 1px solid #c7d7ff;
  background: linear-gradient(135deg, #f3f7ff, #e9f1ff);
  color: #2451a6;
  box-shadow: none !important;
  transform: none !important;
  transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}

.post-control-bar .btn:not(.danger):hover,
.post-control-bar button.btn:not(.danger):hover,
.post-control-bar > a.btn:not(.danger):hover,
.post-control-bar .inline-move-form button.btn:not(.danger):hover {
  border-color: #b7caff;
  background: linear-gradient(135deg, #edf4ff, #e3edff);
  color: #1f4a9a;
  box-shadow: none !important;
  transform: none !important;
}

.post-control-bar .btn.danger,
.post-control-bar button.btn.danger {
  border-color: #fecaca;
  background: #fff1f2;
  color: #dc2626;
  box-shadow: none !important;
  transform: none !important;
}

.post-control-bar .btn.danger:hover,
.post-control-bar button.btn.danger:hover {
  border-color: #fca5a5;
  background: #ffe4e6;
  color: #b91c1c;
  box-shadow: none !important;
  transform: none !important;
}

.rich-list small {
  gap: 9px;
}

.rich-list small .meta-sep {
  margin: 0 2px;
  color: #b7c0cf;
}


/* Board permission preset admin */
.board-permission-table .admin-row {
  grid-template-columns: 1.1fr 0.8fr 1fr 2fr;
}

.board-permission-table select {
  width: 100%;
  min-height: 36px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 10px;
  padding: 6px 10px;
  background: #fff;
  color: #1f2937;
  font-weight: 700;
}

.board-permission-table small {
  display: block;
  margin-top: 2px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
}


/* member/admin compact action cleanup + header/auth modal merge - 2026-06-10 */
.main-nav a,
.account-btn {
  transform: none !important;
  transition: background-color .16s ease, color .16s ease, box-shadow .16s ease, filter .16s ease, border-color .16s ease;
}

.main-nav a:hover,
.account-btn:hover {
  box-shadow: 0 8px 18px rgba(82, 98, 124, .14);
  filter: saturate(1.12) brightness(.985);
  transform: none !important;
}

.main-nav a:nth-child(4),
.attendance-button {
  background: var(--soft-lavender) !important;
  color: #6a5aa3 !important;
  border-color: #ddd5ff !important;
}

.main-nav a:nth-child(4):hover,
.attendance-button:hover {
  box-shadow: 0 8px 18px rgba(82, 98, 124, .14) !important;
  filter: saturate(1.12) brightness(.985);
  transform: none !important;
}

.admin-title-actions .btn.ghost,
.admin-title-actions .text-link,
.admin-title-actions a[href="admin.php"] {
  border: 1px solid #bfd5f7;
  background: #eef6ff;
  color: var(--accent-strong);
}

.security-users-table .admin-row {
  min-height: 92px;
  padding: 10px 12px;
  grid-template-columns: 64px minmax(150px, 1.15fr) 150px 86px 92px minmax(260px, 1.55fr);
  align-items: center;
}

.security-users-table .admin-row.head {
  min-height: 42px;
  padding: 0 12px;
}

.compact-member-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(74px, auto));
  align-items: center;
  justify-content: start;
  gap: 7px;
}

.compact-member-actions .inline-form {
  display: inline-flex;
}

.compact-member-actions .mini-btn {
  min-width: 74px;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 9px;
  background: #fff;
  line-height: 1;
  white-space: nowrap;
}

.compact-member-actions .mini-btn:not(.danger):hover:not(:disabled) {
  border-color: #bfd5f7;
  background: #f3f8ff;
  color: var(--accent-strong);
}

.admin-mini-dialog {
  width: min(380px, calc(100vw - 36px));
  padding: 0;
  border: 1px solid #dfe6f2;
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(48, 55, 68, .22);
}

.admin-mini-dialog::backdrop {
  background: rgba(30, 40, 58, .18);
  backdrop-filter: blur(2px);
}

.admin-mini-dialog form {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 20px;
}

.admin-mini-dialog h3 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -.04em;
}

.admin-mini-dialog p {
  margin: -4px 0 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.admin-mini-dialog label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.admin-mini-dialog input,
.admin-mini-dialog textarea {
  width: 100%;
  min-height: 38px;
  padding: 9px 11px;
  border: 1px solid #d8deea;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.admin-mini-dialog textarea {
  min-height: 92px;
  resize: vertical;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

@media (max-width: 980px) {
  .compact-member-actions {
    grid-template-columns: repeat(3, minmax(74px, 1fr));
  }
}


/* auth modal - 2026-06-10 */
body.modal-open {
  overflow: hidden;
}

.auth-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(18, 26, 40, .36);
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(5px);
  transition: opacity .16s ease;
}

.auth-modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.auth-modal {
  position: relative;
  width: min(430px, 100%);
  border: 1px solid rgba(221, 228, 238, .9);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(25, 35, 52, .26);
  transform: scale(.97);
  transition: transform .16s ease;
}

.auth-modal-backdrop.is-open .auth-modal {
  transform: scale(1);
}

.auth-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border: 1px solid #dbe3f0;
  border-radius: 999px;
  background: #fff;
  color: #748196;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.auth-modal-panel {
  display: none;
  gap: 13px;
  padding: 30px;
}

.auth-modal-panel.is-active {
  display: grid;
}

.auth-modal-panel h2 {
  margin: -4px 0 4px;
  color: var(--ink);
  font-size: 30px;
  letter-spacing: -.04em;
}

.auth-modal-panel label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-weight: 850;
}

.auth-modal-panel input {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid #d8deea;
  border-radius: 10px;
  background: #fbfdff;
  color: var(--ink);
  font: inherit;
}

.auth-modal-panel input:focus {
  outline: 3px solid rgba(122, 168, 232, .22);
  border-color: var(--accent);
}

.auth-switch {
  justify-self: center;
  border: 0;
  background: transparent;
  color: #60708a;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.auth-switch:hover {
  color: #426a9f;
}

/* Post detail header actions: keep controls in the title area, content below divider only. */
.post-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-top: 6px;
}

.post-heading-row h1 {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  line-height: 1.2;
}

.post-heading-row .post-control-bar {
  flex: 0 0 auto;
  margin: 6px 0 0;
}

.post-view .post-meta {
  margin-top: 14px;
  margin-bottom: 24px;
}

.post-control-bar .btn,
.post-control-bar button.btn {
  min-height: 32px;
  padding: 0 13px;
  border-radius: 9px;
  font-size: 12px;
}

.post-control-bar .inline-move-form select {
  min-height: 32px;
  height: 32px;
  max-width: 120px;
  padding: 0 9px;
  font-size: 12px;
}

@media (max-width: 760px) {
  .post-heading-row {
    display: grid;
    gap: 12px;
  }

  .post-heading-row .post-control-bar {
    margin-top: 0;
    width: 100%;
  }
}

/* dice mini game - 2026-06-10 / casino 2.0 */
.main-nav a:nth-child(5) {
  background: var(--soft-lavender);
  color: #6a5aa3;
}

.member-link.minigame span {
  background: #f0eaff;
}

.dice-title h1 {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dice-title h1::before {
  content: "🎲";
  font-size: .92em;
}

.dice-status-card {
  margin-bottom: 18px;
}

.dice-game-card {
  display: grid;
  gap: 22px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 232, 241, .88), transparent 28%),
    radial-gradient(circle at 82% 4%, rgba(232, 244, 255, .92), transparent 30%),
    linear-gradient(135deg, #ffffff, #f8fbff);
  box-shadow: 0 18px 42px rgba(82, 98, 124, .09);
}

.dice-rule-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.dice-rule-strip span {
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid #e8eef6;
  border-radius: 14px;
  background: rgba(255, 255, 255, .84);
  color: #7b8799;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.dice-rule-strip b {
  color: #557fc7;
  font-size: 14px;
}

.dice-arena {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
}

.dice-player-card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 12px;
  min-height: 250px;
  padding: 24px 22px;
  border: 1px solid #e5ecf5;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(249,252,255,.94));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 16px 30px rgba(82, 98, 124, .07);
  overflow: hidden;
}

.dice-player-card::before {
  content: "";
  position: absolute;
  inset: 18px 28px auto;
  height: 46px;
  border-radius: 999px;
  background: radial-gradient(ellipse, rgba(85, 127, 199, .12), transparent 68%);
  filter: blur(10px);
}

.dice-player-card p {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 950;
  letter-spacing: .04em;
}

.dice-player-card strong {
  position: relative;
  z-index: 1;
  min-height: 20px;
  color: var(--ink);
  font-size: 15px;
}

.dice-cube-wrap {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 142px;
  height: 142px;
  margin-top: 8px;
  perspective: 780px;
}

.dice-cube-wrap::after {
  content: "";
  position: absolute;
  bottom: 3px;
  width: 96px;
  height: 20px;
  border-radius: 50%;
  background: rgba(72, 86, 112, .18);
  filter: blur(8px);
  transform: translateY(14px);
}

.dice-cube {
  position: relative;
  width: 94px;
  height: 94px;
  transform-style: preserve-3d;
  transition: transform .72s cubic-bezier(.18, .82, .22, 1.12);
  z-index: 2;
}

.dice-side {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 1px solid #dce7f5;
  border-radius: 22px;
  background:
    radial-gradient(circle at 28% 22%, rgba(255,255,255,.98), rgba(255,255,255,.28) 35%, transparent 36%),
    linear-gradient(145deg, #ffffff, #edf6ff 78%);
  color: #557fc7;
  font-size: 62px;
  line-height: 1;
  box-shadow: inset 0 -10px 18px rgba(85, 127, 199, .10), inset 8px 10px 16px rgba(255,255,255,.78), 0 14px 26px rgba(82, 98, 124, .14);
  backface-visibility: hidden;
}

.dice-side-1 { transform: rotateY(0deg) translateZ(47px); }
.dice-side-2 { transform: rotateY(90deg) translateZ(47px); }
.dice-side-3 { transform: rotateX(90deg) translateZ(47px); }
.dice-side-4 { transform: rotateX(-90deg) translateZ(47px); }
.dice-side-5 { transform: rotateY(-90deg) translateZ(47px); }
.dice-side-6 { transform: rotateY(180deg) translateZ(47px); }

.dice-cube.dice-face-1 { transform: rotateX(-14deg) rotateY(-18deg); }
.dice-cube.dice-face-2 { transform: rotateX(-12deg) rotateY(-108deg); }
.dice-cube.dice-face-3 { transform: rotateX(-102deg) rotateY(-16deg); }
.dice-cube.dice-face-4 { transform: rotateX(78deg) rotateY(18deg); }
.dice-cube.dice-face-5 { transform: rotateX(-12deg) rotateY(72deg); }
.dice-cube.dice-face-6 { transform: rotateX(-10deg) rotateY(-198deg); }

.dice-cube.is-rolling {
  animation: diceRoll3d .68s cubic-bezier(.42, 0, .2, 1) infinite;
}

.dice-cube.is-landed {
  animation: diceLand .48s ease-out;
}

.dice-versus {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffe7ee, #ebe6ff);
  color: #a35b72;
  font-weight: 950;
  box-shadow: 0 14px 28px rgba(82, 98, 124, .12);
}

.dice-versus span {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .72);
}

.dice-bet-form {
  display: grid;
  grid-template-columns: minmax(150px, .8fr) minmax(240px, 1.3fr) auto;
  gap: 12px;
  align-items: end;
  padding: 18px;
  border: 1px solid #e8eef6;
  border-radius: 16px;
  background: rgba(255,255,255,.92);
}

.dice-bet-form label,
.dice-predict-field legend {
  color: var(--muted);
  font-size: 13px;
  font-weight: 950;
}

.dice-bet-field {
  display: grid;
  gap: 7px;
}

.dice-bet-form input[type="number"] {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #d8e2ef;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 850;
}

.dice-predict-field {
  display: grid;
  gap: 7px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.dice-predict-buttons {
  display: grid;
  grid-template-columns: repeat(6, minmax(32px, 1fr));
  gap: 7px;
}

.dice-predict-buttons label {
  cursor: pointer;
}

.dice-predict-buttons input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.dice-predict-buttons span {
  display: grid;
  place-items: center;
  min-height: 42px;
  border: 1px solid #d8e2ef;
  border-radius: 12px;
  background: #fff;
  color: #6b7890;
  font-weight: 950;
  transition: background .16s ease, color .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.dice-predict-buttons input:checked + span,
.dice-predict-buttons label.is-selected span {
  border-color: #acc7ef;
  background: #eef6ff;
  color: #557fc7;
  box-shadow: inset 0 0 0 1px rgba(85,127,199,.12), 0 8px 18px rgba(85,127,199,.12);
}

.dice-predict-buttons span:hover {
  border-color: #b9ccec;
  background: #f6faff;
}

.dice-roll-button {
  min-height: 42px;
  white-space: nowrap;
}

.dice-result-panel {
  display: grid;
  gap: 8px;
  padding: 20px;
  border: 1px solid #e8eef6;
  border-radius: 18px;
  background: rgba(248, 251, 255, .92);
  text-align: center;
}

.dice-result-panel h2 {
  margin: 0;
  color: #557fc7;
  font-size: 26px;
}

.dice-result-panel p {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}

.dice-reward-line {
  color: #5f6f85;
  font-size: 14px;
  font-weight: 900;
}

.dice-net-change {
  justify-self: center;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 950;
}

.dice-net-change.plus {
  background: #e7f8ef;
  color: #328565;
}

.dice-net-change.minus {
  background: #fff0f3;
  color: #b05469;
}

.dice-result-panel.result-win {
  border-color: #cfeedd;
  background: linear-gradient(135deg, #f3fff8, #fbfffd);
}

.dice-result-panel.result-win h2::before {
  content: "🎉 ";
}

.dice-result-panel.result-lose {
  border-color: #ffd5dc;
  background: linear-gradient(135deg, #fff8fa, #fffdfd);
}

.dice-result-panel.result-draw {
  border-color: #dfe8f5;
  background: #fbfdff;
}

.dice-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 18px;
}

.dice-info-grid article {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(82, 98, 124, .06);
}

.dice-info-grid h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.dice-info-grid ul {
  margin: 0;
  padding-left: 18px;
  color: #5f6f85;
  line-height: 1.8;
  font-size: 14px;
  font-weight: 700;
}

.muted-text {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.dice-rank-row {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid #f0f3f8;
}

.dice-rank-row:last-child {
  border-bottom: 0;
}

.dice-rank-row > strong {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #eef6ff;
  color: #557fc7;
  font-size: 12px;
}

.dice-rank-row em {
  color: #328565;
  font-style: normal;
  font-weight: 950;
}

.dice-history-panel {
  margin-top: 18px;
}

.dice-history-table .admin-row {
  grid-template-columns: .8fr .8fr .7fr 1fr .9fr 1.4fr;
}

@keyframes diceRoll3d {
  0% { transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg) translateY(0); }
  20% { transform: rotateX(160deg) rotateY(90deg) rotateZ(20deg) translateY(-8px); }
  45% { transform: rotateX(330deg) rotateY(260deg) rotateZ(-28deg) translateY(2px); }
  70% { transform: rotateX(520deg) rotateY(440deg) rotateZ(34deg) translateY(-6px); }
  100% { transform: rotateX(720deg) rotateY(720deg) rotateZ(0deg) translateY(0); }
}

@keyframes diceLand {
  0% { filter: brightness(1.08); }
  45% { transform: translateY(-5px) scale(1.04); filter: brightness(1.1); }
  100% { filter: brightness(1); }
}

@media (max-width: 820px) {
  .dice-rule-strip,
  .dice-arena,
  .dice-bet-form,
  .dice-info-grid {
    grid-template-columns: 1fr;
  }

  .dice-player-card {
    min-height: 230px;
  }

  .dice-versus {
    justify-self: center;
  }

  .dice-predict-buttons {
    grid-template-columns: repeat(3, 1fr);
  }

  .dice-history-table .admin-row {
    grid-template-columns: 1fr;
    gap: 5px;
  }
}

/* dice casino v3 - image style layout / daily limit / final flat dice */
.dice-casino-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  align-items: start;
}

.dice-casino-main,
.dice-casino-side {
  min-width: 0;
}

.dice-game-card {
  overflow: hidden;
  padding: 0 !important;
  gap: 0 !important;
  border-radius: 18px !important;
  background: #fff !important;
  box-shadow: 0 16px 34px rgba(21, 34, 64, .08) !important;
}

.dice-result-hero {
  padding: 22px 22px 20px;
  text-align: center;
  background: linear-gradient(135deg, #f2fff7, #fbfffd);
  border-bottom: 1px solid #d9f0e4;
}

.dice-result-hero.result-lose {
  background: linear-gradient(135deg, #fff7f8, #fffdfd);
  border-bottom-color: #ffdbe2;
}

.dice-result-hero.result-draw {
  background: linear-gradient(135deg, #f8fbff, #ffffff);
  border-bottom-color: #e4ebf5;
}

.dice-result-hero h2 {
  margin: 0 0 8px;
  color: #159b58;
  font-size: 30px;
  font-weight: 950;
}

.dice-result-hero.result-lose h2 { color: #d3475d; }
.dice-result-hero.result-draw h2 { color: #526d95; }

.dice-result-hero p {
  margin: 0 0 14px;
  color: #33425b;
  font-size: 17px;
  font-weight: 850;
}

.dice-formula-line {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 100%;
  padding: 12px 18px;
  border: 1px solid #e2e8f2;
  border-radius: 14px;
  background: rgba(255,255,255,.86);
  color: #142033;
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(21,34,64,.05);
}

.dice-formula-line span {
  color: #8a95a8;
}

.dice-formula-line b {
  color: #0f9a55;
  font-size: 17px;
}

.dice-result-hero.result-lose .dice-formula-line b { color: #d3475d; }

.dice-rule-strip {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 0 !important;
  padding: 16px 18px;
  border-bottom: 1px solid #e2e8f2;
  background: linear-gradient(180deg, #fff, #f8fbff);
}

.dice-rule-strip span {
  display: grid !important;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 4px 8px !important;
  padding: 8px 10px !important;
  border: 0 !important;
  border-right: 1px solid #edf1f7 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #142033 !important;
  text-align: left !important;
  font-size: 13px !important;
}

.dice-rule-strip span:last-child { border-right: 0 !important; }

.dice-rule-strip b {
  color: #142033 !important;
  font-size: 13px !important;
}

.dice-rule-strip em {
  grid-column: 2;
  color: #6c7890;
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
}

.dice-arena {
  position: relative;
  grid-template-columns: 1fr 120px 1fr !important;
  gap: 20px !important;
  padding: 36px 28px 28px;
  background:
    radial-gradient(circle at 22% 46%, rgba(19, 113, 255, .34), transparent 30%),
    radial-gradient(circle at 78% 44%, rgba(239, 37, 67, .30), transparent 30%),
    linear-gradient(135deg, #07162f 0%, #111747 45%, #1a0622 100%);
  overflow: hidden;
}

.dice-arena::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, transparent 0 48%, rgba(255,255,255,.18) 49%, transparent 51% 100%),
    radial-gradient(circle at 50% 52%, rgba(119, 100, 255, .28), transparent 18%);
  pointer-events: none;
}

.dice-player-card {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  min-height: 280px !important;
  padding: 0 !important;
  overflow: visible !important;
}

.dice-player-card::before { display: none !important; }

.dice-player-card p {
  color: #67d7ff !important;
  font-size: 20px !important;
  letter-spacing: -.03em !important;
  text-shadow: 0 2px 12px rgba(103,215,255,.35);
}

.dice-player-card.computer p {
  color: #ff6b78 !important;
  text-shadow: 0 2px 12px rgba(255,107,120,.35);
}

.dice-player-card strong {
  color: rgba(255,255,255,.9) !important;
  font-size: 14px !important;
}

.dice-cube-wrap {
  width: 190px !important;
  height: 190px !important;
  margin: 4px auto 0 !important;
  perspective: 900px !important;
}

.dice-cube-wrap::after {
  bottom: 6px !important;
  width: 128px !important;
  height: 24px !important;
  background: rgba(0,0,0,.42) !important;
  filter: blur(10px) !important;
}

.dice-cube {
  width: 104px !important;
  height: 104px !important;
}

.dice-side {
  border: 1px solid rgba(255,255,255,.72) !important;
  border-radius: 24px !important;
  background:
    radial-gradient(circle at 30% 22%, rgba(255,255,255,1), rgba(255,255,255,.62) 34%, transparent 35%),
    linear-gradient(145deg, #ffffff, #eaf2ff 78%) !important;
  color: #111 !important;
  font-size: 72px !important;
  text-shadow: 0 1px 0 rgba(255,255,255,.45);
  box-shadow: inset 0 -12px 18px rgba(20,40,78,.12), inset 8px 10px 18px rgba(255,255,255,.75), 0 16px 28px rgba(0,0,0,.22) !important;
}

.dice-side-1 { transform: rotateY(0deg) translateZ(52px) !important; }
.dice-side-2 { transform: rotateY(90deg) translateZ(52px) !important; }
.dice-side-3 { transform: rotateX(90deg) translateZ(52px) !important; }
.dice-side-4 { transform: rotateX(-90deg) translateZ(52px) !important; }
.dice-side-5 { transform: rotateY(-90deg) translateZ(52px) !important; }
.dice-side-6 { transform: rotateY(180deg) translateZ(52px) !important; }

.dice-cube.is-landed {
  width: 172px !important;
  height: 172px !important;
  transform: none !important;
  animation: diceLandFlat .42s ease-out !important;
  transform-style: flat !important;
}

.dice-cube.is-landed .dice-side {
  display: none !important;
  position: static !important;
  inset: auto !important;
  transform: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #fff !important;
  font-size: 150px !important;
  line-height: 1 !important;
  text-shadow: 0 4px 0 rgba(0,0,0,.18), 0 0 24px rgba(255,255,255,.38) !important;
}

.dice-player-card.mine .dice-cube.is-landed .dice-side {
  filter: drop-shadow(0 0 12px rgba(82,177,255,.65));
}

.dice-player-card.computer .dice-cube.is-landed .dice-side {
  filter: drop-shadow(0 0 12px rgba(255,83,104,.60));
}

.dice-cube.is-landed.dice-face-1 .dice-side-1,
.dice-cube.is-landed.dice-face-2 .dice-side-2,
.dice-cube.is-landed.dice-face-3 .dice-side-3,
.dice-cube.is-landed.dice-face-4 .dice-side-4,
.dice-cube.is-landed.dice-face-5 .dice-side-5,
.dice-cube.is-landed.dice-face-6 .dice-side-6 {
  display: grid !important;
  place-items: center;
}

.dice-versus {
  position: relative;
  z-index: 2;
  width: 102px !important;
  height: 102px !important;
  background: transparent !important;
  box-shadow: none !important;
}

.dice-versus span {
  width: auto !important;
  height: auto !important;
  background: transparent !important;
  color: #fff !important;
  font-size: 52px;
  font-weight: 1000;
  font-style: italic;
  text-shadow: 0 0 18px rgba(89,150,255,.95), 0 0 34px rgba(255,71,93,.55);
}

.dice-bet-form {
  grid-template-columns: minmax(210px, .8fr) minmax(280px, 1.2fr) !important;
  gap: 16px !important;
  align-items: stretch !important;
  margin: 0;
  padding: 22px !important;
  border: 0 !important;
  border-top: 1px solid rgba(255,255,255,.14) !important;
  border-radius: 0 !important;
  background:
    linear-gradient(135deg, rgba(9,20,44,.98), rgba(18,27,66,.98)) !important;
}

.dice-bet-field,
.dice-predict-field {
  padding: 18px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 14px;
  background: rgba(255,255,255,.045);
}

.dice-bet-form label,
.dice-predict-field legend {
  color: #fff !important;
  font-size: 16px !important;
}

.dice-bet-form input[type="number"] {
  min-height: 46px !important;
  border-color: rgba(255,255,255,.18) !important;
  background: rgba(0,0,0,.35) !important;
  color: #fff !important;
  text-align: center;
  font-size: 20px;
}

.dice-predict-buttons span {
  min-height: 46px !important;
  border-color: rgba(255,255,255,.20) !important;
  background: rgba(255,255,255,.08) !important;
  color: #fff !important;
  font-size: 18px;
}

.dice-predict-buttons input:checked + span,
.dice-predict-buttons label.is-selected span {
  border-color: #6ea1ff !important;
  background: linear-gradient(135deg, #4b8dff, #245cea) !important;
  box-shadow: 0 10px 22px rgba(55,112,255,.34) !important;
}

.dice-roll-button {
  grid-column: 2;
  min-height: 56px !important;
  border: 0 !important;
  border-radius: 12px !important;
  background: linear-gradient(135deg, #4b8dff, #245cea) !important;
  color: #fff !important;
  font-size: 18px !important;
  box-shadow: 0 14px 26px rgba(55,112,255,.30) !important;
}

.dice-roll-button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.dice-info-grid {
  grid-template-columns: 1fr !important;
  gap: 14px !important;
}

.dice-daily-card,
.dice-side-history {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 14px 30px rgba(21,34,64,.07);
}

.dice-daily-card h2,
.dice-side-head h2 {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 19px;
}

.dice-daily-count {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 16px;
}

.dice-daily-count strong {
  color: #16a361;
  font-size: 38px;
  font-weight: 1000;
}

.dice-daily-count span {
  color: #0f172a;
  font-size: 26px;
  font-weight: 900;
}

.dice-daily-dots {
  display: flex;
  gap: 12px;
  margin: 8px 0 18px;
}

.dice-daily-dots span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e5e7eb;
  box-shadow: inset 0 -2px 5px rgba(0,0,0,.07);
}

.dice-daily-dots span.is-left {
  background: linear-gradient(135deg, #2ed07c, #159b58);
  box-shadow: 0 8px 16px rgba(22,163,97,.25);
}

.dice-daily-card p {
  margin: 0;
  color: #5f6f85;
  line-height: 1.75;
  font-weight: 750;
}

.dice-side-history {
  margin-top: 16px;
}

.dice-history-card {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding: 14px 16px;
  border: 1px solid #e5eaf2;
  border-left: 5px solid #cfd8e6;
  border-radius: 10px;
  background: #fff;
}

.dice-history-card.win {
  border-left-color: #16a361;
  background: linear-gradient(135deg, #f4fff8, #ffffff);
}

.dice-history-card.lose {
  border-left-color: #e74a62;
  background: linear-gradient(135deg, #fff8fa, #ffffff);
}

.dice-history-card.draw {
  border-left-color: #b9c2d0;
}

.dice-history-card div,
.dice-history-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dice-history-card strong {
  color: #142033;
  font-size: 15px;
}

.dice-history-card em {
  color: #159b58;
  font-style: normal;
  font-size: 18px;
  font-weight: 1000;
}

.dice-history-card.lose em { color: #d3475d; }
.dice-history-card.draw em { color: #5f6f85; }

.dice-history-card p {
  margin: 0;
  color: #5f6f85;
  font-size: 13px;
  font-weight: 750;
}

.dice-history-card footer b {
  color: #142033;
  font-size: 18px;
}

.dice-history-card footer span {
  color: #7b8799;
  font-size: 13px;
}

@keyframes diceLandFlat {
  0% { transform: translateY(-8px) scale(.92); opacity: .35; }
  55% { transform: translateY(3px) scale(1.08); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

@media (max-width: 1180px) {
  .dice-casino-layout { grid-template-columns: 1fr; }
  .dice-casino-side { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .dice-side-history { margin-top: 0; }
}

@media (max-width: 820px) {
  .dice-rule-strip { grid-template-columns: 1fr 1fr !important; }
  .dice-arena { grid-template-columns: 1fr !important; }
  .dice-bet-form { grid-template-columns: 1fr !important; }
  .dice-roll-button { grid-column: auto; }
  .dice-casino-side { grid-template-columns: 1fr; }
}

/* dice casino v4 - compact rules / neon 3D dice / reliable daily state */
.dice-rule-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  padding: 14px 12px !important;
}

.dice-rule-strip span {
  display: block !important;
  padding: 8px 8px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  font-size: 13px !important;
  letter-spacing: -.04em !important;
}

.dice-rule-strip b {
  display: inline !important;
  margin-left: 3px !important;
  white-space: nowrap !important;
  font-size: 12px !important;
  letter-spacing: -.05em !important;
}

.dice-rule-strip em {
  display: none !important;
}

.dice-cube {
  filter: drop-shadow(0 0 12px rgba(84, 194, 255, .35));
}

.dice-player-card.computer .dice-cube {
  filter: drop-shadow(0 0 12px rgba(255, 75, 125, .34));
}

.dice-side {
  border: 1px solid rgba(112, 219, 255, .72) !important;
  border-radius: 24px !important;
  background:
    radial-gradient(circle at 30% 18%, rgba(255,255,255,.28), transparent 34%),
    linear-gradient(145deg, rgba(12, 29, 67, .98), rgba(7, 10, 34, .98) 72%) !important;
  color: #bff4ff !important;
  font-size: 72px !important;
  text-shadow:
    0 0 6px rgba(126, 227, 255, .95),
    0 0 16px rgba(49, 178, 255, .72),
    0 0 30px rgba(37, 124, 255, .52) !important;
  box-shadow:
    inset 0 0 18px rgba(102, 224, 255, .20),
    inset 10px 12px 24px rgba(255,255,255,.06),
    0 0 18px rgba(76, 194, 255, .36),
    0 18px 28px rgba(0,0,0,.28) !important;
}

.dice-player-card.computer .dice-side {
  border-color: rgba(255, 112, 154, .72) !important;
  color: #ffd0dc !important;
  text-shadow:
    0 0 6px rgba(255, 172, 194, .95),
    0 0 16px rgba(255, 80, 128, .72),
    0 0 30px rgba(255, 40, 92, .52) !important;
  box-shadow:
    inset 0 0 18px rgba(255, 112, 154, .20),
    inset 10px 12px 24px rgba(255,255,255,.06),
    0 0 18px rgba(255, 80, 128, .34),
    0 18px 28px rgba(0,0,0,.28) !important;
}

.dice-cube.is-landed {
  width: 128px !important;
  height: 128px !important;
  transform-style: preserve-3d !important;
  animation: diceLand .42s ease-out !important;
}

.dice-cube.is-landed .dice-side {
  display: block !important;
  position: absolute !important;
  inset: 0 !important;
  transform-style: preserve-3d !important;
  border-radius: 26px !important;
  background:
    radial-gradient(circle at 30% 18%, rgba(255,255,255,.28), transparent 34%),
    linear-gradient(145deg, rgba(12, 29, 67, .98), rgba(7, 10, 34, .98) 72%) !important;
  font-size: 86px !important;
  line-height: 128px !important;
  text-align: center !important;
}

.dice-player-card.computer .dice-cube.is-landed .dice-side {
  background:
    radial-gradient(circle at 30% 18%, rgba(255,255,255,.25), transparent 34%),
    linear-gradient(145deg, rgba(64, 11, 41, .98), rgba(18, 6, 34, .98) 72%) !important;
}

.dice-cube.is-landed .dice-side-1 { transform: rotateY(0deg) translateZ(64px) !important; }
.dice-cube.is-landed .dice-side-2 { transform: rotateY(90deg) translateZ(64px) !important; }
.dice-cube.is-landed .dice-side-3 { transform: rotateX(90deg) translateZ(64px) !important; }
.dice-cube.is-landed .dice-side-4 { transform: rotateX(-90deg) translateZ(64px) !important; }
.dice-cube.is-landed .dice-side-5 { transform: rotateY(-90deg) translateZ(64px) !important; }
.dice-cube.is-landed .dice-side-6 { transform: rotateY(180deg) translateZ(64px) !important; }

@media (max-width: 980px) {
  .dice-rule-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
