* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f5f5f5;
  color: #3a3a3a;
  min-height: 100vh;
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: #ffffff;
  border-bottom: 1px solid #e8e8e8;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
nav .logo { font-size: 18px; font-weight: 700; color: #ff6e14; letter-spacing: 1px; }
nav .hackathon-name { font-size: 13px; color: #666; }
nav .juror-badge {
  background: #fff3ed;
  border: 1px solid #ffb38a;
  color: #ff6e14;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
}

main { max-width: 760px; margin: 0 auto; padding: 32px 24px; }

/* Tabs */
.tabs {
  display: flex;
  padding: 0 32px;
  background: #ffffff;
  border-bottom: 1px solid #e8e8e8;
  overflow-x: auto;
}
.tab {
  padding: 14px 20px;
  font-size: 14px;
  color: #666;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  text-decoration: none;
  transition: all .2s;
}
.tab.active { color: #ff6e14; border-bottom-color: #ff6e14; }
.tab.done { color: #22a06b; }

/* Progress */
.progress { display: flex; align-items: center; gap: 8px; margin-bottom: 28px; }
.progress-step {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid #e8e8e8; color: #aaa; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.progress-step.done { background: #ff6e14; border-color: #ff6e14; color: #fff; }
.progress-step.current { border-color: #ff6e14; color: #ff6e14; }
.progress-line { flex: 1; height: 2px; background: #e8e8e8; }
.progress-line.done { background: #ff6e14; }

/* Team header */
.team-header { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.team-emoji { font-size: 32px; }
.team-title h2 { font-size: 22px; font-weight: 700; }
.team-title p { font-size: 13px; color: #666; margin-top: 2px; }

/* Criteria */
.criteria-list { display: flex; flex-direction: column; gap: 20px; margin-bottom: 32px; }
.criterion {
  background: #ffffff; border: 1px solid #e8e8e8;
  border-radius: 12px; padding: 20px 24px; transition: border-color .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.criterion:hover { border-color: #ffb38a; }
.criterion-label { font-size: 15px; font-weight: 600; margin-bottom: 14px; color: #3a3a3a; }
.criterion-label span { font-size: 12px; font-weight: 400; color: #888; margin-left: 8px; }

.score-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.score-btn {
  width: 48px; height: 48px; border-radius: 10px;
  border: 2px solid #e8e8e8; background: #f5f5f5;
  color: #999; font-size: 18px; font-weight: 700;
  cursor: pointer; transition: all .15s;
  display: flex; align-items: center; justify-content: center;
}
.score-btn:hover { border-color: #ff6e14; color: #ff6e14; }
.score-btn.selected { background: #ff6e14; border-color: #ff6e14; color: #fff; }

/* Submit bar */
.submit-bar {
  background: #ffffff; border: 1px solid #e8e8e8;
  border-radius: 12px; padding: 20px 24px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.score-total { font-size: 14px; color: #666; }
.score-total strong { font-size: 28px; color: #ff6e14; font-weight: 700; }
.score-total em { font-size: 14px; color: #aaa; }
.submit-btn {
  background: #ff6e14; color: #fff; border: none;
  padding: 14px 32px; border-radius: 10px; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: background .2s;
}
.submit-btn:hover { background: #e55c00; }
.submit-btn:disabled { background: #ccc; color: #999; cursor: not-allowed; }

/* Results */
.results-title { text-align: center; margin-bottom: 40px; }
.results-title h1 {
  font-size: 36px; font-weight: 800;
  color: #ff6e14;
}
.results-title p { color: #666; margin-top: 8px; }
.team-result {
  background: #ffffff; border: 1px solid #e8e8e8;
  border-radius: 14px; padding: 20px 24px; margin-bottom: 14px;
  display: flex; align-items: center; gap: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.team-result.winner { border-color: #ff6e14; background: #fff8f5; }
.rank { font-size: 24px; font-weight: 800; color: #ccc; width: 32px; text-align: center; }
.team-result.winner .rank { color: #ff6e14; }
.team-result-name { flex: 1; font-size: 16px; font-weight: 600; color: #3a3a3a; }
.score-bar-wrap { flex: 2; }
.score-bar-bg { background: #e8e8e8; border-radius: 6px; height: 10px; overflow: hidden; }
.score-bar-fill { height: 100%; border-radius: 6px; background: #ffb38a; width: 0%; transition: width 1.5s cubic-bezier(.4,0,.2,1); }
.team-result.winner .score-bar-fill { background: #ff6e14; }
.score-value { font-size: 20px; font-weight: 800; color: #ff6e14; width: 60px; text-align: right; }

/* Waiting screen */
.waiting { text-align: center; padding: 80px 24px; }
.waiting h2 { font-size: 24px; color: #666; margin-bottom: 12px; }
.waiting p { color: #aaa; font-size: 14px; }
.waiting .spinner {
  width: 40px; height: 40px; border: 3px solid #e8e8e8;
  border-top-color: #ff6e14; border-radius: 50%;
  animation: spin 1s linear infinite; margin: 32px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Home / identification */
.home-wrap { max-width: 400px; margin: 80px auto; padding: 0 24px; text-align: center; }
.home-wrap h1 { font-size: 28px; font-weight: 800; margin-bottom: 8px; color: #3a3a3a; }
.home-wrap p { color: #666; margin-bottom: 32px; }
.home-wrap input, .home-wrap select {
  width: 100%; background: #ffffff; border: 1px solid #e8e8e8;
  color: #3a3a3a; padding: 14px 18px; border-radius: 10px; font-size: 16px; margin-bottom: 14px;
}
.home-wrap input:focus, .home-wrap select:focus { outline: none; border-color: #ff6e14; }
.home-wrap .submit-btn { width: 100%; }

/* Admin */
.admin-section {
  background: #ffffff; border: 1px solid #e8e8e8;
  border-radius: 12px; padding: 24px; margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.admin-section h3 { font-size: 16px; font-weight: 700; margin-bottom: 18px; color: #ff6e14; }
.field-row { display: flex; gap: 10px; margin-bottom: 10px; align-items: center; }
.field-row input {
  flex: 1; background: #f5f5f5; border: 1px solid #e8e8e8;
  color: #3a3a3a; padding: 10px 14px; border-radius: 8px; font-size: 14px;
}
.field-row input:focus { outline: none; border-color: #ff6e14; }
.field-row input.emoji-input { flex: 0 0 60px; text-align: center; }
.add-btn {
  background: transparent; border: 1px dashed #ffb38a;
  color: #ff6e14; padding: 10px 16px; border-radius: 8px;
  font-size: 13px; cursor: pointer; width: 100%; margin-top: 4px;
}
.remove-btn { background: transparent; border: none; color: #ccc; font-size: 18px; cursor: pointer; padding: 4px 8px; }
.remove-btn:hover { color: #e55c00; }
.save-btn {
  background: #ff6e14; color: #fff; border: none;
  padding: 14px 32px; border-radius: 10px; font-size: 15px; font-weight: 600;
  cursor: pointer; width: 100%;
}
.save-btn:hover { background: #e55c00; }

/* Alert */
.alert {
  padding: 14px 18px; border-radius: 10px; margin-bottom: 20px; font-size: 14px;
}
.alert.success { background: #f0fdf4; border: 1px solid #86efac; color: #166534; }
.alert.error { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }
