* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(180deg, #f5f7ff 0%, #eef3ff 100%);
  color: #1f2937;
}

body.home-body {
  background: #f6f6f6;
  color: #333;
}

.home-page {
  display: flex;
  width: 100%;
  max-width: 750px;
  min-height: 100vh;
  min-height: 100dvh;
  flex-direction: column;
  margin: 0 auto;
  overflow: hidden;
  border-right: 1px solid #d9d9d9;
  border-left: 1px solid #d9d9d9;
  background: #fff;
}

.home-nav {
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-bottom: 1px solid #d9d9d9;
  background: #fff;
}

.home-nav h1 {
  margin: 0;
  color: #333;
  font-size: clamp(22px, 4vw, 28px);
  font-weight: 800;
  line-height: 1.2;
}

.home-content {
  flex: 1;
  padding: clamp(32px, 5vw, 38px) clamp(30px, 5vw, 72px) 0;
  text-align: center;
}

.brand-hero {
  position: relative;
  display: flex;
  width: 100%;
  height: clamp(104px, 25vw, 190px);
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin: 0 auto;
  border: 2px solid #858585;
  background:
    linear-gradient(to top right, transparent calc(50% - 1px), #858585 calc(50% - 1px), #858585 calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(to bottom right, transparent calc(50% - 1px), #858585 calc(50% - 1px), #858585 calc(50% + 1px), transparent calc(50% + 1px)),
    #fff;
}

.brand-hero span {
  position: relative;
  z-index: 1;
  color: #b3b3b3;
  font-size: clamp(34px, 8vw, 64px);
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
}

.event-summary {
  margin-top: clamp(28px, 5vw, 36px);
}

.event-summary h2,
.event-summary p {
  margin: 0;
  color: #333;
  font-size: clamp(24px, 5vw, 36px);
  font-weight: 500;
  line-height: 1.85;
}

.event-summary time {
  display: inline-block;
  margin-top: clamp(20px, 4vw, 30px);
  color: #a8a8a8;
  font-size: clamp(20px, 4vw, 28px);
  font-weight: 600;
  line-height: 1.4;
}

.rules-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  margin-top: clamp(120px, 20vh, 270px);
  margin-top: clamp(120px, 20dvh, 270px);
  color: #08a8ff;
  font-size: clamp(18px, 3.4vw, 26px);
  font-weight: 500;
  text-decoration: none;
}

.rules-link:hover,
.rules-link:focus {
  text-decoration: underline;
}

.home-bottom-actions {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  gap: clamp(20px, 4vw, 36px);
  padding: 0 clamp(30px, 5vw, 72px) calc(30px + env(safe-area-inset-bottom));
}

.home-action-btn {
  display: inline-flex;
  min-height: clamp(64px, 13vw, 102px);
  align-items: center;
  justify-content: center;
  border: 2px solid #858585;
  border-radius: 18px;
  background: #fff;
  color: #333;
  font-size: clamp(18px, 3.4vw, 26px);
  font-weight: 600;
  text-decoration: none;
  transition: background 160ms ease, transform 160ms ease;
}

.home-action-btn:hover,
.home-action-btn:focus {
  background: #f7f7f7;
}

.home-action-btn:active {
  transform: scale(0.99);
}

body.rules-body {
  background: #f6f6f6;
  color: #333;
}

.rules-page-mobile {
  width: 100%;
  max-width: 750px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  border-right: 1px solid #d9d9d9;
  border-left: 1px solid #d9d9d9;
  background: #fff;
}

.rules-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  min-height: 66px;
  align-items: center;
  grid-template-columns: 64px 1fr 64px;
  border-bottom: 1px solid #d9d9d9;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.rules-topbar h1 {
  margin: 0;
  color: #333;
  font-size: clamp(22px, 4vw, 28px);
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
}

.rules-back {
  display: inline-flex;
  width: 52px;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  color: #333;
  font-size: 30px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
}

.rules-content {
  padding: 24px clamp(20px, 5vw, 48px) calc(118px + env(safe-area-inset-bottom));
}

.rules-section {
  padding: 20px 0;
  border-bottom: 1px solid #eeeeee;
}

.rules-section:first-child {
  padding-top: 0;
}

.rules-section:last-child {
  border-bottom: 0;
}

.rules-section h2 {
  margin: 0 0 12px;
  color: #333;
  font-size: clamp(18px, 4vw, 24px);
  font-weight: 800;
  line-height: 1.5;
}

.rules-section ol {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding-left: 1.35em;
}

.rules-section li,
.prize-list p {
  margin: 0;
  color: #444;
  font-size: clamp(15px, 3.4vw, 18px);
  font-weight: 400;
  line-height: 1.85;
  text-align: justify;
}

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

.prize-list strong {
  color: #333;
  font-weight: 800;
}

.rules-fixed-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  padding: 14px clamp(20px, 5vw, 48px) calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid #eeeeee;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.rules-primary-action {
  display: inline-flex;
  width: 100%;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  border: 2px solid #858585;
  border-radius: 16px;
  background: #fff;
  color: #333;
  font-size: 20px;
  font-weight: 700;
  text-decoration: none;
}

.rules-primary-action:active {
  transform: scale(0.99);
}

body.submit-body {
  background: #f6f6f6;
  color: #333;
}

.submit-page-mobile {
  display: flex;
  width: 100%;
  max-width: 750px;
  min-height: 100vh;
  min-height: 100dvh;
  flex-direction: column;
  margin: 0 auto;
  border-right: 1px solid #d9d9d9;
  border-left: 1px solid #d9d9d9;
  background: #fff;
}

.submit-topbar {
  display: grid;
  min-height: 66px;
  align-items: center;
  flex-shrink: 0;
  grid-template-columns: 64px 1fr 64px;
  border-bottom: 1px solid #d9d9d9;
  background: #fff;
}

.submit-topbar h1 {
  margin: 0;
  color: #333;
  font-size: clamp(22px, 4vw, 28px);
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
}

.submit-back {
  display: inline-flex;
  width: 52px;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  color: #4a4a4a;
  font-size: 34px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
}

.submit-form-mobile {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0;
}

.submit-form-content {
  flex: 1;
  padding: clamp(34px, 6vw, 52px) clamp(24px, 7vw, 56px) 18px;
}

.submit-section {
  display: flex;
  flex-direction: column;
  gap: clamp(22px, 4.2vw, 32px);
}

.submit-section + .submit-section {
  margin-top: clamp(48px, 8vw, 70px);
}

.submit-section h2 {
  margin: 0;
  color: #333;
  font-size: clamp(26px, 5.2vw, 36px);
  font-weight: 500;
  line-height: 1.25;
}

.submit-field-row {
  display: grid;
  align-items: center;
  gap: clamp(16px, 3.5vw, 28px);
  grid-template-columns: clamp(116px, 24vw, 150px) minmax(0, 1fr);
  font-size: clamp(17px, 3.5vw, 26px);
  font-weight: 400;
  line-height: 1.2;
}

.submit-field-row span {
  color: #333;
  text-align: right;
  white-space: nowrap;
}

.submit-field-row input {
  width: 100%;
  height: clamp(48px, 9vw, 68px);
  border: 0;
  border-radius: 0;
  padding: 0 clamp(14px, 3vw, 22px);
  background: #f1f1f1;
  color: #333;
  font-size: clamp(17px, 3.5vw, 26px);
  font-weight: 400;
  outline: none;
}

.submit-field-row input::placeholder {
  color: #8f8f8f;
}

.submit-field-row input:focus {
  border-color: transparent;
  box-shadow: inset 0 0 0 2px rgba(8, 168, 255, 0.45);
}

.submit-helper,
.submit-notes {
  display: grid;
  grid-template-columns: clamp(116px, 24vw, 150px) minmax(0, 1fr);
  gap: clamp(16px, 3.5vw, 28px);
  margin: -6px 0 0;
  color: #9b9b9b;
  font-size: clamp(14px, 3vw, 22px);
  font-weight: 600;
  line-height: 1.7;
}

.helper-icon {
  display: inline-flex;
  justify-self: end;
  width: clamp(22px, 4vw, 30px);
  height: clamp(22px, 4vw, 30px);
  align-items: center;
  justify-content: center;
  color: #111;
}

.helper-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.submit-notes {
  align-items: start;
  margin-top: -2px;
}

.submit-notes ol {
  margin: 0;
  padding-left: 0;
  list-style-position: inside;
}

.submit-notes li {
  margin: 0;
  color: #9b9b9b;
  text-align: left;
}

.submit-bottom-actions {
  display: flex;
  justify-content: center;
  flex-shrink: 0;
  padding: 18px clamp(24px, 7vw, 56px) calc(22px + env(safe-area-inset-bottom));
}

.submit-primary-action {
  width: min(326px, 100%);
  min-height: clamp(58px, 10vw, 74px);
  margin-top: 0;
  border: 2px solid #858585;
  border-radius: 16px;
  padding: 0 18px;
  background: #fff;
  color: #333;
  font-size: clamp(18px, 3.6vw, 26px);
  font-weight: 700;
}

.submit-primary-action:disabled {
  opacity: 0.65;
  border-color: #b6b6b6;
  background: #f5f5f5;
  color: #666;
}

.submit-page-mobile .message {
  margin-top: 22px;
}

@media (max-width: 420px) {
  .submit-form-content {
    padding-right: 18px;
    padding-left: 18px;
  }

  .submit-field-row,
  .submit-helper,
  .submit-notes {
    grid-template-columns: 106px minmax(0, 1fr);
    gap: 12px;
  }
}

body.feedback-body {
  background: #f6f6f6;
  color: #333;
}

.feedback-page-mobile {
  display: flex;
  width: 100%;
  max-width: 750px;
  min-height: 100vh;
  min-height: 100dvh;
  flex-direction: column;
  margin: 0 auto;
  border-right: 1px solid #d9d9d9;
  border-left: 1px solid #d9d9d9;
  background: #fff;
}

.feedback-topbar {
  display: grid;
  min-height: 66px;
  align-items: center;
  flex-shrink: 0;
  grid-template-columns: 64px 1fr 64px;
  border-bottom: 1px solid #d9d9d9;
  background: #fff;
}

.feedback-topbar h1 {
  margin: 0;
  color: #333;
  font-size: clamp(22px, 4vw, 28px);
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
}

.feedback-back {
  display: inline-flex;
  width: 52px;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  color: #4a4a4a;
  font-size: 34px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
}

.feedback-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  padding: clamp(260px, 32dvh, 420px) clamp(24px, 7vw, 56px) 0;
  text-align: center;
}

.feedback-success-icon {
  width: clamp(150px, 28vw, 212px);
  height: clamp(150px, 28vw, 212px);
  color: #898b8b;
}

.feedback-success-icon svg {
  width: 100%;
  height: 100%;
}

.feedback-success-icon circle {
  fill: currentColor;
}

.feedback-success-icon path {
  fill: none;
  stroke: #fff;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 13;
}

.feedback-content h2 {
  margin: clamp(74px, 9vw, 86px) 0 0;
  color: #333;
  font-size: clamp(26px, 5.2vw, 36px);
  font-weight: 800;
  line-height: 1.2;
}

.feedback-copy {
  margin-top: clamp(170px, 19dvh, 230px);
  color: #333;
  font-size: clamp(17px, 3.6vw, 26px);
  font-weight: 500;
  line-height: 1.55;
  text-align: left;
}

.feedback-copy p {
  margin: 0;
}

.feedback-time {
  margin: clamp(28px, 4vw, 36px) 0 0;
  color: #a3a3a3;
  font-size: clamp(16px, 3.2vw, 24px);
  font-weight: 600;
  line-height: 1.4;
}

.feedback-bottom-actions {
  display: flex;
  justify-content: center;
  flex-shrink: 0;
  padding: 18px clamp(24px, 7vw, 56px) calc(34px + env(safe-area-inset-bottom));
}

.feedback-rank-btn {
  display: inline-flex;
  width: min(326px, 100%);
  min-height: clamp(58px, 10vw, 74px);
  align-items: center;
  justify-content: center;
  border: 2px solid #858585;
  border-radius: 16px;
  background: #fff;
  color: #333;
  font-size: clamp(18px, 3.6vw, 26px);
  font-weight: 700;
  text-decoration: none;
}

.feedback-rank-btn:active {
  transform: scale(0.99);
}

@media (max-height: 760px) {
  .feedback-content {
    padding-top: 150px;
  }

  .feedback-content h2 {
    margin-top: 48px;
  }

  .feedback-copy {
    margin-top: 90px;
  }
}

.page {
  min-height: 100vh;
  padding: 24px 16px;
}

.card {
  max-width: 560px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 18px;
  padding: 24px 18px;
  box-shadow: 0 12px 40px rgba(84, 104, 255, 0.12);
}

h1 {
  margin: 0 0 10px;
  font-size: 28px;
}

.desc {
  margin: 0 0 22px;
  font-size: 14px;
  line-height: 1.7;
  color: #4b5563;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}

input,
textarea {
  width: 100%;
  border: 1px solid #dbe1f0;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px;
  outline: none;
  background: #fcfdff;
}

input:focus,
textarea:focus {
  border-color: #667cff;
  box-shadow: 0 0 0 3px rgba(102, 124, 255, 0.12);
}


.is-locked,
input[readonly],
textarea[readonly] {
  color: #4b5563;
  background: #f5f7ff;
  cursor: not-allowed;
  -webkit-text-fill-color: #4b5563;
}

button {
  margin-top: 8px;
  border: 0;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(90deg, #4f46e5 0%, #7c3aed 100%);
}

button:disabled {
  opacity: 1;
  cursor: not-allowed;
  background: linear-gradient(90deg, #94a3b8 0%, #64748b 100%);
}

.message {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.6;
}

.message.success {
  background: #ecfdf5;
  color: #047857;
}

.message.error {
  background: #fef2f2;
  color: #b91c1c;
}

.hidden {
  display: none;
}

.tips {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px dashed #dbe1f0;
}

.tips h2 {
  margin: 0 0 8px;
  font-size: 16px;
}

.tips ul {
  padding-left: 18px;
  margin: 0;
  color: #4b5563;
  line-height: 1.8;
  font-size: 14px;
}


.admin-link {
  display: inline-block;
  margin-bottom: 10px;
  color: #4338ca;
  font-weight: 700;
  text-decoration: none;
}

.admin-link:hover {
  text-decoration: underline;
}

.page-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.page-actions-between {
  justify-content: space-between;
  gap: 10px;
}

.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #dbe1f0;
  border-radius: 12px;
  color: #4338ca;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  background: #f8faff;
}

.ghost-link:hover,
.ghost-link:focus {
  border-color: #b9c3ff;
  background: #eef2ff;
}

.submit-card h1,
.rules-card h1 {
  font-size: 28px;
}

.rules-card {
  max-width: 640px;
}

.rules-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 18px 0 0;
  padding-left: 22px;
  color: #374151;
  font-size: 15px;
  line-height: 1.8;
}

.rankings-page {
  padding-top: 32px;
  padding-bottom: 32px;
}

.rankings-card {
  max-width: 900px;
}

.ranking-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.ranking-tabs {
  display: inline-flex;
  gap: 10px;
  flex-wrap: wrap;
}

.ranking-tab,
.secondary-btn {
  margin-top: 0;
  padding: 12px 18px;
  border-radius: 999px;
  cursor: pointer;
}

.ranking-tab {
  color: #4338ca;
  background: #eef2ff;
}

.ranking-tab.active {
  color: #fff;
  background: linear-gradient(90deg, #4f46e5 0%, #7c3aed 100%);
}

.secondary-btn {
  color: #4338ca;
  background: #eef2ff;
}

.ranking-summary {
  margin-bottom: 16px;
  color: #4b5563;
  font-size: 14px;
}

.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ranking-item {
  display: flex;
  gap: 14px;
  align-items: stretch;
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #fcfdff;
}

.ranking-rank {
  display: flex;
  width: 68px;
  min-width: 68px;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 20px;
  font-weight: 800;
}

.rank-top-1 {
  background: linear-gradient(180deg, #f59e0b 0%, #f97316 100%);
  color: #fff;
}

.rank-top-2 {
  background: linear-gradient(180deg, #94a3b8 0%, #64748b 100%);
  color: #fff;
}

.rank-top-3 {
  background: linear-gradient(180deg, #fb7185 0%, #e11d48 100%);
  color: #fff;
}

.ranking-main {
  flex: 1;
  min-width: 0;
}

.ranking-head {
  display: flex;
  gap: 12px;
  align-items: center;
}

.ranking-avatar {
  display: flex;
  width: 52px;
  height: 52px;
  min-width: 52px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 50%;
  background: #e0e7ff;
}

.ranking-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ranking-avatar-fallback {
  color: #4338ca;
  font-weight: 800;
}

.ranking-meta {
  min-width: 0;
}

.ranking-title {
  display: block;
  width: 100%;
  margin-bottom: 6px;
  overflow: hidden;
  color: #111827;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.5;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-title:hover {
  color: #4338ca;
}

.ranking-author,
.ranking-time {
  color: #6b7280;
  font-size: 13px;
  line-height: 1.7;
}

.ranking-metrics {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.metric-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #374151;
  font-size: 13px;
  font-weight: 700;
}

.metric-chip-primary {
  background: #ede9fe;
  color: #5b21b6;
}

.metric-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.metric-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.empty-state {
  padding: 30px 16px;
  border-radius: 16px;
  text-align: center;
  color: #6b7280;
  background: #f8fafc;
}

@media (max-width: 640px) {
  .ranking-item {
    flex-direction: column;
  }

  .ranking-rank {
    width: 100%;
    min-width: 100%;
    min-height: 52px;
  }
}

.ranking-pager {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
}

.pager-btn {
  margin-top: 0;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
}

.pager-btn:disabled {
  cursor: not-allowed;
}

.pager-info {
  color: #4b5563;
  font-size: 14px;
  font-weight: 700;
}
