:root {
  color-scheme: dark;
  --page: #121517;
  --surface: #1e2224;
  --surface-raised: #252a2c;
  --field: #121517;
  --text: #f5f7f8;
  --muted: #aeb4b8;
  --line: rgba(255, 255, 255, 0.1);
  --green: #2dcc71;
  --green-deep: #20b864;
  --blue: #3498db;
  --red: #e74c3c;
  --shadow: 0 12px 25px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page);
}

body {
  min-height: 100vh;
  margin: 0;
  padding: 1px 20px 30px;
  background: var(--page);
  color: var(--text);
  font-family: Arial, "Noto Sans JP", sans-serif;
  text-align: center;
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: #8cdaac;
  text-decoration: none;
  text-underline-offset: 3px;
}

a:hover {
  color: #b7f0ce;
  text-decoration: underline;
}

.page-shell {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

.guild-page {
  max-width: none;
}

.guild-toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 18px 45px 0;
}

.logout-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: #d6dcdf;
  font-size: 14px;
  font-weight: 700;
}

.logout-button:hover {
  border-color: rgba(231, 76, 60, 0.55);
  background: rgba(231, 76, 60, 0.1);
  color: #ffb4a9;
  text-decoration: none;
}

.page-title {
  margin: 45px 20px 34px;
  font-size: 42px;
  font-weight: 900;
  letter-spacing: 1px;
  line-height: 1.25;
  text-shadow: 3px 3px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000;
}

.page-subtitle {
  margin: -20px 0 28px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.content-panel,
.panel-card {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, var(--surface), #181c1e);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  text-align: left;
}

.content-panel--narrow,
.panel-card {
  max-width: 560px;
}

.content-panel h2 {
  margin: 28px 0 10px;
  color: var(--text);
  font-size: 22px;
  line-height: 1.4;
}

.content-panel h2:first-child {
  margin-top: 0;
}

.content-panel p,
.content-panel li {
  color: #d4dadd;
  line-height: 1.8;
}

.content-panel p:last-child {
  margin-bottom: 0;
}

.site-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}

.site-links a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 1px solid rgba(45, 204, 113, 0.35);
  border-radius: 9px;
  background: rgba(45, 204, 113, 0.1);
  color: #c8f5d9;
  font-weight: 800;
}

.form-stack {
  display: grid;
  gap: 18px;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  text-align: left;
}

.form-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.form-field label,
.content-panel label,
.panel-card label {
  color: #e4e8ea;
  font-size: 15px;
  font-weight: 800;
  text-align: left;
}

.form-input,
.form-stack input:not([type="hidden"]),
.form-stack select,
.form-stack textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9px;
  background: var(--field);
  color: var(--text);
}

.form-input:focus-visible,
.form-stack input:focus-visible,
.form-stack select:focus-visible,
.form-stack textarea:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.btn,
.submit-button,
.action-button,
.signup-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover,
.submit-button:hover,
.action-button:hover,
.signup-button:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.4);
}

.btn:active,
.submit-button:active,
.action-button:active,
.signup-button:active {
  transform: translateY(1px);
}

.btn:focus-visible,
.submit-button:focus-visible,
.action-button:focus-visible,
.signup-button:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

.btn-success,
.signup-button,
.submit-button {
  background: linear-gradient(180deg, var(--green), var(--green-deep));
}

.btn-primary,
.send-button {
  background: linear-gradient(180deg, #3498db, #2980b9);
}

.backup-button {
  background: linear-gradient(180deg, #2dcc71, #20b864);
}

.btn-danger,
.delete-button {
  background: linear-gradient(180deg, #e74c3c, #c0392b);
}

.form-stack > .btn,
.form-stack > button {
  width: 100%;
  margin-top: 4px;
}

.form-stack select option {
  background: var(--surface);
  color: var(--text);
}

.notice,
.message {
  margin: 18px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  color: #dce2e5;
  line-height: 1.65;
  text-align: center;
}

.notice--success {
  border-color: rgba(45, 204, 113, 0.32);
  background: rgba(45, 204, 113, 0.1);
  color: #bff0d1;
}

.notice--error,
.message {
  border-color: rgba(231, 76, 60, 0.32);
  background: rgba(231, 76, 60, 0.08);
  color: #ffb4a9;
}

.site-footer,
.footer {
  padding: 26px 20px 4px;
  color: #d5dbde;
  font-size: 15px;
  font-weight: 800;
  text-shadow: 2px 2px 3px #000;
}

/* Guild directory */
.server-container {
  display: flex;
  width: 100%;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: center;
  gap: 26px 22px;
  padding: 0 22px 36px;
}

.guild-status {
  margin: 0 20px 20px;
  color: var(--muted);
  line-height: 1.6;
}

.guild-status:empty {
  display: none;
}

.server-box {
  display: flex;
  width: 340px;
  min-height: 300px;
  flex: 0 1 340px;
  flex-direction: column;
  align-items: center;
  padding: 26px 22px 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(145deg, #1e2224, #181c1e);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.server-box:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.52);
}

.server-avatar {
  width: 100px;
  height: 100px;
  margin-bottom: 16px;
  border-radius: 50%;
  background: #282c30;
  object-fit: cover;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.server-name {
  width: 100%;
  margin: 0;
  overflow: hidden;
  color: #fff;
  font-size: 23px;
  font-weight: 900;
  text-overflow: ellipsis;
  text-shadow: 2px 2px 0 #000, -1px -1px 0 #000;
  white-space: nowrap;
}

.server-id,
.server-member-count {
  width: 100%;
  margin: 7px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-member-count {
  margin-top: 4px;
  margin-bottom: 20px;
}

.server-form {
  width: 100%;
  margin-top: auto;
}

.guild-input {
  display: none;
}

.signup-button,
.action-button {
  width: 100%;
  min-height: 48px;
  font-size: 16px;
}

.action-buttons {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.delete-data-button {
  background: linear-gradient(180deg, #a93226, #7b241c);
}

.action-button {
  flex: 1;
}

/* Custom panel selectors */
.panel-card {
  text-align: center;
}

.panel-card label {
  display: block;
  margin: 20px 0 8px;
}

.selectbox {
  position: relative;
  width: 100%;
  text-align: left;
}

.select-trigger {
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9px;
  background: linear-gradient(145deg, #161a1c, #101315);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.select-trigger:hover,
.selectbox.is-open .select-trigger {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(45, 204, 113, 0.12);
}

.select-trigger:disabled {
  cursor: wait;
  opacity: 0.58;
}

.select-trigger:focus-visible,
.select-option:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

.select-current {
  overflow: hidden;
  color: #f4f6f7;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select-current.is-placeholder {
  color: var(--muted);
}

.select-chevron {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.2s ease;
}

.selectbox.is-open .select-chevron {
  transform: translateY(2px) rotate(225deg);
}

.select-menu {
  position: absolute;
  z-index: 5;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  max-height: 260px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(145deg, #23282a, #161a1c);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.58), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  animation: menu-in 0.16s ease-out;
  scrollbar-color: #596268 #202629;
  scrollbar-width: thin;
}

.select-menu[hidden] {
  display: none;
}

.select-option {
  width: 100%;
  min-height: 42px;
  margin: 0;
  padding: 9px 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #e8ecee;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.select-option:hover,
.select-option[aria-selected="true"] {
  background: rgba(45, 204, 113, 0.18);
  color: #fff;
}

.select-option[aria-selected="true"] {
  box-shadow: inset 2px 0 var(--green);
}

.option-mark {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 9px rgba(45, 204, 113, 0.55);
  vertical-align: 1px;
}

.empty-options {
  margin: 0;
  padding: 12px;
  color: var(--muted);
  font-size: 14px;
  text-align: left;
}

#panel-message {
  text-align: center;
}

#panel-message:empty {
  display: none;
}

.status-message:empty {
  display: none;
}

@keyframes menu-in {
  from { opacity: 0; transform: translateY(-5px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.panel-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 24px;
}

.verify-avatar {
  display: block;
  width: 160px;
  height: 160px;
  margin: 0 auto 24px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow);
}

.verify-page {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.verify-shell {
  width: 100%;
}

.verify-card {
  text-align: center;
}

.verify-card h1,
.verify-card p {
  text-align: center;
}

.verify-card .site-footer {
  padding-bottom: 0;
}

@media (max-width: 600px) {
  .page-title {
    margin: 30px 0;
    font-size: 28px;
  }

  .content-panel,
  .panel-card {
    padding: 22px 19px;
    border-radius: 14px;
  }

  .server-container {
    gap: 20px;
    padding: 0 8px 26px;
  }

  .server-box {
    width: 100%;
    max-width: 400px;
    flex-basis: 100%;
  }

  .site-links {
    flex-direction: column;
  }

  .guild-toolbar {
    padding: 14px 20px 0;
  }
}
