:root {
  --primary-color: #3b82f6;
  --red-color: #DE363A;
  --bg-outer: #f6eaf1; /* Light pink from screenshot background */
  --bg-inner: #ffffff;
  --bg-gray-light: #f5f5f5;
  --border-color: #e5e7eb;
  --text-main: #333333;
  --text-gray: #6b7280;
  
  --badge-blue: #44a5d3;
  --badge-gray: #c9c9c9;
  
  --icon-green: #7fd756;
  --icon-pink: #f7a8b8;
  --icon-gray-bg: #e2e2e2;
}

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

body {
  font-family: "Roboto", sans-serif !important;
  background-color: var(--bg-outer);
  color: var(--text-main);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.mockup-background {
  width: 100%;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.device-mockup {
  width: 390px;
  height: 844px;
  background-color: var(--bg-inner);
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

/* Screens */
.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-inner);
  display: none;
  flex-direction: column;
  overflow-y: auto;
}
.screen.active {
  display: flex;
  animation: fadeIn 0.3s ease-in-out;
}
.bg-gray-light {
  background-color: #f9f9fa;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Common Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  background-color: white;
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}
.header-icon {
  font-size: 24px;
  color: #555;
}
.header-back {
  font-size: 20px;
  color: #555;
  cursor: pointer;
}
.header-placeholder {
  width: 20px;
}

/* Utils */
.fw-bold { font-weight: 700; }
.fw-500 { font-weight: 500; }
.text-blue { color: var(--primary-color); }
.text-gray { color: var(--text-gray); }
.w-100 { width: 100%; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mr-2 { margin-right: 8px; }
.pb-100 { padding-bottom: 100px; }
.flex-row { display: flex; align-items: center; }
.flex-1 { flex: 1; }
.flex-2 { flex: 2; }
.shadow-sm { box-shadow: 0 2px 4px rgba(0,0,0,0.05); }

/* Buttons */
.btn {
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}
.btn:active {
  transform: scale(0.98);
}
.btn-red {
  background-color: var(--red-color);
  color: white;
}
.btn-blue {
  background-color: var(--primary-color);
  color: white;
}
.btn-outline-blue {
  background-color: white;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}
.btn-outline-gray {
  background-color: white;
  color: var(--text-main);
  border: 1px solid #ccc;
}
.btn-text {
  background: none;
  padding: 8px 0;
  font-size: 14px;
}

/* Badges */
.badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  color: white;
  font-weight: 500;
}
.badge-blue { background-color: var(--badge-blue); }
.badge-gray { background-color: var(--badge-gray); color: #555; }

/* Login Screen Specifics */
.login-container {
  display: flex;
  flex-direction: column;
  padding: 40px;
  flex: 1;
  justify-content: center;
}
.logo {
  display: flex;
  justify-content: center;
  margin-bottom: 40px;
}
.logo-group {
  text-align: center;
}
.logo-circles {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-bottom: 8px;
}
.circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-block;
}
.c-red { background-color: #e52924; }
.c-yellow { background-color: #f7b718; }
.c-black { background-color: #1a1a1a; }
.c-blue { background-color: #009ce1; }
.logo-text-top {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
}
.logo-text-bottom {
  font-size: 12px;
  background-color: #1a1a1a;
  color: white;
  padding: 2px 10px;
  border-radius: 12px;
  display: inline-block;
  margin-top: 4px;
}

#login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.input-group {
  position: relative;
}
.input-group input {
  width: 100%;
  padding: 16px;
  border: 1px solid #999;
  border-radius: 4px;
  font-size: 16px;
  color: #333;
}
.toggle-password {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
  font-size: 18px;
}
.forgot-password {
  text-align: center;
  color: var(--red-color);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  margin-top: 16px;
}

/* Home / Lists */
.section-title {
  background-color: var(--bg-gray-light);
  padding: 20px;
  font-size: 16px;
  font-weight: 500;
}
.list-container {
  display: flex;
  flex-direction: column;
}
.list-item, .game-info {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  background-color: white;
}
.item-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-right: 16px;
  color: white;
  font-size: 20px;
}
.bg-green { background-color: var(--icon-green); }
.bg-pink { background-color: var(--icon-pink); }
.bg-gray { background-color: var(--icon-gray-bg); color: #888; }

.item-title {
  flex: 1;
  font-size: 15px;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 10px;
}

/* Accordion */
.accordion {
  border-bottom: 1px solid var(--border-color);
}
.accordion-header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  background-color: #fafafa;
  cursor: pointer;
}
.accordion-icon {
  margin-right: 12px;
  color: #888;
  transition: transform 0.2s;
}
.accordion-header.open .accordion-icon {
  transform: rotate(90deg);
}
.accordion-title {
  flex: 1;
  font-size: 15px;
}
.accordion-content {
  display: none;
  background-color: white;
}
.accordion-header.open + .accordion-content {
  display: block;
}
.stage-list {
  display: flex;
  flex-direction: column;
}
.stage-item {
  display: flex;
  align-items: center;
  padding: 16px 20px 16px 48px;
  border-top: 1px solid var(--border-color);
}
.stage-name {
  flex: 1;
  font-size: 15px;
}
.add-stage-item {
  cursor: pointer;
  background-color: #f0f7ff;
}
.add-stage-item i {
  margin-right: 10px;
}

/* Forms (New Features) */
.form-container {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.form-group label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}
.required {
  background-color: var(--red-color);
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 4px;
  vertical-align: middle;
}
.hint-text {
  font-size: 12px;
  color: var(--text-gray);
  margin-bottom: 4px;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 15px;
  font-family: inherit;
  background-color: white;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}
.section-divider {
  font-size: 16px;
  font-weight: 700;
  margin-top: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border-color);
}
.empty-state {
  text-align: center;
  padding: 30px 20px;
  color: #999;
  font-size: 14px;
  background-color: white;
  border-radius: 8px;
  border: 1px dashed #ccc;
}
.image-upload-area {
  border: 2px dashed #d1d5db;
  background-color: white;
  border-radius: 8px;
  padding: 30px;
  text-align: center;
  color: var(--text-gray);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.image-upload-area i {
  font-size: 32px;
  color: #9ca3af;
}

/* Choices */
.choice-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.choice-radio {
  width: 20px;
  height: 20px;
  accent-color: var(--primary-color);
}

/* Fixed Bottom Bar */
.fixed-bottom-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 16px 20px;
  background-color: white;
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

/* Problem List Item in Stage Create Screen */
.problem-card {
  background-color: white;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  position: relative;
}
.problem-number {
  font-size: 12px;
  color: var(--text-gray);
  font-weight: 600;
  margin-bottom: 4px;
}
.problem-text {
  font-size: 15px;
  font-weight: 500;
}
.problem-actions {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 12px;
  color: #9ca3af;
}
.problem-actions i {
  cursor: pointer;
}
.problem-actions i:hover {
  color: var(--primary-color);
}

/* User Menu */
.user-menu-container {
  position: relative;
  display: inline-block;
}
.user-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: #e5e7eb;
  color: #4b5563;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 18px;
  cursor: pointer;
}
.user-dropdown {
  position: absolute;
  top: 44px;
  right: 0;
  background-color: white;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border: 1px solid #e5e7eb;
  display: none;
  min-width: 140px;
  z-index: 100;
}
.user-dropdown.show {
  display: block;
}
.user-dropdown-item {
  padding: 12px 16px;
  font-size: 14px;
  cursor: pointer;
  color: #374151;
  text-align: center;
}
.user-dropdown-item:hover {
  background-color: #f3f4f6;
}

/* Green Buttons */
.btn-green {
  background-color: #4CAF50;
  color: white;
}
.btn-green:hover {
  background-color: #45a049;
}
.btn-green-sm {
  background-color: #4CAF50;
  color: white;
  padding: 6px 12px;
  font-size: 14px;
  border-radius: 4px;
}
.btn-green-sm:hover {
  background-color: #45a049;
}

/* Modal Overlay */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 200;
}
.modal-overlay.show {
  display: flex;
}
.modal-content {
  background-color: white;
  width: 90%;
  max-width: 360px;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}
.modal-header {
  padding: 16px 20px;
  border-left: 4px solid #e0e0e0;
  margin: 16px 20px 0;
}
.modal-header h2 {
  font-size: 18px;
  font-weight: 500;
  margin: 0;
}
.modal-body {
  padding: 16px 20px;
}
.modal-desc {
  font-size: 13px;
  color: #555;
  line-height: 1.5;
}
.select-label-wrapper {
  position: relative;
  z-index: 1;
  margin-left: 10px;
}
.select-label-text {
  background-color: white;
  padding: 0 4px;
  font-size: 12px;
  color: #888;
}
.modal-label {
  font-size: 14px;
  font-weight: 500;
  color: #333;
}
.text-red {
  color: #d32f2f;
}
.radio-label {
  display: flex;
  align-items: center;
  font-size: 15px;
  color: #555;
  cursor: pointer;
}
.custom-radio {
  width: 18px;
  height: 18px;
  margin-right: 8px;
  accent-color: #d32f2f;
}
.modal-footer {
  padding: 16px 20px 24px;
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid #f0f0f0;
  background-color: white;
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
}

/* Link Hover Effects */
.game-type-link {
  padding: 4px 8px;
  border-radius: 6px;
  transition: background-color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.game-type-link:hover {
  background-color: #fff0f2;
}

/* Floating Input Label & Validation */
.floating-input-wrapper {
  position: relative;
  margin-top: 8px;
}
.floating-input {
  padding: 12px;
}
.floating-label {
  position: absolute;
  top: -9px;
  left: 10px;
  background-color: white;
  padding: 0 4px;
  font-size: 13px;
  color: #888;
  transition: all 0.2s;
  pointer-events: none;
}
.floating-input:focus {
  border-color: #2da1dc; /* Blue border */
  box-shadow: none;
}
.floating-input:focus ~ .floating-label {
  color: #2da1dc;
}

/* Error state */
.floating-input-wrapper.error .floating-input {
  border-color: #e33235; /* Red border */
}
.floating-input-wrapper.error .floating-label {
  color: #e33235;
}

.input-helpers {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-top: 4px;
  min-height: 18px;
}
.char-count {
  font-size: 12px;
  color: #888;
  margin-left: auto;
}
.error-msg {
  font-size: 12px;
  color: #e33235;
  display: none;
}
.floating-input-wrapper.error + .input-helpers .error-msg {
  display: block;
}

/* Toast Notification */
.toast {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #444444;
  color: white;
  padding: 14px 20px;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 90%;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 300;
}
.toast.show {
  opacity: 1;
  visibility: visible;
  bottom: 32px;
}
#toast-message {
  font-size: 14px;
  flex: 1;
}
#toast-close {
  background: none;
  border: none;
  color: #4CAF50; /* Green from the screenshot */
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-left: 16px;
}


