.pg-app {
  max-width: 980px;
  margin: 0 auto;
  padding: 18px 14px 48px;
  color: #243044;
}
.pg-hero,
.pg-panel {
  background: #fff;
  border: 1px solid #dce4ee;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(31, 51, 73, 0.07);
}
.pg-hero {
  padding: 28px 24px;
  text-align: center;
  background: linear-gradient(135deg, #eef7ff, #fff8e8);
}
.pg-hero h1 {
  margin: 0.2em 0;
  font-size: clamp(1.8rem, 5vw, 2.7rem);
}
.pg-hero a {
  color: #1769aa;
  font-weight: 700;
}
.pg-kicker,
.pg-subject {
  margin: 0;
  color: #1769aa;
  font-weight: 800;
}
.pg-version {
  display: block;
  margin-top: 8px;
  color: #7b8795;
  font-size: 0.75rem;
}
.pg-panel {
  margin-top: 18px;
  padding: 24px;
}
.pg-panel > h2 {
  margin-top: 0;
}
.pg-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.pg-card {
  display: flex;
  flex-direction: column;
  padding: 18px;
  border: 1px solid #dce4ee;
  border-radius: 14px;
}
.pg-card h3 {
  margin: 0.3em 0;
}
.pg-card p:not(.pg-subject) {
  flex: 1;
}
.pg-card.is-locked {
  background: #f5f6f8;
  color: #6d7682;
}
.pg-card button:disabled {
  background: #aeb6bf;
  cursor: default;
}
.pg-card button,
.pg-actions button {
  border: 0;
  border-radius: 11px;
  padding: 12px 15px;
  background: #1769aa;
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.pg-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 4px;
  padding-bottom: 12px;
  border-bottom: 1px solid #dce4ee;
}
.pg-tabs button {
  border: 1px solid #b9c8d6;
  border-radius: 999px;
  padding: 9px 16px;
  background: #fff;
  color: #40536a;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.pg-tabs button.is-active {
  border-color: #1769aa;
  background: #1769aa;
  color: #fff;
}
.pg-lock-label {
  margin: 0;
  color: #1769aa;
  font-weight: 800;
}
.pg-member-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-top: 34px;
  padding-top: 24px;
  border-top: 2px solid #e4eaf0;
}
.pg-member-head h2 {
  margin: 0.25em 0 0;
}
.pg-member-head button,
.pg-login button {
  border: 0;
  border-radius: 11px;
  padding: 12px 15px;
  background: #1769aa;
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.pg-login {
  display: flex;
  gap: 10px;
  max-width: 440px;
}
.pg-login input {
  min-width: 0;
  flex: 1;
  padding: 12px;
  border: 2px solid #bdcad7;
  border-radius: 10px;
  font-size: 1.1rem;
}
.pg-message {
  min-height: 1.5em;
  color: #b22;
  font-weight: 700;
}
.pg-link {
  border: 0;
  background: transparent;
  color: #1769aa;
  text-decoration: underline;
}
.pg-primary {
  background: #df6b23 !important;
}
.pg-secondary {
  background: #fff !important;
  color: #1769aa !important;
  border: 1px solid #1769aa !important;
}
.pg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}
.pg-instruction {
  padding: 12px 15px;
  border-left: 5px solid #df6b23;
  background: #fff7ef;
  font-weight: 800;
}
.pg-table-settings {
  display: grid;
  gap: 14px;
  margin: 18px 0;
}
.pg-setting {
  padding: 14px;
  border: 1px solid #d6e1eb;
  border-radius: 13px;
  background: #f8fbfd;
}
.pg-setting h3 {
  margin: 0 0 9px;
  font-size: 1rem;
}
.pg-setting-note {
  margin: -2px 0 10px;
  color: #64748b;
  font-size: 0.9rem;
}
.pg-option-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pg-option-buttons button {
  border: 1px solid #aebfce;
  border-radius: 999px;
  padding: 9px 14px;
  background: #fff;
  color: #40536a;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.pg-option-buttons button.is-active {
  border-color: #1769aa;
  background: #1769aa;
  color: #fff;
}
.pg-option-buttons small {
  display: block;
  margin-top: 2px;
  font-size: 0.7rem;
  font-weight: 700;
  opacity: 0.85;
}
.pg-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 15px;
  border-radius: 12px;
  background: #243044;
  color: #fff;
}
.pg-board-wrap {
  max-width: 560px;
  margin: 22px auto;
}
.pg-board-wrap.is-wide {
  max-width: 900px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.pg-board-wrap.is-wide .pg-column-heads,
.pg-board-wrap.is-wide .pg-grid-board {
  min-width: 780px;
}
.pg-column-heads {
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  gap: 8px;
  margin-bottom: 7px;
  text-align: center;
  font-weight: 900;
  color: #1769aa;
}
.pg-grid-board {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  gap: 8px;
}
.pg-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 62px;
  border: 2px dashed #a8b7c6;
  border-radius: 12px;
  background: #f7fafc;
  padding: 8px;
  overflow-wrap: anywhere;
  text-align: center;
}
.pg-cell small {
  position: absolute;
  top: 4px;
  left: 7px;
  color: #718096;
  font-weight: 800;
}
.pg-cell strong {
  font-size: 1.04rem;
}
.pg-cell.is-absent {
  visibility: hidden;
}
.pg-cell.is-target {
  border-color: #df6b23;
  background: #fff4df;
  box-shadow: 0 0 0 4px rgba(223, 107, 35, 0.16);
  animation: targetPulse 1.2s infinite;
}
.pg-cell.is-filled {
  border-style: solid;
  border-color: #57a46b;
  background: #eef9f1;
}
.pg-cell.is-label {
  border-style: solid;
  border-color: #aebdca;
  background: #eaf1f6;
  color: #33485e;
}
.pg-cell.is-given {
  border-style: solid;
  border-color: #4d8fc3;
  background: #eaf5ff;
  color: #174f7b;
}
.pg-prompt {
  text-align: center;
  font-weight: 900;
  color: #a84d17;
}
.pg-choice-label {
  margin: 14px 0 0;
  text-align: center;
  color: #1769aa;
  font-weight: 900;
}
.pg-dobon-rule {
  padding: 12px 15px;
  border: 2px solid #c93a3a;
  border-radius: 11px;
  background: #fff0f0;
  color: #971f1f;
  font-weight: 900;
}
.pg-dobon {
  border-color: #d94343;
  background: linear-gradient(160deg, #fff, #fff0f0);
  text-align: center;
}
.pg-dobon h2 {
  color: #b21f1f;
  font-size: clamp(2rem, 8vw, 3.4rem);
}
.pg-dobon-answer {
  font-size: 1.2rem;
  font-weight: 900;
}
.pg-dobon-feedback {
  max-width: 560px;
  margin: 16px auto;
  padding: 16px;
  border: 2px solid #d94343;
  border-radius: 12px;
  background: #fff;
  font-weight: 900;
}
.pg-dobon .pg-actions {
  justify-content: center;
}
.pg-choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.pg-choices button {
  min-height: 56px;
  padding: 10px;
  border: 2px solid #bfd0df;
  border-radius: 12px;
  background: #fff;
  color: #243044;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.pg-choices button:disabled {
  visibility: hidden;
}
.pg-choices .is-wrong {
  animation: wrong 0.35s;
  background: #ffe5e5;
  border-color: #d94343;
  color: #a51616;
}
.pg-image-board {
  position: relative;
}
.pg-image-board img {
  display: block;
  width: 100%;
  height: auto;
}
.pg-image-slot {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  border: 2px dashed #a8b7c6;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  font-weight: 800;
}
.pg-image-slot.is-target {
  border-color: #df6b23;
  background: #fff4df;
  box-shadow: 0 0 0 4px rgba(223, 107, 35, 0.16);
}
.pg-image-slot.is-filled {
  border-style: solid;
  border-color: #57a46b;
  background: #eef9f1;
}
.pg-result {
  text-align: center;
}
.pg-result-mode {
  margin: 10px auto 0;
  color: #51667b;
  font-weight: 800;
}
.pg-result-stats {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin: 22px;
}
.pg-result-stats div {
  min-width: 130px;
  padding: 16px;
  border-radius: 14px;
  background: #f3f8fc;
}
.pg-result-stats span,
.pg-result-stats strong {
  display: block;
}
.pg-result-stats strong {
  font-size: 1.5rem;
}
.pg-record-message {
  max-width: 620px;
  margin: 0 auto 14px;
  padding: 12px 15px;
  border-radius: 12px;
  background: #fff7df;
  color: #8a4a13;
  font-weight: 900;
}
.pg-records {
  max-width: 520px;
  margin: 0 auto 18px;
  padding: 6px 16px;
  border: 1px solid #c9d9e7;
  border-radius: 14px;
  background: #f7fbff;
}
.pg-records p {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 10px 0;
}
.pg-records span {
  color: #51667b;
  font-weight: 800;
}
.pg-records strong {
  white-space: nowrap;
  color: #1769aa;
}
.pg-result .pg-actions {
  justify-content: center;
}
.pg-retire-wrap {
  margin-top: 24px;
  text-align: center;
}
.pg-retire {
  border: 1px solid #aeb8c3;
  border-radius: 10px;
  padding: 9px 18px;
  background: #fff;
  color: #68778a;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
@keyframes wrong {
  25% {
    transform: translateX(-7px);
  }
  75% {
    transform: translateX(7px);
  }
}
@keyframes targetPulse {
  50% {
    box-shadow: 0 0 0 7px rgba(223, 107, 35, 0.08);
  }
}
.pg-app [hidden] {
  display: none !important;
}
@media (max-width: 680px) {
  .pg-panel,
  .pg-hero {
    padding: 20px 16px;
  }
  .pg-grid {
    grid-template-columns: 1fr;
  }
  .pg-member-head,
  .pg-login {
    align-items: stretch;
    flex-direction: column;
  }
  .pg-actions > * {
    flex: 1 1 100%;
  }
  .pg-choices {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pg-cell {
    min-height: 54px;
  }
  #pg-board.pg-board-wrap.is-mobile-wide {
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-behavior: smooth;
  }
  #pg-board.pg-board-wrap.is-mobile-wide .pg-grid-board {
    min-width: calc(var(--board-cols) * 140px);
  }
  #pg-board .pg-cell.is-mobile-pinned {
    position: sticky;
    left: 0;
    z-index: 4;
    box-shadow: 7px 0 10px -9px rgba(36, 48, 68, 0.9);
  }
  #pg-board .pg-cell.is-mobile-pinned.is-target {
    z-index: 5;
  }
  .pg-result-stats {
    gap: 10px;
  }
  .pg-result-stats div {
    min-width: 0;
    flex: 1;
  }
  .pg-records p {
    display: block;
  }
  .pg-records span,
  .pg-records strong {
    display: block;
  }
}
