.points-idle-actions {
  position: absolute;
  right: 74px;
  bottom: 22px;
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 16px;
  border: 1px solid rgba(199, 154, 74, .24);
  border-radius: 999px;
  background: rgba(23, 17, 9, .78);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .3);
  backdrop-filter: blur(16px);
}

.points-idle-actions[hidden] { display: none !important; }
.points-idle-actions span { color: rgba(248, 240, 226, .4); font-size: 13px; letter-spacing: .5px; }
.points-idle-actions button {
  min-width: 78px;
  padding: 8px 14px;
  border: 1px solid rgba(199, 154, 74, .3);
  border-radius: 999px;
  background: rgba(248, 240, 226, .06);
  color: rgba(248, 240, 226, .78);
  font: 600 14px/1.2 inherit;
  cursor: pointer;
}
.points-idle-actions button:first-of-type {
  background: linear-gradient(180deg, #b8893f, #8a6228);
  color: #fff8e9;
}
.points-idle-actions button:hover { border-color: rgba(199, 154, 74, .68); filter: brightness(1.08); }

.points-mode {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  padding: 76px 28px 24px;
  color: #3a3026;
  background:
    radial-gradient(900px 480px at 88% -10%, rgba(199,154,74,.12), transparent 62%),
    linear-gradient(140deg, #171109 0%, #241a0e 52%, #150f08 100%);
}
.points-mode[hidden] { display: none !important; }
.points-mode-shell {
  width: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(199, 154, 74, .28);
  border-radius: 22px;
  background: linear-gradient(165deg, #fbf6ec 0%, #f4ecdd 100%);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .45);
}
.points-mode-header {
  flex: 0 0 auto;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 22px;
  border-bottom: 1px solid #dfd2ba;
  background: rgba(255, 253, 247, .78);
}
.points-mode-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.points-mode-title h2 { margin: 0; color: #33291f; font-size: 27px; letter-spacing: 2px; }
.points-mode-title p { margin: 4px 0 0; color: #94836c; font-size: 13px; }
.points-back-button,
.points-toolbar button,
.points-scope-tabs button {
  border: 1px solid #dbcdb3;
  border-radius: 11px;
  background: #fffdf7;
  color: #725124;
  font: 600 14px/1 inherit;
  cursor: pointer;
}
.points-back-button { padding: 11px 15px; }
.points-toolbar { display: flex; align-items: center; gap: 10px; }
.points-toolbar button { padding: 11px 16px; }
.points-toolbar button.active { border-color: #9b6b28; background: #9b6b28; color: #fff8e9; }
.points-sync-status {
  min-width: 70px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #edf3e9;
  color: #57734e;
  text-align: center;
  font: 600 12px/1 inherit;
}
.points-sync-status.pending { background: #fff0cd; color: #8e651f; }
.points-sync-status.failed { background: #f9dfd7; color: #9a4637; }

.points-score-layout {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 25vw);
}
.points-seat-area { min-height: 0; padding: 18px; overflow: auto; }
.points-seat-grid {
  min-height: 100%;
  display: grid;
  grid-template-columns: repeat(7, minmax(88px, 1fr));
  grid-auto-rows: minmax(72px, 1fr);
  gap: 10px;
  align-content: stretch;
}
.points-student-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  border: 1px solid #d8c8ab;
  border-radius: 13px;
  background: rgba(255, 253, 247, .88);
  box-shadow: 0 5px 16px rgba(58, 48, 38, .06);
  color: #3a3026;
  font-family: inherit;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.points-student-card:hover { transform: translateY(-2px); border-color: #b18445; }
.points-student-card.selected { border-color: #9c6c28; background: #f4dfb5; box-shadow: 0 0 0 3px rgba(156, 108, 40, .13); }
.points-student-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: clamp(15px, 1.45vw, 21px); font-weight: 700; }
.points-student-score { color: #9a6f2e; font: 700 14px/1 Georgia, serif; }

.points-score-side {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(210px, 1.2fr) minmax(150px, .8fr);
  border-left: 1px solid #dfd2ba;
  background: rgba(255, 253, 247, .46);
}
.points-rule-panel { min-height: 0; padding: 18px; overflow: auto; }
.points-rule-placeholder { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; border: 1px dashed #d0bd9c; border-radius: 15px; color: #8d7c65; text-align: center; }
.points-rule-placeholder strong { color: #61451f; font-size: 20px; }
.points-rule-placeholder span { font-size: 13px; }
.points-selected-summary { display: flex; align-items: baseline; gap: 9px; margin-bottom: 12px; color: #9a8a72; font-size: 13px; }
.points-selected-summary strong { color: #3a3026; font-size: 17px; }
.points-rule-list { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.points-rule-button { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border: 1px solid #ddcfb7; border-radius: 12px; background: #fffdf7; color: #41372c; font-family: inherit; cursor: pointer; }
.points-rule-button span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.points-rule-button b { font: 700 18px/1 Georgia, serif; }
.points-rule-button.positive b { color: #47734a; }
.points-rule-button.negative b { color: #a94f42; }
.points-rule-button:hover { border-color: #a87b3d; background: #fff8e8; }

.points-recent-panel { min-height: 0; display: flex; flex-direction: column; padding: 14px 18px 18px; border-top: 1px solid #e3d7c0; }
.points-section-label { flex: 0 0 auto; margin-bottom: 10px; color: #8f6b39; font-size: 13px; font-weight: 700; letter-spacing: 1px; }
.points-recent-list { min-height: 0; overflow: auto; }
.points-recent-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; gap: 3px 10px; padding: 8px 0; border-bottom: 1px dashed #e1d5c0; }
.points-recent-item > div { min-width: 0; display: flex; gap: 7px; overflow: hidden; }
.points-recent-item strong,.points-recent-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.points-recent-item strong { flex: 0 0 auto; font-size: 14px; }
.points-recent-item span { color: #8b7a64; font-size: 13px; }
.points-recent-item b { grid-row: 1 / span 2; grid-column: 2; align-self: center; font: 700 18px/1 Georgia, serif; }
.points-recent-item small { color: #a69681; font-size: 11px; }
.points-recent-item.failed small { color: #a94f42; }
.positive { color: #47734a !important; }
.negative { color: #a94f42 !important; }

.points-list-content { min-height: 0; flex: 1; padding: 22px; overflow: auto; }
.points-scope-tabs { display: flex; gap: 8px; }
.points-scope-tabs button { min-width: 66px; padding: 10px 13px; }
.points-scope-tabs button.active { background: #946527; border-color: #946527; color: #fff8e9; }
.points-ranking-list { max-width: 980px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.points-ranking-item { min-height: 66px; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 10px 20px; border: 1px solid #dfd2ba; border-radius: 14px; background: rgba(255,253,247,.85); }
.points-rank-number { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: #eee3ce; color: #8d6733; font: 700 16px/1 Georgia, serif; }
.points-ranking-item:nth-child(1) .points-rank-number { background: #b4863f; color: #fff; }
.points-ranking-item:nth-child(2) .points-rank-number { background: #b7aa95; color: #fff; }
.points-ranking-item:nth-child(3) .points-rank-number { background: #b77c53; color: #fff; }
.points-ranking-item strong { font-size: 20px; }
.points-ranking-item b { color: #8d6429; font: 700 21px/1 Georgia, serif; }

.points-ledger-list { max-width: 1120px; margin: 0 auto; border: 1px solid #dfd2ba; border-radius: 15px; background: rgba(255,253,247,.82); overflow: hidden; }
.points-ledger-item { display: grid; grid-template-columns: 90px minmax(110px, .8fr) minmax(160px, 1.6fr) 70px 100px; align-items: center; gap: 14px; min-height: 58px; padding: 9px 18px; border-bottom: 1px solid #e5dac6; }
.points-ledger-item:last-child { border-bottom: 0; }
.points-ledger-item time,.points-ledger-item small { color: #988872; font-size: 12px; }
.points-ledger-item strong { font-size: 17px; }
.points-ledger-item b { text-align: right; font: 700 18px/1 Georgia, serif; }
.points-ledger-filters select { min-width: 126px; height: 39px; padding: 0 34px 0 12px; border: 1px solid #d8c9ae; border-radius: 10px; background: #fffdf8; color: #5f513f; font: inherit; }
.points-empty { grid-column: 1 / -1; min-height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #9d8d77; text-align: center; font-size: 18px; }
.points-empty small { margin-top: 8px; color: #b5a894; font-size: 13px; }
.points-empty.compact { min-height: 90px; font-size: 14px; }

@media (max-height: 800px) {
  .points-mode { padding: 66px 18px 16px; }
  .points-mode-header { min-height: 58px; padding: 10px 16px; }
  .points-mode-title h2 { font-size: 23px; }
  .points-seat-area { padding: 12px; }
  .points-seat-grid { grid-auto-rows: minmax(60px, 1fr); gap: 8px; }
  .points-score-side { grid-template-rows: minmax(180px, 1.15fr) minmax(130px, .85fr); }
  .points-rule-panel { padding: 12px; }
  .points-rule-button { min-height: 46px; padding: 8px 10px; }
  .points-recent-panel { padding: 10px 12px 12px; }
  .points-ranking-item { min-height: 54px; }
  .points-ledger-item { min-height: 49px; }
}

@media (max-width: 1050px) {
  .points-score-layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .points-seat-grid { grid-template-columns: repeat(6, minmax(78px, 1fr)); }
  .points-rule-list { grid-template-columns: 1fr; }
  .points-idle-actions { right: 18px; bottom: 16px; }
  .points-idle-actions span { display: none; }
}

@media (max-width: 760px) {
  .points-mode { padding: 62px 10px 10px; }
  .points-mode-header { align-items: flex-start; }
  .points-mode-title p { display: none; }
  .points-score-layout { grid-template-columns: 1fr; grid-template-rows: minmax(240px, 1fr) minmax(190px, .75fr); }
  .points-score-side { grid-template-columns: 1.15fr .85fr; grid-template-rows: 1fr; border-left: 0; border-top: 1px solid #dfd2ba; }
  .points-recent-panel { border-top: 0; border-left: 1px solid #e3d7c0; }
  .points-seat-grid { grid-template-columns: repeat(5, minmax(68px, 1fr)); }
  .points-ranking-list { grid-template-columns: 1fr; }
  .points-idle-actions { left: 50%; right: auto; transform: translateX(-50%); }
}
