@import url('./fonts.css?v=20260909a');

/* The surrounding interface shares PyTeach's palette and tactile controls.
   Task documents and the games inside their iframes are not styled here. */
:root {
  --ink: #3c3c3c;
  --muted: #6b6b6b;
  --green: #2f6b02;
  --brand: #58cc02;
  --brand-deep: #46a302;
  --brand-soft: #e8f9d5;
  --line: #e5e5e5;
  --paper: #fff;
  --surface: #f7f7f7;
  --sun-soft: #fff6cd;
}
body { margin: 0; background: var(--paper); color: var(--ink); font-size: 15px; line-height: 1.9; }
#divHeader, #mainContent, .practice-card, .exercise-progress, #divImagesLoading,
#pyteach-account, .task_icons .icon, .pyteach-login-nav, .pyteach-login-card,
.pyteach-login-button, .headerAutoHeight, .headerAutoHeight_table,
#legacy-auth-recovery, #legacy-answer-size-error, #chapter-access-notice { box-sizing: border-box; }
#divHeader { max-width: 1120px; margin: 0 auto; padding: 32px 24px 22px; border: 0; }
#leftTitle, #rightTitle, #mainNav, #publicContestExplanation { display: none !important; }
#headerGroup { margin: 0; padding: 0; text-align: center; text-transform: none; }
.bebras-hero-badge { display: grid; place-items: center; width: 84px; height: 84px; margin: 0 auto 16px; border: 2px solid #cfedb7; border-radius: 26px; background: var(--brand-soft); box-shadow: 0 5px 0 #d6edc3; font-size: 49px; line-height: 1; transform: rotate(-5deg); }
#headerH1 { margin: 0; padding: 4px 0; color: var(--ink); font-size: clamp(30px,4vw,44px); line-height: 1.7; font-weight: 850; }
#headerH2 { display: inline-block; margin: 10px 0 16px; padding: 5px 18px; border-radius: 99px; background: var(--brand-soft); color: var(--green); font-size: 14px; line-height: 1.9; font-weight: 700; letter-spacing: 0; }
#login_link_to_home { max-width: 640px; margin: 0 auto; color: var(--muted); font-size: 14px; line-height: 2.1; }
#mainContent { max-width: 1120px; margin: 0 auto !important; padding: 22px 24px 48px; direction: rtl; }
body:has(#divQuestions:not([style*="display:none"]):not([style*="display: none"])) #mainContent { padding-block: 0; }
#divCheckGroup, #contentPublicGroups { width: 100% !important; max-width: none; margin: 0; padding: 0; }
.tabContent { float: none; width: 100%; max-width: 100%; margin: 0 !important; padding: 0; }
.tabTitle { margin: 0 0 7px; padding: 0; background: none; border: 0; color: var(--ink); font-size: 23px; font-weight: 800; }
#contentPublicGroups > p { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.practice-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; margin: 24px 0; }
.practice-card { display: flex; align-items: center; gap: 18px; min-height: 128px; padding: 22px; border: 2px solid var(--line); border-radius: 22px; background: white; color: var(--ink); text-decoration: none; box-shadow: 0 4px 0 var(--line); transition: transform .16s, border-color .16s, box-shadow .16s; }
.practice-card:hover { transform: translateY(-3px); border-color: #9bda6c; color: var(--green); box-shadow: 0 7px 0 #d8eec7; }
.practice-card:active { transform: translateY(3px); box-shadow: 0 1px 0 #d8eec7; }
.practice-number { display: grid; place-items: center; flex-shrink: 0; width: 60px; height: 66px; border-radius: 18px; background: var(--brand-soft); color: var(--green); font-size: 25px; font-weight: 850; }
.practice-card:nth-child(3n+2) .practice-number { background: #e6f6ff; color: #0f7cb8; }
.practice-card:nth-child(3n) .practice-number { background: #f1e7ff; color: #7240ac; }
.practice-card-copy { display: flex; flex-direction: column; gap: 5px; min-width: 0; overflow-wrap: anywhere; }
.practice-card-copy strong { font-size: 19px; font-weight: 800; }
.practice-card-copy > span { color: var(--muted); font-size: 12px; font-weight: 450; }
.practice-arrow { display: grid; place-items: center; flex-shrink: 0; width: 32px; height: 32px; margin: 0; margin-inline-start: auto; border-radius: 50%; background: var(--surface); color: var(--green); font-size: 21px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #0f7cb8; outline-offset: 4px; }
input, select, textarea { box-sizing: border-box; padding: 11px 14px; border: 2px solid var(--line); border-radius: 13px; background: var(--surface); color: var(--ink); }
button, .btn { border-radius: 13px; cursor: pointer; }
#mainContent button { padding: 11px 22px; border: 2px solid var(--brand-deep); background: var(--brand); box-shadow: 0 3px 0 var(--brand-deep); color: #173b05; font-weight: 800; }
#mainContent button:disabled { opacity: .45; cursor: not-allowed; }
#tab-school, #tab-continue { max-width: 760px; padding: 28px; border: 2px solid var(--line); border-radius: 22px; background: white; }

/* Account controls keep the existing login, switch and disconnect actions. */
#pyteach-account { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; max-width: 1072px; margin: 16px auto 0; padding: 14px 18px; border: 2px solid var(--line); border-radius: 18px; background: white; color: var(--ink); font-size: 12px; line-height: 1.9; }
#pyteach-account > * { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
#pyteach-account > span:first-child { margin-inline-end: auto; }
#pyteach-account strong { display: inline-block; box-sizing: border-box; max-width: 100%; padding-inline: 6px; color: var(--green); overflow-wrap: anywhere; }
#pyteach-account form { display: inline; margin: 0; }
#pyteach-account a, #pyteach-account button { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; max-width: 100%; min-height: 44px; padding: 5px 12px; border: 2px solid var(--line); border-radius: 12px; background: white; color: var(--ink); text-decoration: none; font: inherit; font-weight: 700; box-shadow: 0 2px 0 var(--line); white-space: normal; text-align: center; }
#pyteach-account a:hover, #pyteach-account button:hover { border-color: #b9dca0; background: var(--brand-soft); color: var(--green); }
#pyteach-account a[href='/pyteach-login.php'] { border-color: var(--brand-deep); background: var(--brand); color: #173b05; box-shadow: 0 2px 0 var(--brand-deep); }
#pyteach-account #pyteach-sync { flex-basis: 100%; padding-top: 8px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
#pyteach-account #pyteach-sync:empty { display: none; }
#pyteach-account .pyteach-sync-details { flex-basis: 100%; border-top: 1px solid var(--line); padding-top: 8px; }
#pyteach-account .pyteach-sync-details summary { box-sizing: border-box; width: fit-content; max-width: 100%; min-height: 44px; padding-block: 10px; color: var(--muted); cursor: pointer; font-size: 12px; }
#pyteach-account .pyteach-sync-details summary:focus-visible { outline: 3px solid #0f7cb8; outline-offset: 3px; border-radius: 4px; }
#pyteach-account .pyteach-sync-details #pyteach-sync { display: block; border-top: 0; padding-top: 8px; line-height: 2; }
.pyteach-login-title, #headerH1, .practice-card-copy strong { text-wrap: balance; }
#legacy-answer-size-error { padding: 12px 16px; border: 2px solid #edcf73; border-radius: 14px; background: var(--sun-soft); color: #755000; }
#legacy-auth-recovery, #legacy-answer-size-error, #chapter-access-notice { overflow-wrap: anywhere; }
#legacy-auth-recovery { border-radius: 14px; }
#legacy-auth-recovery > p { margin-top: 0; }
#legacy-auth-recovery a, #legacy-auth-recovery button { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; max-width: 100%; min-height: 44px; margin-block: 4px; padding: 8px 12px; font: inherit; line-height: 1.9; white-space: normal; text-align: center; }
#browserAlert { box-sizing: border-box; width: 100%; max-width: 500px; overflow-wrap: anywhere; }
#warningPublicGroups { box-sizing: border-box; max-width: calc(100% - 20px); overflow-wrap: anywhere; }
#divError { box-sizing: border-box; position: fixed; inset: 16px 16px auto; width: auto; max-width: 800px; height: auto; max-height: calc(100vh - 32px); margin-inline: auto; padding: 16px; overflow: auto; overflow-wrap: anywhere; }
#divError a { display: inline-flex; align-items: center; min-height: 44px; }
#contentError pre { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Loading uses the real image counts and existing width updates. */
body.practice-loading #divHeader { max-width: 720px; padding: 28px 24px 12px; }
body.practice-loading #headerH1 { font-size: clamp(28px,4vw,38px); }
body.practice-loading #headerH2 { margin-bottom: 0; }
body.practice-loading #login_link_to_home, body.practice-loading #mainContent { display: none !important; }
body.practice-loading .bebras-hero-badge { width: 64px; height: 64px; margin-bottom: 10px; border-radius: 20px; font-size: 38px; }
#divImagesLoading, body.practice-loading #divImagesLoading { position: relative; inset: auto; float: none; transform: none; width: calc(100% - 32px); max-width: 520px; margin: 20px auto 48px; padding: 32px; border: 2px solid var(--line); border-radius: 24px; background: white; box-shadow: 0 5px 0 var(--line); text-align: center; }
.loading-symbol { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 18px; border-radius: 17px; background: var(--brand-soft); color: var(--green); font-size: 28px; }
.loading-title { margin: 0 0 8px; color: var(--ink); font-size: 21px; line-height: 1.9; font-weight: 800; }
.loading-description { margin: 0 0 26px; color: var(--muted); font-size: 13px; line-height: 2; }
.loading-progress { height: 14px; border-radius: 99px; background: var(--line); overflow: hidden; direction: rtl; }
#practiceProgressFill { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--brand); box-shadow: inset 0 -3px 0 #46a30255; transition: width .25s ease; }
.loading-details { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-top: 13px; color: var(--muted); font-size: 12px; }
.loading-details > span { min-width: 0; overflow-wrap: anywhere; }
#practiceProgressPercent { color: var(--green); font-size: 14px; font-weight: 800; }

/* The exercise shell. No rules reach into challenge documents. */
.headerAutoHeight { padding: 16px 24px 4px; background: white; }
.headerAutoHeight_table { width: 100%; max-width: 1120px; height: auto; margin: 0 auto; border-collapse: separate; border-spacing: 10px 0; table-layout: auto; }
.headerAutoHeight_table td { padding: 7px 0; vertical-align: middle; line-height: 1.9; }
.headerAutoHeight_title { width: auto; }
.headerAutoHeight_title .questionTitle, .headerAutoHeight_title .questionTitle.contestTitle { display: inline-block; box-sizing: border-box; max-width: 100%; margin: 0; padding: 7px 5px; color: var(--ink); font-size: clamp(21px,2.3vw,29px); line-height: 1.9; font-weight: 850; white-space: normal; overflow-wrap: anywhere; overflow: visible; text-overflow: clip; }
.headerAutoHeight_title #questionStars { margin: 0 10px; vertical-align: middle; }
.headerAutoHeight_button > button { box-sizing: border-box; max-width: 100%; min-height: 44px; margin: 0; padding: 8px 14px; border: 2px solid var(--line); border-radius: 13px; background: white; color: var(--ink); box-shadow: 0 3px 0 var(--line); font-size: 13px; font-weight: 750; line-height: 1.9; white-space: normal; transition: background .15s, transform .15s; }
.headerAutoHeight_button > button:hover { border-color: #b9dca0; background: var(--brand-soft); color: var(--green); }
.headerAutoHeight_button > button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.headerAutoHeight_button > button:disabled { background: var(--surface); color: var(--muted); opacity: .45; cursor: not-allowed; }
.headerAutoHeight_score { padding-inline: 10px !important; white-space: nowrap; color: #8a5a00; font-size: 15px !important; }
.headerAutoHeight_score > b { display: inline-block; padding: 6px 14px; border-radius: 12px; background: var(--sun-soft); }
.headerAutoHeight_logo .header_logo_img { max-height: 48px; }
.headerAutoHeight_time:has(.minutes:empty):has(.seconds:empty) { display: none; }
.header_sep_top, .header_sep_bottom { height: 0 !important; border: 0 !important; background: none !important; }
.exercise-progress { max-width: 1072px; width: calc(100% - 48px); margin: 10px auto 26px; padding: 14px 18px; border: 2px solid var(--line); border-radius: 18px; background: white; }
.exercise-progress-label { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-bottom: 10px; color: var(--muted); font-size: 12px; font-weight: 650; }
#exerciseProgress { height: 11px; border-radius: 99px; background: var(--line); overflow: hidden; direction: rtl; }
#exerciseProgressFill { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--brand); box-shadow: inset 0 -3px 0 #46a30255; transition: width .3s; }
#exerciseProgressText { color: var(--green); font-weight: 850; }
.layout_table_wrapper { box-sizing: border-box; min-width: 0; max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.questionListIntro { margin: 12px auto 22px; color: var(--muted); font-size: 14px; text-align: center !important; }
.questionList.task_icons { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 20px; padding: 0 0 30px; }
.task_icons .icon { display: flex; flex-direction: column; justify-content: space-between; min-width: 0; width: auto; height: auto; min-height: 234px; margin: 0; padding: 20px 14px 17px; border: 2px solid var(--line); border-radius: 22px; background: white; box-shadow: 0 4px 0 var(--line); transition: transform .16s, border-color .16s, box-shadow .16s; }
.task_icons .icon:hover { transform: translateY(-3px); border-color: #9bda6c; box-shadow: 0 7px 0 #d8eec7; }
.task_icons .icon_title, .task_icons .icon_title a { min-height: 34px; margin: 0 0 14px; color: var(--ink) !important; font-size: 16px; font-weight: 800; line-height: 1.9; overflow-wrap: anywhere; }
.task_icons .icon_img { margin: auto 0; }
.task_icons .icon_img table { width: 100%; table-layout: fixed; }
.task_icons .icon_img_td { width: auto; height: 108px; }
.task_icons .icon_img img { max-width: min(145px,100%); max-height: 100px; object-fit: contain; }
.task_icons .icon_stars { margin: 17px 0 0; }
#question-iframe-container, #divQuestions { background: white; color: var(--ink); }
/* Keep the game's logical width; contain wide tasks in a keyboard-scrollable region. */
#question-iframe-container.newInterfaceIframeContainer { max-width: 100%; overflow-x: auto; direction: ltr; }
#question-iframe-container.newInterfaceIframeContainer > #question-iframe { display: block; margin-inline: auto; }
#question-iframe-container:focus-visible { outline: 3px solid #0f7cb8; outline-offset: -3px; }
.question-pan-hint { display: none; box-sizing: border-box; position: sticky; left: 0; width: 100%; min-height: 44px; margin: 0; padding: 10px 16px; background: var(--surface); color: var(--muted); direction: rtl; font-size: 12px; line-height: 2; }
#divFooter { padding: 24px; }
#buttonCloseNew { padding: 10px 22px; border: 2px solid var(--line); border-radius: 14px; background: white; color: var(--ink); box-shadow: 0 3px 0 var(--line); font-size: 13px; font-weight: 700; }

/* A welcoming, dedicated sign-in page for the shared PyTeach account. */
.pyteach-login-page { min-height: 100vh; background: linear-gradient(180deg,#fff 60%,#f5fbea); }
.pyteach-login-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; max-width: 1072px; margin: auto; padding: 16px 24px; border-bottom: 2px solid var(--line); }
.pyteach-login-nav > a { display: inline-flex; align-items: center; min-height: 44px; max-width: 100%; }
.pyteach-login-brand { color: var(--ink); font-size: 20px; font-weight: 850; text-decoration: none; white-space: nowrap; }
.pyteach-login-brand span { color: var(--brand-deep); }
.pyteach-login-nav > a:last-child { color: var(--muted); font-size: 12px; text-decoration: none; }
.pyteach-login-shell { box-sizing: border-box; max-width: 680px; margin: 54px auto; padding: 0 24px 40px; text-align: center; }
.pyteach-login-card { padding: 38px 38px 32px; border: 2px solid var(--line); border-radius: 28px; background: white; box-shadow: 0 6px 0 var(--line); }
.pyteach-login-card .bebras-hero-badge { width: 106px; height: 106px; margin-bottom: 28px; border-radius: 32px; font-size: 66px; }
.pyteach-login-eyebrow { margin: 0 0 12px; color: var(--green); font-size: 13px; font-weight: 800; }
.pyteach-login-title { margin: 0; color: var(--ink); font-size: clamp(22px,3vw,29px); font-weight: 850; line-height: 1.95; }
.pyteach-login-description { margin: 18px auto 28px; max-width: 430px; color: var(--muted); font-size: 14px; line-height: 2.1; }
.pyteach-login-actions { display: grid; gap: 14px; }
.pyteach-login-button { display: flex; align-items: center; justify-content: center; min-height: 56px; padding: 5px 20px; border: 2px solid var(--brand-deep); border-radius: 16px; background: var(--brand); color: #173b05; box-shadow: 0 4px 0 var(--brand-deep); font-size: 16px; font-weight: 800; text-decoration: none; transition: background .16s, transform .16s; }
.pyteach-login-button:hover { background: #66da11; }
.pyteach-login-button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--brand-deep); }
.pyteach-login-footnote { margin: 20px 0 0; color: var(--muted); font-size: 11px; line-height: 2; }
.pyteach-login-features { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; margin: 28px 0 0; color: var(--muted); font-size: 12px; }
.pyteach-login-features span { display: inline-flex; align-items: center; gap: 6px; }

@media (max-width: 1120px) { #pyteach-account { margin-inline: 24px; } }
@media (max-width: 800px) {
  .questionList.task_icons { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .headerAutoHeight { padding: 12px 8px 4px; }
  .headerAutoHeight_table, .headerAutoHeight_table tbody { display: block; }
  .headerAutoHeight_table { border-spacing: 0; }
  .headerAutoHeight_table tr { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 5px; }
  .headerAutoHeight_table td { box-sizing: border-box; min-width: 0; max-width: 100%; }
  .headerAutoHeight_title { flex: 1 1 180px; }
  .headerAutoHeight_score { display: table-cell !important; width: auto; }
  .headerAutoHeight_button { width: auto; }
  .headerAutoHeight_logo { width: 60px; }
  .headerAutoHeight .connection-error { box-sizing: border-box; padding: 8px; font-size: 16px; line-height: 1.9; overflow: auto; }
  .headerAutoHeight .connection-error-close { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; margin: 0; }
  .exercise-progress { width: calc(100% - 32px); margin-bottom: 20px; }
  .layout_table_wrapper { padding: 0 16px; }
}
@media (max-width: 680px) {
  .pyteach-login-shell { margin-top: 32px; padding-inline: 16px; }
  .pyteach-login-card { padding: 28px 22px; border-radius: 24px; }
  .pyteach-login-nav { padding-inline: 20px; }
  .pyteach-login-features { gap: 12px; font-size: 11px; }
  #divHeader { padding: 28px 20px 14px; }
  #headerH1 { font-size: 31px; }
  #headerH2 { font-size: 12px; }
  #login_link_to_home { font-size: 13px; }
  #mainContent { padding: 22px 16px 36px; }
  #pyteach-account { margin: 12px 16px 0; padding: 12px; gap: 8px; }
  #pyteach-account > span:first-child { flex-basis: 100%; }
  #pyteach-account a, #pyteach-account button { padding: 5px 9px; font-size: 12px; }
  .practice-grid { grid-template-columns: 1fr; gap: 16px; margin-top: 20px; }
  .practice-card { min-height: 116px; padding: 18px; }
  .practice-card-copy strong { font-size: 18px; }
  .practice-number { width: 54px; height: 60px; font-size: 23px; }
  .tabTitle { font-size: 21px; }
  #divImagesLoading, body.practice-loading #divImagesLoading { padding: 26px 22px; }
}
@media (max-width: 440px) {
  .pyteach-login-nav { flex-direction: column; justify-content: center; padding: 12px 16px; gap: 4px; }
  .practice-card { gap: 10px; padding: 16px 12px; }
  .practice-number { width: 46px; height: 54px; font-size: 21px; }
  .practice-arrow { width: 28px; height: 28px; }
  .questionList.task_icons { gap: 14px; }
  .task_icons .icon { min-height: 210px; padding: 16px 8px; border-radius: 18px; }
  .task_icons .icon_title, .task_icons .icon_title a { font-size: 13px; }
  .task_icons .icon_img img { max-width: min(110px,100%); max-height: 85px; }
  .headerAutoHeight_title { flex-basis: 100%; order: -1; }
  .headerAutoHeight_title .questionTitle, .headerAutoHeight_title .questionTitle.contestTitle { font-size: 22px; }
  .headerAutoHeight_button > button { padding: 6px 10px; font-size: 12px; }
  .headerAutoHeight_score > b { padding: 5px 9px; }
  .loading-title { font-size: 19px; }
  .loading-description { font-size: 12px; }
  #legacy-auth-recovery a, #legacy-auth-recovery button { width: 100%; }
}
@media (max-width: 781px) {
  /* Task helpers can switch the 782px document's iframe to 100%; keep its board reachable. */
  #question-iframe-container.newInterfaceIframeContainer > #question-iframe:is([style*="width: 782px"], [style*="width: 100%"]) { min-width: 782px; }
  #question-iframe-container.newInterfaceIframeContainer:has(> #question-iframe:is([style*="width: 782px"], [style*="width: 100%"])) > .question-pan-hint { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  .practice-card, .task_icons .icon, #practiceProgressFill, #exerciseProgressFill, .headerAutoHeight_button > button { transition: none; }
  .practice-card:hover, .practice-card:active, .task_icons .icon:hover, .headerAutoHeight_button > button:active { transform: none; }
}

.practice-card-locked { opacity: .65; cursor: default; }

.pyteach-memorial { max-width: 760px; margin: 36px auto 0; padding: 20px 16px 8px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 450; line-height: 2.2; text-align: center; overflow-wrap: anywhere; }
