:root {
  --color-bg: #0f1117;
  --color-bg-elevated: #171a23;
  --color-border: #2a2e3a;
  --color-text: #e7e9ee;
  --color-text-muted: #9aa0ac;
  --color-primary: #5865f2; /* Discordブランドカラー */
  --color-primary-hover: #4752c4;
  --color-danger: #ed4245;
  --color-success: #3ba55c;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #1b1f2c 0%, var(--color-bg) 60%);
  color: var(--color-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

header.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
}

.logo {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
  color: var(--color-text);
}
.logo span {
  color: var(--color-primary);
}

main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 36px 32px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

body.landing-page main {
  align-items: flex-start;
  padding: 40px 24px 60px;
}

.landing-wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.hero-block {
  text-align: center;
}
.hero-block h1 {
  font-size: 2.1rem;
  margin: 0 0 8px;
}
.hero-block .subtitle {
  color: var(--color-text-muted);
  margin: 0 0 22px;
}

.header-username {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text);
}
.header-username:hover {
  color: var(--color-primary);
  text-decoration: none;
}

.showcase-section h2 {
  font-size: 1.25rem;
  margin: 0 0 16px;
}

.slot-tile-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

@media (max-width: 900px) {
  .slot-tile-row {
    grid-auto-flow: column;
    grid-auto-columns: 200px;
    grid-template-columns: none;
    overflow-x: auto;
    padding-bottom: 8px;
  }
}

.slot-tile {
  display: flex;
  flex-direction: column;
  background: #0d0f16;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  color: var(--color-text);
  cursor: pointer;
  text-align: left;
}
.slot-tile:hover {
  border-color: var(--color-primary);
  text-decoration: none;
}

.slot-tile-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #05060a;
  display: flex;
  align-items: center;
  justify-content: center;
}
.slot-tile-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.slot-tile-thumb .slot-tile-noimg {
  color: var(--color-text-muted);
  font-size: 0.7rem;
}

.slot-tile-body {
  padding: 10px 12px 14px;
}
.slot-tile-cast {
  font-weight: 600;
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.slot-tile-time {
  color: var(--color-text-muted);
  font-size: 0.76rem;
  margin-top: 4px;
}
.slot-tile-price {
  color: var(--color-primary);
  font-weight: 700;
  font-size: 0.88rem;
  margin-top: 6px;
}

.slot-tile-action {
  margin-top: 10px;
}
.slot-tile-action .btn-small {
  width: 100%;
}

.slot-tile-sold-out {
  cursor: default;
  opacity: 0.7;
}
.slot-tile-sold-out:hover {
  border-color: var(--color-border);
}

.showcase-empty {
  grid-column: 1 / -1;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  padding: 24px 0;
  text-align: center;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
}

.cast-list-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 16px;
}

.cast-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  background: #0d0f16;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-text);
  text-decoration: none;
  text-align: center;
}
.cast-tile:hover {
  border-color: var(--color-primary);
  text-decoration: none;
}

.cast-tile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--color-border);
  flex-shrink: 0;
}
.cast-tile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-header {
  text-align: center;
}

.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--color-border);
  margin: 0 auto 16px;
}
.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-name {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.profile-stats {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin-bottom: 20px;
}

.profile-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.profile-actions .btn {
  width: auto;
  padding: 10px 22px;
}
.profile-actions .btn-outline.favorited {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.cast-tile-name {
  font-size: 0.85rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.auth-card h1 {
  font-size: 1.5rem;
  margin: 0 0 6px;
}

.auth-card p.subtitle {
  color: var(--color-text-muted);
  margin: 0 0 28px;
  font-size: 0.9rem;
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 6px;
  color: var(--color-text-muted);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: #0d0f16;
  color: var(--color-text);
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--color-primary);
}

.field-hint {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-top: 6px;
}

button, .btn {
  cursor: pointer;
  border: none;
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background: var(--color-primary-hover);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-discord {
  background: #5865f2;
  color: #fff;
  margin-bottom: 8px;
}
.btn-discord:hover {
  background: var(--color-primary-hover);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text);
}
.btn-outline:hover {
  border-color: var(--color-primary);
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  margin: 20px 0;
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

.discord-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  margin-bottom: 18px;
  font-size: 0.88rem;
}

.discord-status.connected {
  border-color: var(--color-success);
  background: rgba(59, 165, 92, 0.08);
}

.discord-status img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

.discord-status .placeholder-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-border);
}

.payout-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
  font-size: 0.9rem;
}
.payout-summary .btn-small {
  width: auto;
}

.account-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.account-actions .btn-small {
  width: auto;
}

.avatar-preview {
  max-width: 160px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
}

.alert {
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  margin-bottom: 18px;
}
.alert-error {
  background: rgba(237, 66, 69, 0.12);
  border: 1px solid var(--color-danger);
  color: #ff8a8c;
}
.alert-success {
  background: rgba(59, 165, 92, 0.12);
  border: 1px solid var(--color-success);
  color: #7fdb98;
}

.switch-link {
  text-align: center;
  margin-top: 22px;
  font-size: 0.88rem;
  color: var(--color-text-muted);
}

footer.site-footer {
  text-align: center;
  padding: 20px;
  color: var(--color-text-muted);
  font-size: 0.78rem;
}

.hidden {
  display: none !important;
}

.icon-discord {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.wide-card {
  max-width: 720px;
}

.wider-card {
  max-width: 980px;
}

.page-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.page-header-row h1 {
  margin: 0;
}

.page-header-row .btn-small {
  flex-shrink: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.inline-form-panel {
  background: #0d0f16;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 24px;
}

.inline-form-panel h2 {
  font-size: 1.05rem;
  margin: 0 0 14px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.two-col .col {
  min-width: 0;
}

.two-col .col h2 {
  font-size: 1.05rem;
  margin: 0 0 14px;
}

@media (max-width: 760px) {
  .two-col {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

.section-block {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
}

.section-block h2 {
  font-size: 1.05rem;
  margin: 0 0 14px;
}

.points-balance {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  background: #0d0f16;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 16px;
}

.points-balance-label {
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.points-balance-value {
  font-size: 1.6rem;
  font-weight: 700;
}
.points-balance-value span {
  color: var(--color-primary);
}

.points-expiring {
  color: var(--color-text-muted);
  font-size: 0.82rem;
  margin: 8px 0 14px;
}
.points-expiring span {
  color: #ff8a8c;
  font-weight: 700;
}

.package-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 14px;
}

@media (max-width: 480px) {
  .package-list {
    grid-template-columns: 1fr;
  }
}

.package-btn {
  display: block;
  width: 100%;
  text-align: left;
  background: #0d0f16;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  color: var(--color-text);
  cursor: pointer;
}
.package-btn:hover {
  border-color: var(--color-primary);
}
.package-btn .pkg-points {
  font-weight: 700;
  font-size: 1.05rem;
}
.package-btn .pkg-price {
  color: var(--color-text-muted);
  font-size: 0.82rem;
  margin-top: 4px;
}
.package-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.history-table {
  width: 100%;
  overflow-x: auto;
}

.history-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.history-table th, .history-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--color-border);
}

.history-table th {
  color: var(--color-text-muted);
  font-weight: 500;
  font-size: 0.78rem;
}

.history-empty {
  color: var(--color-text-muted);
  font-size: 0.88rem;
  padding: 16px 0;
  text-align: center;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 12px;
}

.month-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.month-filter input[type="month"] {
  padding: 8px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: #0d0f16;
  color: var(--color-text);
  color-scheme: dark;
}

.page-info {
  color: var(--color-text-muted);
  font-size: 0.82rem;
}

.btn-small {
  width: auto;
  padding: 8px 14px;
  font-size: 0.85rem;
}

.header-link {
  font-size: 0.88rem;
  color: var(--color-text-muted);
}
.header-link:hover {
  color: var(--color-text);
}

.slot-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.slot-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #0d0f16;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  flex-wrap: wrap;
}

.slot-card-body {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.slot-card-thumb {
  width: 120px;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  overflow: hidden;
  background: #05060a;
  border: 1px solid var(--color-border);
  flex-shrink: 0;
}

.slot-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumbnail-preview {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: #05060a;
  border: 1px dashed var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
}

.thumbnail-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumbnail-preview .thumbnail-preview-empty {
  color: var(--color-text-muted);
  font-size: 0.78rem;
  text-align: center;
  padding: 0 12px;
}

.slot-card-info .slot-cast {
  font-weight: 600;
}
.slot-card-info .slot-time {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin-top: 2px;
}
.slot-card-info .slot-price {
  color: var(--color-primary);
  font-weight: 700;
  margin-top: 4px;
}

.slot-card .btn-primary,
.slot-card .btn-outline {
  width: auto;
  padding: 9px 16px;
  font-size: 0.85rem;
  white-space: nowrap;
}

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.status-badge.available { background: rgba(59, 165, 92, 0.15); color: #7fdb98; }
.status-badge.reserved  { background: rgba(88, 101, 242, 0.18); color: #a6b1ff; }
.status-badge.completed { background: rgba(154, 160, 172, 0.18); color: #c3c7d1; }
.status-badge.cancelled { background: rgba(237, 66, 69, 0.15); color: #ff8a8c; }
.status-badge.not-held  { background: rgba(154, 160, 172, 0.12); color: #9aa0ac; }

.slot-card .btn-danger {
  border-color: var(--color-danger);
  color: #ff8a8c;
}
.slot-card .btn-danger:hover {
  background: rgba(237, 66, 69, 0.1);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 10, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.modal-box {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  width: auto;
  padding: 4px 8px;
  z-index: 1;
}
.modal-close:hover {
  color: var(--color-text);
}

.favorite-cast-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.favorite-cast-tile {
  cursor: pointer;
}

.cast-popup-box {
  max-width: 640px;
  width: 95%;
  height: 85vh;
  padding: 0;
  overflow: hidden;
}

.cast-popup-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.modal-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #05060a;
  border-radius: 16px 16px 0 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.modal-thumb .modal-thumb-noimg {
  color: var(--color-text-muted);
  font-size: 0.8rem;
}

.modal-body {
  padding: 22px 24px 26px;
}

.modal-cast {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.modal-info-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9rem;
}
.modal-info-row .label {
  color: var(--color-text-muted);
}
.modal-info-row .value {
  font-weight: 600;
  text-align: right;
}
.modal-info-row .value.price {
  color: var(--color-primary);
}

.modal-actions {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-message {
  text-align: center;
  padding: 8px 0 4px;
  font-size: 0.95rem;
}
.modal-message.error {
  color: #ff8a8c;
}
.modal-message.success {
  color: #7fdb98;
}
