:root {
  --occ-text: #0f172a;
  --occ-muted: #64748b;
  --occ-border: #dbe4f0;
  --occ-border-soft: #e8eef5;
  --occ-surface: #ffffff;
  --occ-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
  --occ-shadow-soft: 0 2px 8px rgba(15, 23, 42, 0.04);
}

* { box-sizing: border-box; }

html,
body {
  min-height: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  color: var(--occ-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: linear-gradient(180deg, #f0f6fc 0%, #f8fafc 48%, #eef4fa 100%);
}

.occ-page {
  width: min(1680px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(14px, 1.6vw, 24px) clamp(20px, 2.2vw, 36px) 12px;
  display: flex;
  flex-direction: column;
}

.occ-page::before,
.occ-page::after {
  display: none;
}

/* —— Başlık —— */
.occ-hero {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  margin-bottom: clamp(14px, 1.8vw, 20px);
  padding: 4px 0 0;
  flex-shrink: 0;
}

.occ-hero__text { max-width: 720px; }

.occ-hero h1 {
  margin: 0;
  font-size: clamp(36px, 4.1vw, 58px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: #0f2744;
  font-weight: 800;
}

.occ-hero p {
  margin: 8px 0 0;
  font-size: clamp(14px, 1.25vw, 18px);
  color: var(--occ-muted);
  font-weight: 500;
  line-height: 1.45;
}

/* —— 2 sütun: ayarlar | çarklar —— */
.occ-layout {
  display: grid;
  grid-template-columns: minmax(260px, 30%) minmax(0, 1fr);
  gap: clamp(16px, 1.6vw, 22px);
  align-items: stretch;
  flex: 1;
  min-height: 0;
}

.occ-card {
  background: var(--occ-surface);
  border: 1px solid var(--occ-border);
  border-radius: 16px;
  box-shadow: var(--occ-shadow);
}

.occ-card-title {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px 14px;
  flex-shrink: 0;
}

.occ-card-title h2 {
  margin: 0;
  font-size: clamp(18px, 1.35vw, 22px);
  line-height: 1.2;
  color: #0f2744;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.occ-title-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 17px;
  flex-shrink: 0;
}

.occ-title-icon--blue { background: #2563eb; }
.occ-title-icon--green { background: #16a34a; }
.occ-title-icon--red { background: #dc2626; }

/* —— Sol: Oyun Ayarları —— */
.occ-settings {
  padding-bottom: 16px;
  align-self: start;
}

.occ-select-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 14px;
  align-items: center;
  margin: 0 14px 10px;
  padding: 14px 16px;
  border: 1px solid var(--occ-border-soft);
  border-radius: 12px;
  background: #fafbfd;
  box-shadow: var(--occ-shadow-soft);
}

.occ-select-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}

.occ-select-card__icon--blue { background: #3b82f6; }
.occ-select-card__icon--purple { background: #7c6dd8; }
.occ-select-card__icon--orange { background: #ea9a2a; }
.occ-select-card__icon--teal { background: #14b8a6; }

.occ-quiz-filter-hint {
  margin: 0 14px 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-size: 14px;
  line-height: 1.35;
}

.occ-start-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.occ-lesson-select-wrap.is-locked .occ-select-card__content select:disabled {
  cursor: not-allowed;
  background: #f1f5f9;
  color: #334155;
  opacity: 1;
}

.occ-select-card__content label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
}

#oe-tp-app .occ-select-card__content .oe-select-wrap {
  width: 100%;
  min-width: 0;
}

.occ-select-card__content .oe-select-wrap select,
.occ-select-card__content select {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--occ-border);
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  font-size: 15px;
  font-weight: 500;
  outline: none;
}

.occ-select-card__content .oe-select-wrap select:focus,
.occ-select-card__content select:focus {
  border-color: #93b4e8;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.occ-info-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 4px 14px 0;
  padding: 10px 14px;
  border: 1px solid var(--occ-border-soft);
  border-radius: 10px;
  background: #f8fafc;
  color: #475569;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}

.occ-student-setup-hint {
  display: none;
  align-items: flex-start;
  gap: 10px;
  margin: 4px 14px 0;
  padding: 10px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #eff6ff;
  color: #1e40af;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}

body.occ-student-mode .occ-student-setup-hint:not([hidden]) {
  display: flex;
}

body.occ-student-mode .occ-setup-teacher-only {
  display: none !important;
}

.occ-info-note span {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  border: 1.5px solid #94a3b8;
  color: #64748b;
  font-style: normal;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}

/* —— Sağ: Ödül + Ceza yan yana —— */
.occ-wheels-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(14px, 1.4vw, 20px);
  align-items: stretch;
  min-width: 0;
}

.occ-wheel-editor {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding-bottom: 14px;
  overflow: visible;
}

.occ-wheel-editor--reward { border-top: 3px solid #22c55e; }
.occ-wheel-editor--penalty { border-top: 3px solid #ef4444; }

.occ-editor-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 16px 16px;
  min-height: 0;
}

.occ-edit-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex: 1;
}

.occ-edit-hint {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.45;
  color: #64748b;
  font-weight: 500;
}

.occ-edit-hint__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25em;
  height: 1.25em;
  border-radius: 4px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
}

.occ-edit-field {
  display: flex;
  align-items: stretch;
  min-width: 0;
  position: relative;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.occ-edit-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: stretch;
  min-height: 50px;
  border: 1px solid var(--occ-border);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--occ-shadow-soft);
  overflow: visible;
  position: relative;
}

.occ-edit-item.is-panel-open {
  z-index: 50;
}

.occ-drag {
  color: #cbd5e1;
  font-weight: 700;
  text-align: center;
  letter-spacing: -3px;
  font-size: 12px;
  user-select: none;
}

.occ-edit-item input,
.occ-edit-item .occ-wheel-input {
  flex: 1;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  height: auto;
  padding: 10px 10px 10px 4px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #0f172a;
  font-size: clamp(14px, 1.35vw, 17px);
  font-weight: 600;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.occ-edit-item .occ-wheel-input:focus {
  background-color: #f8fbff;
}

.occ-preset-toggle {
  flex-shrink: 0;
  width: 44px;
  min-height: 48px;
  border: 0;
  border-left: 1px solid var(--occ-border-soft);
  background: #f8fafc;
  color: #64748b;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease;
}

.occ-preset-toggle:hover,
.occ-preset-toggle[aria-expanded="true"] {
  background: #eef2ff;
  color: #334155;
}

.occ-preset-toggle span {
  display: block;
  transform: scaleY(0.85);
}

.occ-preset-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 60;
  min-width: min(100%, 320px);
}

.occ-preset-panel[hidden] {
  display: none !important;
}

.occ-preset-panel.is-flip {
  top: auto;
  bottom: calc(100% + 4px);
}

.occ-preset-panel__inner {
  border: 1px solid var(--occ-border);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.14);
  overflow: hidden;
}

.occ-preset-search-label {
  display: block;
  padding: 8px 10px;
  border-bottom: 1px solid var(--occ-border-soft);
  background: #f8fafc;
}

.occ-preset-search {
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--occ-border);
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  font-size: 14px;
  font-weight: 500;
  outline: 0;
}

.occ-preset-search:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.occ-preset-panel__body {
  max-height: min(280px, 42vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 0 8px;
}

.occ-preset-group {
  padding: 0 8px 6px;
}

.occ-preset-group[hidden] {
  display: none;
}

.occ-preset-group__title {
  margin: 8px 6px 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.occ-wheel-editor--reward .occ-preset-group__title {
  color: #15803d;
}

.occ-wheel-editor--penalty .occ-preset-group__title {
  color: #b91c1c;
}

.occ-preset-group__items {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.occ-preset-option {
  display: block;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #0f172a;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.occ-preset-option:hover,
.occ-preset-option:focus-visible {
  background: #f1f5f9;
  border-color: #e2e8f0;
  outline: 0;
}

.occ-preset-option[hidden] {
  display: none;
}

.occ-preset-empty {
  margin: 0;
  padding: 10px 12px 12px;
  font-size: 13px;
  color: #64748b;
  text-align: center;
}

.occ-preset-empty[hidden] {
  display: none;
}

/* —— Alt butonlar —— */
.occ-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: clamp(12px, 1.4vw, 16px);
  padding-bottom: 4px;
  flex-shrink: 0;
}

.occ-actions button {
  min-height: 52px;
  border-radius: 12px;
  font-size: clamp(16px, 1.2vw, 18px);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.occ-actions button:hover { transform: translateY(-1px); }

.occ-start-btn {
  min-width: min(320px, 100%);
  padding: 0 32px;
  border: 0;
  background: linear-gradient(180deg, #22c55e, #16a34a);
  color: #fff;
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.25);
}

.occ-start-btn span {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-right: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  color: #16a34a;
  font-size: 12px;
}

.occ-reset-btn {
  min-width: min(240px, 100%);
  padding: 0 24px;
  border: 1px solid var(--occ-border);
  background: #fff;
  color: #334155;
  box-shadow: var(--occ-shadow-soft);
}

.occ-reset-btn span {
  font-size: 18px;
  margin-right: 8px;
  vertical-align: middle;
}

/* —— Mobil / tablet —— */
@media (max-width: 1024px) {
  .occ-layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .occ-settings {
    align-self: stretch;
  }

  .occ-wheels-panel {
    grid-template-columns: 1fr;
  }
}

/* —— Ekran geçişleri (kurulum / soru / çark) —— */
.occ-screen {
  display: none !important;
}

.occ-screen.is-active {
  display: block !important;
}

#occ-screen-setup.is-active .occ-page {
  display: flex;
}

@media (max-width: 768px) {
  .occ-page {
    width: 100%;
    max-width: 100%;
    padding: 12px 12px 10px;
  }

  .occ-hero {
    margin-bottom: 12px;
  }

  .occ-hero h1 {
    font-size: clamp(26px, 7vw, 32px);
  }

  .occ-hero p {
    font-size: 15px;
    line-height: 1.4;
  }

  .occ-layout,
  .occ-wheels-panel,
  .occ-settings,
  .occ-wheel-editor,
  .occ-card {
    min-width: 0;
    max-width: 100%;
  }

  .occ-card-title {
    padding: 14px 16px 12px;
  }

  .occ-card-title h2 {
    font-size: 18px;
  }

  .occ-select-card {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 12px;
    margin: 0 12px 10px;
    padding: 12px 14px;
    max-width: 100%;
  }

  .occ-select-card__content {
    min-width: 0;
  }

  .occ-select-card__content label {
    font-size: 14px;
  }

  .occ-select-card__content select {
    width: 100%;
    max-width: 100%;
    min-height: 48px;
    height: auto;
    padding: 10px 12px;
    font-size: 16px;
    border-radius: 12px;
  }

  .occ-info-note {
    margin: 4px 12px 0;
    font-size: 14px;
  }

  .occ-quiz-filter-hint {
    margin: 0 12px 12px;
    font-size: 14px;
  }

  .occ-editor-body {
    padding: 0 12px 14px;
  }

  .occ-edit-item {
    min-height: 48px;
  }

  .occ-edit-item input,
  .occ-edit-item .occ-wheel-input {
    min-height: 48px;
    padding: 10px 8px 10px 4px;
    font-size: 16px;
  }

  .occ-preset-toggle {
    min-height: 48px;
    width: 48px;
  }

  .occ-edit-hint {
    font-size: 13px;
  }

  .occ-preset-panel {
    left: 0;
    right: 0;
    min-width: 0;
    max-width: 100%;
  }

  .occ-preset-panel__body {
    max-height: min(240px, 42vh);
  }

  .occ-preset-search {
    min-height: 44px;
    font-size: 16px;
  }

  .occ-preset-option {
    font-size: 14px;
    padding: 10px;
  }

  .occ-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-top: 12px;
    padding: 0 4px 8px;
  }

  .occ-actions button {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    font-size: 16px;
  }

  .occ-finish-screen {
    padding: 16px;
  }

  .occ-finish-card {
    width: 100%;
    max-width: calc(100vw - 24px);
    padding: 28px 20px;
  }

  .occ-finish-card h2 {
    font-size: 28px;
  }

  .occ-finish-card p {
    font-size: 16px;
  }

  .occ-finish-btn {
    width: 100%;
    max-width: 100%;
    min-height: 48px;
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .occ-page {
    padding: 10px 10px 8px;
  }

  .occ-hero h1 {
    font-size: 24px;
  }

  .occ-hero p {
    font-size: 14px;
  }

  .occ-select-card {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .occ-select-card__icon {
    width: 40px;
    height: 40px;
  }

  .occ-card-title {
    padding: 12px 14px 10px;
    gap: 10px;
  }

  .occ-title-icon {
    width: 34px;
    height: 34px;
    font-size: 15px;
  }

  .occ-wheels-panel {
    gap: 12px;
  }
}

/* —— Oyun modu: tam ekran ve kontroller —— */
body.occ-play-mode {
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.occ-game-root {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  background: #eef5fb;
}

body.occ-play-mode .occ-game-root {
  width: 100vw;
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
}

.occ-game-root:fullscreen,
.occ-game-root:-webkit-full-screen {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #eef5fb;
}

body.occ-play-mode .occ-game-root .occ-screen.is-active {
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

body.occ-play-mode {
  overflow: hidden;
}


.occ-finish-screen {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background: linear-gradient(180deg, #edf4fc 0%, #e9f1fb 100%);
}

.occ-finish-card {
  width: min(100%, 520px);
  padding: 36px 32px;
  border-radius: 24px;
  background: #fff;
  border: 1px solid var(--occ-border);
  box-shadow: var(--occ-shadow-soft);
  text-align: center;
}

.occ-finish-card h2 {
  margin: 0 0 12px;
  font-size: clamp(28px, 4vw, 40px);
  color: #102a57;
}

.occ-finish-card p {
  margin: 0 0 24px;
  color: #5a739a;
  font-size: 18px;
  line-height: 1.4;
}

.occ-finish-btn {
  min-width: 180px;
  height: 48px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #2d6dda, #1d4fa9);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
}

.occq-info.is-timeout {
  color: #b45309;
}

/* Soru ekranı mobil: tam genişlik (question-screen.css ile birlikte) */
@media (max-width: 768px) {
  body.occ-play-mode {
    margin: 0;
    overflow-x: hidden;
  }

  body.occ-play-mode #oe-tp-app,
  body.occ-play-mode #occ-game-root,
  body.occ-play-mode #occ-game-root .occ-screen.is-active,
  body.occ-play-mode #occ-screen-question.occq-screen {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  body.occ-play-mode #oe-tp-app,
  body.occ-play-mode #occ-game-root {
    padding-left: 0;
    padding-right: 0;
  }

  body.occ-play-mode #occ-screen-question.occq-screen {
    width: min(100%, 430px);
    max-width: calc(100vw - 16px);
    padding-left: 8px;
    padding-right: 8px;
  }

  body.occ-play-mode #occ-screen-question .occq-topbar,
  body.occ-play-mode #occ-screen-question .occq-question-card,
  body.occ-play-mode #occ-screen-question .occq-options,
  body.occ-play-mode #occ-screen-question .occq-option {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  body.occ-play-mode #occ-screen-question .occq-time {
    min-width: 0 !important;
  }

  /* .occ-screen.is-active display:block flex düzenini bozmasın */
  body.occ-play-mode #occ-screen-question.occq-screen.is-active {
    display: flex !important;
    flex-direction: column;
    justify-content: flex-start;
  }

  body.occ-play-mode #occ-screen-question .occq-unified-layout,
  body.occ-play-mode #occ-screen-question .occq-unified,
  body.occ-play-mode #occ-screen-question .occq-question-card,
  body.occ-play-mode #occ-screen-question .occq-options {
    overflow: hidden !important;
    overflow-y: hidden !important;
  }

  body.occ-play-mode #occ-screen-question .occq-unified-layout {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: none !important;
  }

  body.occ-play-mode #occ-screen-question .occq-unified {
    flex: 1 1 auto !important;
    min-height: 0 !important;
  }

  body.occ-play-mode #occ-screen-question .occq-question-body,
  body.occ-play-mode #occ-screen-question .occq-options {
    flex: 0 0 auto !important;
    height: auto !important;
    max-height: none !important;
  }

  body.occ-play-mode #occ-screen-question .occq-question-text {
    flex: 0 1 auto !important;
  }

  body.occ-play-mode #occ-screen-question .occq-footer,
  body.occ-play-mode #occ-screen-question .occq-bottom-status {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }
}

