.gdg-modal-root[hidden] {
  display: none !important;
}

.gdg-modal-root,
.gdg-modal-root * {
  box-sizing: border-box;
}

.gdg-modal-root {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(10, 12, 18, 0.78);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.gdg-modal {
  width: min(1280px, 100%);
  height: min(92vh, 900px);
  background: #11151f;
  color: #f3f4f6;
  border: 1px solid #2a3245;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

.gdg-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: #171d2b;
  border-bottom: 1px solid #2a3245;
}

.gdg-modal-title h2 {
  margin: 0;
  font-size: 1.15rem;
  color: #fff;
}

.gdg-modal-meta {
  font-size: 0.85rem;
  color: #9ca3af;
  margin-top: 2px;
}

.gdg-modal-close {
  background: #263044;
  color: #fff;
  border: 1px solid #394661;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.gdg-modal-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 370px;
}

.gdg-map-pane {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #0d1018;
  min-width: 0;
  min-height: 0;
}

.gdg-map-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: #141925;
  border-bottom: 1px solid #242c3d;
  font-size: 0.82rem;
}

.gdg-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.gdg-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 3px;
  margin-right: 4px;
  vertical-align: middle;
}

.gdg-dot-confirmed {
  background: #334155 !important;
  border: 1px solid #64748b;
  box-shadow: inset 0 3px 0 #d9a441;
}

.gdg-map-pane.is-list-view .gdg-zoom-map-only {
  display: none !important;
}

.gdg-zoom-controls {
  display: flex;
  gap: 6px;
}

.gdg-zoom-controls button {
  background: #232b3d;
  color: #e5e7eb;
  border: 1px solid #36425c;
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 0.8rem;
}

.gdg-map-viewport {
  position: relative;
  flex: 1;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  background: radial-gradient(circle at top, #171d2c, #0c0f17);
}

.gdg-map-viewport.is-panning {
  cursor: grabbing;
}

.gdg-map-stage {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  background-color: #0f1523;
  background-image:
    linear-gradient(to right, rgba(148, 163, 184, 0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.07) 1px, transparent 1px);
  background-size: 40px 40px;
  border: 2px solid #2a3954;
  border-radius: 12px;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.65), inset 0 0 60px rgba(0, 0, 0, 0.35);
}

.gdg-box {
  position: absolute;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6px;
  user-select: none;
}

.gdg-box-shape {
  border-radius: 12px;
  border: 1.5px solid rgba(148, 163, 184, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.gdg-box-label {
  font-weight: 700;
  color: #e2e8f0;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.65);
  letter-spacing: 0.01em;
  pointer-events: none;
}

.gdg-box-seat {
  border-radius: 12px;
  border: 2px solid #22c55e;
  background: linear-gradient(160deg, rgba(34, 197, 94, 0.2), rgba(15, 23, 42, 0.94)) !important;
  color: #f8fafc !important;
  font-weight: 800;
  font-size: 24px !important;
  line-height: 1.15;
  cursor: pointer;
  gap: 4px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.gdg-box-seat::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: #22c55e;
}

.gdg-box-seat:hover:not(.is-taken):not(.is-locked) {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(34, 197, 94, 0.32);
  border-color: #4ade80;
}

.gdg-box-seat.is-selected {
  outline: 4px solid rgba(56, 189, 248, 0.55);
  outline-offset: 2px;
  border-color: #38bdf8;
  background: linear-gradient(160deg, rgba(14, 165, 233, 0.42), rgba(15, 23, 42, 0.96)) !important;
  color: #fff !important;
}

.gdg-box-seat.is-selected::before {
  background: #38bdf8;
}

.gdg-box-seat.is-pending {
  border-color: #f59e0b;
  background: linear-gradient(160deg, rgba(245, 158, 11, 0.24), rgba(15, 23, 42, 0.95)) !important;
  color: #fef3c7 !important;
  cursor: not-allowed;
}

.gdg-box-seat.is-pending::before {
  background: #f59e0b;
}

.gdg-box-seat.is-approved {
  border-color: #64748b;
  background: linear-gradient(160deg, rgba(30, 41, 59, 0.94), rgba(15, 23, 42, 0.98)) !important;
  color: #f1f5f9 !important;
  cursor: not-allowed;
}

.gdg-box-seat.is-approved::before {
  background: #d9a441;
}

.gdg-box-seat.is-locked {
  border-color: #334155;
  background: repeating-linear-gradient(
    -45deg,
    rgba(30, 41, 59, 0.85),
    rgba(30, 41, 59, 0.85) 10px,
    rgba(15, 23, 42, 0.9) 10px,
    rgba(15, 23, 42, 0.9) 20px
  ) !important;
  color: #94a3b8 !important;
  cursor: not-allowed;
  opacity: 0.78;
}

.gdg-box-seat.is-locked::before {
  background: #475569;
}

.gdg-seat-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #d9a441;
  background: #1e293b;
  flex-shrink: 0;
}

.gdg-seat-initials {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: #111827;
  background: #d9a441;
  border: 2px solid rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
}

.gdg-seat-sub {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  margin-top: 2px;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  max-width: 94%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gdg-box-seat:not(.is-taken):not(.is-locked):not(.is-selected) .gdg-seat-sub {
  color: #4ade80;
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.35);
}

.gdg-form-pane {
  background: #171d2b;
  border-left: 1px solid #2a3245;
  padding: 16px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gdg-discord-card {
  background: #1e273a;
  border: 1px solid #34415e;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.gdg-discord-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-bottom: 6px;
  border-bottom: 1px solid #242d40;
}

.gdg-discord-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  padding: 11px 14px;
  border-radius: 8px;
  background: #5865f2;
  color: #fff !important;
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(88, 101, 242, 0.35);
  transition: background 0.15s ease, transform 0.1s ease;
}

.gdg-discord-btn:hover {
  background: #4752c4;
  transform: translateY(-1px);
}

.gdg-discord-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  fill: currentColor;
}

.gdg-discord-hint {
  font-size: 0.76rem;
  color: #94a3b8;
  text-align: center;
  line-height: 1.3;
}

.gdg-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gdg-field label,
.gdg-field-heading {
  font-size: 0.82rem;
  color: #cbd5e1;
  font-weight: 600;
}

.gdg-field input,
.gdg-field textarea {
  background: #0f141f;
  color: #f8fafc;
  border: 1px solid #334155;
  border-radius: 7px;
  padding: 8px 10px;
  font-size: 0.92rem;
  font-family: inherit;
}

.gdg-check-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: #cbd5e1;
  cursor: pointer;
}

.gdg-check-inline input {
  width: 16px;
  height: 16px;
  accent-color: #22c55e;
}

.gdg-mobile-tabs,
.gdg-mobile-bar,
.gdg-mobile-back-btn {
  display: none;
}

.gdg-seat-list-view {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  background: radial-gradient(circle at top, #171d2c, #0c0f17);
  -webkit-overflow-scrolling: touch;
}

.gdg-seat-list-view[hidden] {
  display: none !important;
}

.gdg-seat-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.gdg-seat-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  min-height: 68px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid #22c55e;
  background: linear-gradient(160deg, rgba(34, 197, 94, 0.16), rgba(15, 23, 42, 0.95));
  color: #f8fafc;
  cursor: pointer;
  text-align: left;
}

.gdg-seat-card.is-selected {
  border-color: #38bdf8;
  background: linear-gradient(160deg, rgba(14, 165, 233, 0.35), rgba(15, 23, 42, 0.96));
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.4);
}

.gdg-seat-card.is-pending {
  border-color: #f59e0b;
  background: linear-gradient(160deg, rgba(245, 158, 11, 0.2), rgba(15, 23, 42, 0.95));
  color: #fef3c7;
  cursor: not-allowed;
}

.gdg-seat-card.is-approved {
  border-color: #64748b;
  background: linear-gradient(160deg, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.98));
  color: #f1f5f9;
  cursor: not-allowed;
}

.gdg-seat-card.is-locked {
  border-color: #334155;
  background: rgba(15, 23, 42, 0.78);
  color: #94a3b8;
  opacity: 0.72;
  cursor: not-allowed;
}

.gdg-seat-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 8px;
  font-size: 1rem;
}

.gdg-seat-card-avatar,
.gdg-seat-card-ini {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
}

.gdg-seat-card-avatar {
  object-fit: cover;
  border: 1.5px solid #d9a441;
}

.gdg-seat-card-ini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #111827;
  background: #d9a441;
}

.gdg-seat-card-sub {
  font-size: 0.78rem;
  font-weight: 700;
  color: #cbd5e1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gdg-seat-card-note {
  font-size: 0.72rem;
  color: #94a3b8;
}

.gdg-selected-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gdg-selected-row {
  display: grid;
  grid-template-columns: 74px 1fr auto;
  gap: 6px;
  align-items: center;
  background: #111622;
  padding: 6px 8px;
  border-radius: 7px;
  border: 1px solid #2b364d;
}

.gdg-selected-row button {
  min-width: 36px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.gdg-selected-row input {
  background: #182032;
  color: #fff;
  border: 1px solid #334155;
  border-radius: 5px;
  padding: 5px 7px;
  font-size: 0.82rem;
}

.gdg-submit-btn {
  width: 100%;
  padding: 11px 14px;
  border-radius: 8px;
  background: #22c55e;
  color: #052e16;
  font-weight: 700;
  font-size: 0.96rem;
  border: none;
  cursor: pointer;
}

.gdg-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.gdg-alert {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.88rem;
}

.gdg-alert-error {
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid #ef4444;
  color: #fecaca;
}

.gdg-alert-ok {
  background: rgba(34, 197, 94, 0.16);
  border: 1px solid #22c55e;
  color: #bbf7d0;
}

.gdg-alert-warn {
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid #f59e0b;
  color: #fde68a;
}

.gdg-mod-link {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 7px;
  background: #27324a;
  border: 1px solid #3c4d70;
  color: #e2e8f0 !important;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
}

@media (max-width: 900px) {
  .gdg-modal-root {
    padding: 0;
  }
  .gdg-modal {
    height: 100dvh;
    max-height: 100dvh;
    width: 100vw;
    border-radius: 0;
    border: none;
  }
  .gdg-modal-header {
    padding: 10px 12px;
    gap: 8px;
  }
  .gdg-modal-title h2 {
    font-size: 1rem;
  }
  .gdg-modal-meta {
    font-size: 0.76rem;
  }
  .gdg-modal-close {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
  }
  .gdg-mobile-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 8px 10px;
    background: #141925;
    border-bottom: 1px solid #242c3d;
    flex-shrink: 0;
  }
  .gdg-mobile-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 38px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid #2c3852;
    background: #1b2233;
    color: #cbd5e1;
    font-weight: 700;
    font-size: 0.86rem;
    cursor: pointer;
  }
  .gdg-mobile-tab.is-active {
    background: #232d45;
    border-color: #d9a441;
    color: #fff;
  }
  .gdg-mobile-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #22c55e;
    color: #052e16;
    font-size: 0.75rem;
    font-weight: 800;
  }
  .gdg-mobile-count.is-zero {
    background: #334155;
    color: #cbd5e1;
  }
  .gdg-modal-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }
  .gdg-map-toolbar {
    padding: 6px 10px;
    gap: 6px;
    font-size: 0.74rem;
  }
  .gdg-legend {
    gap: 8px;
  }
  .gdg-zoom-controls button {
    min-height: 34px;
    padding: 4px 10px;
  }
  .gdg-modal.is-mobile-tab-map .gdg-map-pane {
    display: flex;
    flex: 1;
    min-height: 0;
  }
  .gdg-modal.is-mobile-tab-map .gdg-form-pane {
    display: none;
  }
  .gdg-modal.is-mobile-tab-form .gdg-map-pane {
    display: none;
  }
  .gdg-modal.is-mobile-tab-form .gdg-form-pane {
    display: flex;
    flex: 1;
    min-height: 0;
    border-left: none;
    border-top: none;
    padding: 14px 14px calc(28px + env(safe-area-inset-bottom, 0px));
    -webkit-overflow-scrolling: touch;
  }
  .gdg-mobile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    background: #171d2b;
    border-top: 1px solid #2a3245;
    flex-shrink: 0;
  }
  .gdg-modal.is-mobile-tab-form .gdg-mobile-bar {
    display: none;
  }
  .gdg-mobile-summary {
    font-size: 0.85rem;
    font-weight: 600;
    color: #e2e8f0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .gdg-mobile-continue {
    padding: 10px 16px;
    border-radius: 9px;
    background: #22c55e;
    color: #052e16;
    font-weight: 800;
    font-size: 0.9rem;
    border: none;
    flex-shrink: 0;
    cursor: pointer;
  }
  .gdg-mobile-continue:disabled {
    opacity: 0.45;
    cursor: not-allowed;
  }
  .gdg-mobile-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    padding: 8px 12px;
    border-radius: 8px;
    background: #232b3d;
    border: 1px solid #36425c;
    color: #e2e8f0;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
  }
  .gdg-field input,
  .gdg-field textarea,
  .gdg-selected-row input {
    font-size: 16px !important;
  }
  .gdg-selected-row button {
    min-width: 42px;
    min-height: 42px;
  }
  .gdg-submit-btn {
    min-height: 48px;
    margin-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }
}
