.account-app {
  width: min(760px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 18px 0 30px;
}

.account-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(35, 39, 48, 0.94);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
}

.account-titlebar {
  display: flex;
  min-height: 86px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding: 18px 20px;
  background: #20242c;
}

.account-titlebar h1 {
  font-size: 1.35rem;
  line-height: 1.25;
}

.account-back-link {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.account-back-link:hover {
  border-color: var(--accent);
  color: var(--text);
  background: #252a33;
}

.account-profile {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.account-profile[hidden] {
  display: none;
}

.account-profile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #151920;
}

.account-profile-head div {
  min-width: 0;
}

.account-profile-head span {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
}

.account-profile-head strong {
  display: block;
  overflow: hidden;
  margin-top: 5px;
  font-size: 1.35rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-profile-head .secondary-button {
  flex: 0 0 auto;
  width: auto;
  min-height: 36px;
  margin-top: 0;
  border-radius: 6px;
  padding: 0 12px;
  font-size: 0.78rem;
}

.account-form {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.account-form[hidden] {
  display: none;
}

.account-field {
  display: grid;
  gap: 8px;
}

.account-field span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.account-field input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--text);
  background: #151920;
  font-size: 1rem;
  font-weight: 800;
}

.account-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  background: transparent;
}

.account-meta div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  background: #20242c;
}

.account-meta div + div {
  border-left: 1px solid var(--line);
}

.account-meta dt {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 850;
}

.account-meta dd {
  overflow: hidden;
  margin-top: 6px;
  font-size: 0.82rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.public-id-reveal {
  display: inline-flex;
  max-width: 100%;
  min-height: 28px;
  align-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  padding: 0 9px;
  color: var(--muted);
  background: #151920;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.public-id-reveal:hover,
.public-id-reveal:focus-visible {
  border-color: var(--accent);
  color: var(--text);
  outline: none;
}

.public-id-reveal.is-revealed {
  overflow: hidden;
  border-style: solid;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-overflow: ellipsis;
  user-select: all;
}

.account-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.account-actions a,
.account-actions button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 0 14px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
}

.account-actions a:hover,
.account-actions button:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--text);
  background: #252a33;
}

.account-actions .primary-button {
  border-color: var(--accent-2);
  color: #101318;
  background: var(--accent-2);
}

.account-actions .primary-button:hover:not(:disabled) {
  border-color: #ffe08a;
  color: #101318;
  background: #ffe08a;
}

.account-games {
  display: grid;
  gap: 10px;
}

.account-games h2 {
  font-size: 0.98rem;
  line-height: 1.3;
}

.account-games-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #151920;
}

.account-games-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
}

.account-games-table th,
.account-games-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 11px;
  text-align: right;
  white-space: nowrap;
}

.account-games-table th:first-child,
.account-games-table td:first-child {
  text-align: left;
}

.account-games-table th {
  color: var(--muted);
  background: #20242c;
  font-size: 0.68rem;
  font-weight: 900;
}

.account-games-table td {
  font-size: 0.86rem;
  font-weight: 850;
}

.account-games-table tr:last-child td {
  border-bottom: 0;
}

/* DEBUG 枠。typingpark.localhost でのみ表示される（account.js が hidden を外す）。 */
.account-debug {
  display: grid;
  gap: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 14px;
  background: rgba(21, 25, 32, 0.7);
}

.account-debug-head {
  display: grid;
  gap: 4px;
}

.account-debug-head h2 {
  color: #ffd166;
  font-size: 0.86rem;
  letter-spacing: 0.12em;
  line-height: 1.3;
}

.account-debug-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.5;
}

.account-debug-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.account-debug select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--text);
  background: #151920;
  font-size: 0.95rem;
  font-weight: 800;
}

.account-debug-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.account-debug-status {
  margin: 0;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
}

.account-status {
  min-height: 1.5em;
  margin: 0;
  padding: 0 18px 18px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.account-status.is-error {
  color: #ff9aa3;
}

.account-status.is-success {
  color: var(--accent);
}

@media (max-width: 560px) {
  .account-titlebar {
    display: grid;
  }

  .account-profile-head {
    display: grid;
  }

  .account-meta,
  .account-actions,
  .account-debug-fields {
    grid-template-columns: 1fr;
  }

  .account-meta div + div {
    border-left: 1px solid var(--line);
  }
}
